new Globalization( [opt_options])
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
opt_options |
Mapspace.language.GlobalizationOptions |
<optional> |
Options. |
- Source:
- mapspace/globalization.js
Fires:
- ol.Object.Event#event:change:language
Extends
- ol.Object
Methods
-
getLanguage()
-
Gets the language.
- Source:
- mapspace/globalization.js
Returns:
The current language.
- Type
- Mapspace.Languages
-
getLanguageNames()
-
Returns the names of the main languages available.
- Source:
- mapspace/globalization.js
Returns:
- Type
- Array.<Mapspace.Languages>
-
getLanguages()
-
Returns the main languages available.
- Source:
- mapspace/globalization.js
Returns:
- Type
- Array.<Mapspace.Languages>
-
getTranslation(key)
-
Obtains a translation for the given key.
Parameters:
Name Type Description keystring - Source:
- mapspace/globalization.js
Returns:
- Type
- Object
-
setLanguage(lang)
-
Sets the language.
Parameters:
Name Type Description langMapspace.Languages The language.
- Source:
- mapspace/globalization.js
-
translate(key, element [, attr])
-
Translates an HTML element attribute of a given control. The translation is searched in
Mapspace.stringsusing the key provided.Parameters:
Name Type Argument Description keystring The key.
elementHTMLElement The HTML element to modify.
attrstring <optional>
The optional attribute of the element to modify. If not provided then the inner HTML will be replaced.
- Source:
- mapspace/globalization.js