i18nPlugin
Defined in: plugins/i18nPlugin.ts:71
i18n module class.
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new i18nPlugin(
id
):i18nPlugin
Defined in: plugins/Plugin.ts:48
Parameters
Section titled “Parameters”string
= 'Plugin'
Returns
Section titled “Returns”i18nPlugin
Inherited from
Section titled “Inherited from”Properties
Section titled “Properties”__dill_pixel_method_binding_root
Section titled “__dill_pixel_method_binding_root”__dill_pixel_method_binding_root:
boolean
Defined in: plugins/Plugin.ts:39
Inherited from
Section titled “Inherited from”Plugin
.__dill_pixel_method_binding_root
readonly
id:"i18n"
='i18n'
Defined in: plugins/i18nPlugin.ts:72
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”onLocaleChanged
Section titled “onLocaleChanged”onLocaleChanged:
Signal
<(locale
) =>void
>
Defined in: plugins/i18nPlugin.ts:73
Implementation of
Section titled “Implementation of”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get app():
A
Defined in: plugins/Plugin.ts:53
Returns
Section titled “Returns”A
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”locale
Section titled “locale”Get Signature
Section titled “Get Signature”get locale():
string
Defined in: plugins/i18nPlugin.ts:82
Getter for locale.
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”locales
Section titled “locales”Get Signature
Section titled “Get Signature”get locales():
string
[]
Defined in: plugins/i18nPlugin.ts:86
Returns
Section titled “Returns”string
[]
Implementation of
Section titled “Implementation of”options
Section titled “options”Get Signature
Section titled “Get Signature”get options():
O
Defined in: plugins/Plugin.ts:44
Returns
Section titled “Returns”O
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”addSignalConnection()
Section titled “addSignalConnection()”addSignalConnection(…
args
):void
Defined in: plugins/Plugin.ts:79
Add signal connections to the container.
Parameters
Section titled “Parameters”…SignalConnection
[]
The signal connections to add.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Ii18nPlugin
.addSignalConnection
Inherited from
Section titled “Inherited from”clearSignalConnections()
Section titled “clearSignalConnections()”clearSignalConnections():
void
Defined in: plugins/Plugin.ts:85
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Ii18nPlugin
.clearSignalConnections
Inherited from
Section titled “Inherited from”destroy()
Section titled “destroy()”destroy():
void
Defined in: plugins/Plugin.ts:57
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”initialize()
Section titled “initialize()”initialize(
options
):Promise
<void
>
Defined in: plugins/i18nPlugin.ts:97
Initializes the i18n module. sets the default locale and loads the locale files.
Parameters
Section titled “Parameters”options
Section titled “options”Partial
<i18nOptions
>
The i18n options.
Returns
Section titled “Returns”Promise
<void
>
Promise
Implementation of
Section titled “Implementation of”Overrides
Section titled “Overrides”loadLocale()
Section titled “loadLocale()”loadLocale(
localeId
):Promise
<void
>
Defined in: plugins/i18nPlugin.ts:220
Loads a locale.
Parameters
Section titled “Parameters”localeId
Section titled “localeId”string
The locale id to load.
Returns
Section titled “Returns”Promise
<void
>
Promise
Implementation of
Section titled “Implementation of”parse()
Section titled “parse()”parse(
input
,locale
):string
Defined in: plugins/i18nPlugin.ts:196
Parses the input string and replaces anything in between {} braces, assuming it is a key in the dictionary.
Parameters
Section titled “Parameters”string
locale
Section titled “locale”string
= ...
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”postInitialize()
Section titled “postInitialize()”postInitialize(
_app
):void
|Promise
<void
>
Defined in: plugins/Plugin.ts:68
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
| Promise
<void
>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”setLocale()
Section titled “setLocale()”setLocale(
localeId
):Promise
<string
>
Defined in: plugins/i18nPlugin.ts:117
Sets the locale. If the locale is not loaded, it will load it first.
Parameters
Section titled “Parameters”localeId
Section titled “localeId”string
The locale id to set.
Returns
Section titled “Returns”Promise
<string
>
Promise
Implementation of
Section titled “Implementation of”t(
key
,params?
,locale?
):string
Defined in: plugins/i18nPlugin.ts:135
Translates a key into a string. If the key is not found, it will return an empty string. If the key is found, it will replace any placeholders in the string with the values from the params object. If the key contains a variant, it will select a random variant if the variant param is set to ‘random’. If the key contains a number variant, it will select the variant based on the variant param.
Parameters
Section titled “Parameters”string
The key to translate.
params?
Section titled “params?”The parameters to replace in the string.
locale?
Section titled “locale?”string
= ...
The locale to use for translation.
Returns
Section titled “Returns”string
The translated string.
Implementation of
Section titled “Implementation of”translate()
Section titled “translate()”translate(
key
,params?
,locale?
):string
Defined in: plugins/i18nPlugin.ts:186
Translates a key into a string (alias for t)
Parameters
Section titled “Parameters”string
The key to translate.
params?
Section titled “params?”The parameters to replace in the string.
locale?
Section titled “locale?”string
= ...
The locale to use for translation.
Returns
Section titled “Returns”string
The translated string.