new LocaleManager(viewer)
Manager for the locales.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
FORGE.Viewer | Reference to the FORGE.Viewer. |
- Source:
- To Do:
-
- Take into account that several configs could be loaded over time
- Find a behavior for default btw viewer config & story config & plugins config ... into parse config method
- Separate load events from request and complete
- Test to embed HTML with special characters like "" and ''
Extends
Members
(readonly) alive :boolean
Get the alive flag value of the object.
Type:
- boolean
- Inherited From:
- Source:
(readonly) className :string
Get the class name of the object.
Type:
- string
- Inherited From:
- Source:
data :*
Get and set any custom data you want to associate to this object.
Type:
- *
- Inherited From:
- Source:
debug :boolean
Get and set the debug flag.
Type:
- boolean
- Inherited From:
- Source:
localeIndex :number
Get and set the locale index.
Type:
- number
- Source:
locales :Array
Get and set the locales UID list.
Type:
- Array
- Source:
(readonly) onDestroy :FORGE.EventDispatcher
Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
- Inherited From:
- Source:
(readonly) onLocaleChangeComplete :FORGE.EventDispatcher
Get the "onLocaleChangeComplete" FORGE.EventDispatcher of the LocaleManager.
Type:
- Source:
(readonly) onLocaleChangeRequest :FORGE.EventDispatcher
Get the "onLocaleChangeRequest" FORGE.EventDispatcher of the LocaleManager.
Type:
- Source:
(readonly) tags :Array
Get the tags associated to this object.
Type:
- Array
- Inherited From:
- Source:
(readonly) uid :string
Get the uid of the object.
Type:
- string
- Inherited From:
- Source:
warning :boolean
Get and set the warning flag.
Type:
- boolean
- Inherited From:
- Source:
Methods
addConfig(config)
Add i18n configuration data.
Parameters:
Name | Type | Description |
---|---|---|
config |
I18nConfig | The configuration data. |
- Source:
destroy()
Destroy method.
- Overrides:
- Source:
getValue(key, jsonKeyopt, nullable) → {string}
Get value of for a selected locale.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | The key to get locale data. | |
jsonKey |
string |
<optional> <nullable> |
The json key to search into a specific file. |
- Source:
Returns:
Returns the locale value.
- Type
- string
hasValue(key, jsonKeyopt, nullable) → {boolean}
Is the selected locale has a value?
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | The key to get locale data. | |
jsonKey |
string |
<optional> <nullable> |
The json key to search into a specific file. |
- Source:
Returns:
Returns true if the locale has a value.
- Type
- boolean
log(value)
Basic log method, log a string in the console if debug is enabled.
Parameters:
Name | Type | Description |
---|---|---|
value |
* | The value you want to log in the console. |
- Inherited From:
- Source:
warn(valuenullable)
Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
string | Object |
<nullable> |
The value you want to warn in the console. |
- Inherited From:
- Source: