Please enable JavaScript to view this site.

PRD_SIS_004_Developer's Guide 2.6

Navigation: Implementation details

Internationalization of content

Scroll Prev Top Next More

Some resources have internationalized fields.

This concerns especially configuration resources such as Parks, Areas, Contracts, ...

This concerns mainly name and description fields

 

For internationalization of resources content, StreetSmart applies the language map pattern in JSON-LD specification: https://json-ld.org/spec/latest/json-ld/#string-internationalization Chapter 4.10:

"name": {

 "en": "London",

 "fr": "Londres",

 "ru": "Ло́ндон",

 "x-default": "London"

}

 

The language map uses available the language list and default language defined for the parent Park resource:

"availableLanguage": [

 { "identifier": "en"  },

 { "identifier": "fr"  },

 { "identifier": "ru"  },

],

"defaultLanguage": {

 "identifier": "en"

}

 

The x-default property maps to the property value in the default language of the Park. This prevents the park resource from having to know the default language and provides an always available property to sort resources by name.

For instance, a park (https://{domain}/{platform}/Park) for London City (UK) could be described this way:

"@context":{

 ...

},

"name": {

 "en": "London",

 "fr": "Londres",

 "ru": "Ло́ндон",

 "x-default": "London"

},

"description": {

 "en": "Capital and most populous city of England and the United Kingdom.",

 "fr": "Capitale et plus grande ville des états unis.",

 "ru": "столица и крупнейший город Соединённого Королевства Великобритании и Северной Ирландии.",

 "x-default": "Capital and most populous city of England and the United Kingdom."

},

"timezone": "Europe/London",

"currency": "GBP",

"availableLanguage": [

  { "identifier": "en" },

  { "identifier": "fr" },

  { "identifier": "ru" }

],

"defaultLanguage": { "identifier": "en" }

...

name.x-default gives the default value

name.fr gives the French translation

name.ru gives the Russian translation

When searching on the name field using DSL search, using name.* allows searching in all languages.