Skip to content

Search

Documentação

strings

Localization: one strings/<locale>.toml per language, keys to strings. [locale] in project.toml sets the starting locale, the fallback and the locales…

Nesta página

Localization: one strings/<locale>.toml per language, keys to strings. [locale] in project.toml sets the starting locale, the fallback and the locales written right to left (right_to_left); a key neither has comes back as itself.

6 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.
right_to_left() -> bool — Whether the locale in force is written right to left: its language is in [locale] right_to_left, which starts as Arabic, Sorani, Dhivehi, Persian, Hebrew, Pashto, Sindhi, Uyghur, Urdu and Yiddish. A UI in one lays out mirrored: rows run from the right, start and end swap, and an icon its theme lists under [icons] mirrored turns round.
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.

Tens a certeza?