Localization Management - geosolutions-it/MapStore GitHub Wiki
MapStore provides different levels of localization management. Each widget / plugin allows the definition and management of different languages, moreover there are mechanisms to handle language localization of dynamic data.
TODO
MapStore is able to manage the "language localization" of the layers group names whether they are defined by configuration or that are dynamically added. The localization of the group name depends on the configuration of two properties of the "layerTree" plugin:
-
localLabelSep
String
Language separator for the groups name. The default value is "_". In the group name each language is separated by the localLabelSep string. Example:
english group name_italian group name_french group name_german group name
-
localIndexs
Object
Contains the index position (in the groupName array obtained from the group name splitted with the "localLabelSep" separator) for each language supported. The default object is:{ "en": 0, "it": 1, "fr": 2, "de": 3 }
For each supported language, the object contains the array index identified by the localization code. Example:
For a localIndexs :
{ "en": 0, "it": 1 }
The group name can be specified as follows:
group name_nome del gruppo
or as follows:
["group name", "nome del gruppo"]
If the current local code is not defined in localIndexs will be used the value 0.
MapStore is able to manage the "localization language" of a WMS layer title provided that the layer information, retrieved in the WMS GetCapabilities response, contain between "keywords" the layer title for each language supported. The keyword should have the following structure:
<localization code>=<layer title for the language>
In alternative, if an Identifier is defined in the WMS GetCapabilities response, where the authority equals the current locale, the Identifier value is used as the layer Title.
Example (keywords):
Original layer title: "roads"
Keyword to define the english layer title : "en=roads"
Keyword to define the italian layer title : "it=strade"
Example (identifier):
Original layer title: "roads"
Identifier to define the english layer title :
<Identifier>
<authority>en</authority>
<identifier>Roads</identifier>
</Identifier>
Identifier to define the italian layer title :
<Identifier>
<authority>it</authority>
<identifier>Strade</identifier>
</Identifier>
If the layer information, made ??available by the WMS, not contain a keyword for a language will be used the original layer title (in the example "roads").
MapStore is able to manage the "localization" of a WMS layer style provided that the layer information, retrieved in the WMS GetCapabilities response, contain between the available styles a style called:
<name of style to be localized>_<localization code>
for each language supported. Example:
Style name : "roads"
English style name : "roads_en"
Italian style name : "roads_it"
If the layer information, made available by the WMS, not contain a localized style will be used the style not localized (in the example "roads").