loca
Localization
4 Methods
loca Module
The loca static module provides access to the Stranded III internationalization (I18N) dictionary for translation key resolution and placeholder replacement.
Overview
Methods (4)
| Method Signature | Returns | Summary |
|---|---|---|
loca.tl(key)
|
string
|
Translates a localization key into the active language. |
loca.tl1(key, v1)
|
string
|
Translates a key with 1 replacement parameter. |
loca.tl2(key, v1, v2)
|
string
|
Translates a key with 2 replacement parameters. |
loca.tl3(key, v1, v2, v3)
|
string
|
Translates a key with 3 replacement parameters. |
Detailed Reference
loca.tl(key)
Translates a localization key into the active language.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
key | string | Localization dictionary key. |
Returns
stringTranslated string in current language.
Description
Looks up key in the localization table.
local text = loca.tl("msg_game_saved")loca.tl1(key, v1)
Translates a key with 1 replacement parameter.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
key | string | Localization key containing | |
v1 | any | First parameter value. |
Returns
stringFormatted translated string.
Description
Replaces {0} placeholder with v1.
loca.tl2(key, v1, v2)
Translates a key with 2 replacement parameters.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
key | string | Localization key containing | |
v1 | any | First value. | |
v2 | any | Second value. |
Returns
stringFormatted translated string.
Description
Replaces {0} and {1} placeholders with v1 and v2.
loca.tl3(key, v1, v2, v3)
Translates a key with 3 replacement parameters.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
key | string | Localization key containing | |
v1 | any | First value. | |
v2 | any | Second value. | |
v3 | any | Third value. |
Returns
stringFormatted translated string.
Description
Replaces {0}, {1}, and {2} placeholders with arguments.