new Locale(viewer)
Locale.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
FORGE.Viewer | The FORGE.Viewer reference. |
- Source:
- To Do:
-
- If you duplicate a plugin, locale file loaded count is superior than file count
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:
(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) 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 configuration files.
Parameters:
Name | Type | Description |
---|---|---|
config |
I18nLocaleConfig | The configuration data. |
- Source:
destroy()
Destroy method.
- Overrides:
- Source:
getKey(value, jsonKeyopt, nullable) → {string|undefined}
Get the key of an i18n value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
string | The value associated to the key you want. | |
jsonKey |
string |
<optional> <nullable> |
The json key to search into a specific file. |
- Source:
Returns:
Returns the key associated to the value if found, undefined if not.
- Type
- string | undefined
getValue(key, jsonKeyopt, nullable) → {string}
Get the locale value.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | The key to search for a locale. | |
jsonKey |
string |
<optional> <nullable> |
The json key to search into a specific file. |
- Source:
Returns:
The key to search for a locale.
- Type
- string
hasValue(key, jsonKeyopt, nullable) → {boolean}
Locale has a value?
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | The key to search for a locale. | |
jsonKey |
string |
<optional> <nullable> |
The json key to search into a specific file. |
- Source:
Returns:
Returns true if the locale has a value stored.
- Type
- boolean
loadFiles()
Load configuration files.
- Source:
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: