Sort Me API
  • 👋Sort Me Documentation
  • API Methods
    • ⚰️Problems
    • 🚲Submissions
    • 🏆Contests
    • 📚Archives
    • ❤️Users
    • 🛰️Websocket
      • /listenSubmission
      • /contestEvents
    • 👾Miscellaneous
  • Tricky moments
    • 🛂Account limits
    • 🔑Authorization
    • 🗃️Pagination
    • 🈂️Localization
    • 🖼️Images
Powered by GitBook
On this page
  1. Tricky moments

Localization

Last updated 1 year ago

Some sort-me.org content are translated to multiple languages. Such API methods are marked as .

Setting preferred languages

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.

🈂️
🈂️
Localization applies
https://sort-me.org/api/problems/getByID?id=1&translations=ru,uk,en