Localizer - stingray.Localizer object reference - Stingray Lua API Reference
The Localizer is a helper interface that offers access to localized strings that are contained in a single specified .strings resource.
A .strings resource can hold localized strings for many different languages. Use Localizer.set_language(),
to set the language that should be used for localization.
Example:
See also Localizing your game.
|
lookup ( self, key ) : string?
Retrieves the requested key from the set of strings understood by the localizer, respecting the resource property preference order that was set when you last loaded the .strings resource managed by the Localizer.
|
Parameters self : | stingray.Localizer | Specifies the object instance that this function will act on. You may use the colon : calling syntax to call this function on an instance of this object. If you do so, you must omit this parameter. For more information, see this Stingray help topic, or this page in the Lua documentation. |
key : | string | Specifies the key of the string to retrieve. |
Returns string? |
The string with the specified key, or nil if no matching key could be found.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
|
Specifies the language to use when looking up strings in the localizer.
|
Parameters language : | string? | Specifies the language that should be used by the localizer. Use en to use the default language (English). The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns | This function does not return any values. |