Situm supports the internationalisation of the following cartography elements:
- Buildings: name, address and information
- Floors: name
- Point of Interest (POI): name and information
- POI Categories: name.
In order to internationalize these elements, you will need to use custom fields.
- The key will a concatenation between the field name and the translation language (<field name>_<language id>), language specified in following ISO_639-1 convention
- The value will be the translation of the field.
The list of accepted custom fields is shown below
Building | Floor | POI | POI categories |
---|---|---|---|
name_lang -> name description_lang -> address info_lang -> information | name_lang -> name | name_lang -> name info_lang -> information | name_lang -> name |
For example, if we want to translate the name of a POI (Point of Interest) into German, the key will be name_de and the value Eingang:
As a more complete example, assume we have a building called “My Building” with the following information and custom-fields:
Building | Floor | POI |
---|---|---|
Name: “My Building” Address: “My address” Description: “Some building info …” Custom fields: * name_es: “Mi edificio” * name_ar: “بنايتي” * description_es: “Mi dirección”. * description_ar: “عنواني” * info_es: Alguna información sobre el edificio * info_ar: “بعض معلومات البناء …” | Name: “GRND” Custom fields: * name_es: “BAJO” * name_ar: “ب.” | Name: “Parking”. Info: “Opening hours: 08:00 – 23:00”. Custom fields: * name_es: “Aparcamiento” * name_ar: “موقف سيارات” * info_es: “Horario: 08:00 – 23:00” * info_ar: “ساعات عمل مواقف السيارات: 08:00 – 23:00” |
Effect of internationalization on Map Viewer #
The Map Viewer will show internationalized elements in the appropriate language, as long as they have a valid translation. Otherwise, the fallback language (english) will be used.
Effect of internationalization on Mobile SDKs #
The SDKs use automatically the language set on the device and generate the API headers automatically (see previous API explanation). Therefore, the data is substituted automatically in the appropriate SDK fields with the corresponding translation. See Situm SDK Internationalization section for more information and a complete usage example.
Effect of internationalization on Rest API #
The effect of the previous configuration is to substitute the appropriate fields in the API responses with the right translation. The REST API accepts the header “Accept-Language” and based on its value, translates the appropriate fields. If no translation exists, it falls back to the original field value as specified in the Situm Dashboard formulary. For example:
Request when no language is specified (or when a language that has not been specified in the custom-fields is provided):
curl --location --request GET 'https://dashboard.situm.com/api/v1/pois' \
--header 'Authorization: Bearer <Token>'
Request for German language:
curl --location --request GET 'https://dashboard.situm.com/api/v1/pois' \
--header 'Accept-Language: de' \
--header 'Authorization: Bearer <Token>'