strings
Localization: one strings/<locale>.toml per language, keys to strings. [locale] in project.toml sets the starting locale and the fallback; a key neither…
On this page
Localization: one strings/<locale>.toml per language, keys to strings. [locale] in project.toml sets the starting locale and the fallback; a key neither has comes back as itself.
5 functions, 0 constants. Scripts reach it as strings::.
Functions
Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.
| function | acts on | what it does |
|---|---|---|
locale() -> string |
— | The locale in force. |
locales() -> [str] |
— | Every locale the project ships a strings/<locale>.toml for, in name order. |
set_locale(string) |
— | Switch locale; the next tr answers in it, which for a widget showing a key is the next frame. |
system_locale() -> str? |
— | The locale the operating system reports, like en-US, or nil when it says nothing; recorded with the session. A run starts in the shipped locale nearest it unless [locale] initial says. |
tr(string, any) -> string |
— | The string for a key in the current locale. {name} in it is replaced by the argument called name, and an n argument also picks the plural form the locale's language calls for. |