Repository navigation
v0.2.0
Pre-release
Pre-release
Pre-release. SDKs and integration guide: README.
What's in 0.2.0
Breaking changes for integrations: the namespace and the language codes.
Changed
- Versioned API namespace in all SDKs: everything that talks to the API moved to
v1(TypeScriptsupertext-sdk/v1orimport { v1 } from 'supertext-sdk', PHPSupertext\Sdk\V1, Pythonsupertext.v1, .NETSupertext.Sdk.V1, Javacom.supertext.sdk.v1), so a later API version can be offered next to it. The SDK version constant (SDK_VERSION, PHPSupertext::SDK_VERSION, .NETSdkInfo.Version, JavaSdkInfo.VERSION) and the generic HTTP layer stay outside. Python's client class is nowSupertextClientlike the others. - No more language-code guessing.
LanguageCodes(default regions, normalizing, variant stripping) is replaced byLanguages: the API's 28 source and 37 target languages from the liveGET features(spec/languages.json), with names and whether a target offers formal/informal. A CMS code is resolved by the integration's mapping, else an exact match (case and_/-ignored:de_CH→de-CH), else the new errorunsupported_language; nothing is sent then. The client sends the codes it is given (trimmed). The old default regions were wrong for most languages: Supertext wants barees,nl,sl,cs, … (notes-ES,sl-SI),zh-Hans/zh-Hantandsr-Latn/sr-Cyrl, and doesn't offer ar, et, lt, lv, ro, th, uk or vi at all.
Added
getFeatures()on the client: the language pairs the API offers right now, with their features.- Error
unsupported_feature(HTTP 400FEATURE_ERROR, withfeature): e.g. politeness foren-US,rm,sq,sr-*orgsw-*.Languages.supportsPoliteness()tells integrations where to offer formal/informal. - The stand-in accepts exactly the live language list, answers unknown pairs with HTTP 404 like the live API, rejects politeness where it isn't offered, and lists the pairs on
GET features.
Fixed
invalid_language_pairis documented with HTTP 404, which the live API now answers for every pair it doesn't offer.