new Globalization( [opt_options])
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
opt_options |
bu.language.GlobalizationOptions |
<optional> |
Options. |
- Source:
- bu/globalization.js
Fires:
- ol.Object.Event#event:change:language
Extends
- ol.Object
Methods
-
getByControl(control, property)
-
Obtains a translation for the given control and property. The translation is searched in
bu.strings. The classnames of the main element in the control will be used to search using the pattern "classname#property". If a key is found with any classnames + property combination then that key is used.Parameters:
Name Type Description controlbu.control.Control The control.
propertystring The property to be searched.
- Source:
- bu/globalization.js
-
getByKey(key)
-
Obtains a translation for the given key.
Parameters:
Name Type Description keystring - Source:
- bu/globalization.js
Returns:
- Type
- Object
-
getLanguage()
-
Gets the language.
- Source:
- bu/globalization.js
Returns:
The current language.
- Type
- bu.Languages
-
getLanguageNames()
-
Returns the names of the main languages available.
- Source:
- bu/globalization.js
Returns:
- Type
- Array.<bu.Languages>
-
getLanguages()
-
Returns the main languages available.
- Source:
- bu/globalization.js
Returns:
- Type
- Array.<bu.Languages>
-
setLanguage(lang)
-
Sets the language.
Parameters:
Name Type Description langbu.Languages The language.
- Source:
- bu/globalization.js
-
translateByControl(control, property, element [, attr])
-
Translates an HTML element attribute of a given control. The translation is searched in
bu.strings. The classnames of the main element in the control will be used to search using the pattern "classname#property". If a key is found with any classnames + property combination then that key is used.Parameters:
Name Type Argument Description controlbu.control.Control The control.
propertystring The property to search for.
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:
- bu/globalization.js
-
translateByKey(key, element [, attr])
-
Translates an HTML element attribute of a given control. The translation is searched in
bu.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:
- bu/globalization.js
Javascript API 7.x