LocaleService configuration
Gets the current locale.
The current locale.
Sets the current locale.
Gets the list of available locales.
These are derived from the currently configured set of translations.
The list of available locales.
Replaces the current set of locale translations.
viewer.localeService.setMessages({
messages: {
"en": { // English
"NavCube": {
"front": "Front",
"back": "Back",
"top": "Top",
"bottom": "Bottom",
"left": "Left",
"right": "Right"
}
},
"mi": { // Māori
"NavCube": {
"front": "Mua",
"back": "Tuarā",
"top": "Runga",
"bottom": "Raro",
"left": "Mauī",
"right": "Tika"
}
}
}
});
Clears all locale translations.
Fires an event on this LocaleService.
Notifies existing subscribers to the event, optionally retains the event to give to any subsequent notifications on the event as they are made.
The event type name.
The event parameters.
Loads a new set of locale translations, adding them to the existing translations.
viewer.localeService.loadMessages({
"jp": { // Japanese
"NavCube": {
"front": "前部",
"back": "裏",
"top": "上",
"bottom": "底",
"left": "左",
"right": "右"
}
}
});
The new translations.
Cancels an event subscription that was previously made with LocaleService.on.
Subscription ID
Subscribes to an event on this LocaleService.
The event
Callback fired on the event
Handle to the subscription, which may be used to unsubscribe with .off.
Fires when the messages or the locale are updated
The loaded event
Called fired on the event
Translates the given string according to the current locale.
Returns null if no translation can be found.
String to translate.
Translated string if found, else null.
Translates the given phrase according to the current locale.
Returns null if no translation can be found.
Phrase to translate.
The plural number.
Translated string if found, else null.
Generated using TypeDoc
Localization service for a Viewer.