This class is used for internationalization of UI components.
| Name | Type | Description |
|---|---|---|
locale |
string |
A locale code, for example 'en-GB' |
opt_translationMap |
Object |
optional
An optional translation map for this
locale. If not provided, the |
Methods
-
This method retrieves translation keys for current locale. Keys from this set can be used to get translations via
translatemethod.Returns:
Type Description Array.<string> A string containin translation keys -
This method retrieves the current locale code, for example 'en-US'.
Returns:
Type Description string A locale identifier -
This method retrieves a Boolean value indicating whether the given localization object has a translation for the specified translation key.
Name Type Description keystring A transaltion key
Returns:
Type Description boolean trueif the key exists, otherwisefalse. -
This method retrieves translation for the key provided by the caller. It throws an exception if a translation is not available.
Name Type Description keystring A translation key
Returns:
Type Description string A localized string corresponding to the provided key