Localization
Last updated
Last updated
Some sort-me.org content are translated to multiple languages. Such API methods are marked as .
By default, Sort Me API will guess your preferred language based on source IP address. But this approach is not recommended.
However, we strongly recommend you to explicitly set your languages by passing your language codes in translations
parameter – it can be specified in query parameters:
You should specify translations in order of preference. In example above, server will check if content is available in ru
lang, and if yes, then return it. If not, it will do the same for uk
and then for en
.
Usually, localized response would contain two fields:
translations
- translations available for this object, so you can provide another translations in response, if you want to change the language of received object.
matched_translation
- which translation was selected by the server (based on translations parameter or your IP). The content in the response will be in this language.