Skip to content
Copied!
published on 2026-06-08

Localization

Settings (v0.2.2)

Settings ships with built-in UI strings for 16 languages, and strings within the schema can be localized using the same mechanism.

lang

ValueBehavior
"os"Resolved in order: the parent app's lang_key, then the OS language setting
BCP-47 codeForces a specific language (e.g. "ja", "de"). Language codes without built-in translations fall back to English

lang controls the display language for both the built-in UI translations and the localization tables in the schema. See Built-in 16 languages below for the list of supported language codes.

lang_key

toml
lang     = "os"
lang_key = "display.language"

When lang = "os", Settings reads the config key given by lang_key from the parent app's config file and matches its UI language to it. Since Settings is a tool for editing the parent app's configuration, it's natural for it to follow the parent app's own language setting. If no value can be obtained via lang_key, or there is no corresponding language, it falls back to the OS language setting.

[ui_strings]

Built-in UI strings (OK, Cancel, Browse…, etc.) can be individually overridden from the schema. For the list of keys, see UiStrings in the codebase (settings-schema/src/lib.rs). Some representative ones:

KeyPurpose
ok / cancel / applyButtons in the save bar
browseFile selection button
add / delete / delete_confirmAdding/removing subsections
reload / keep_editing / file_changedExternal change conflict dialog
window_titleWindow title bar string
toml
[ui_strings]
window_title = "My App Settings"

delete_confirm is a template string for the deletion confirmation dialog; {} is replaced with the name of the item being deleted (e.g. "Delete \"{}\"?").

For any key without an override, the built-in translation is used as-is.

Localizing schema strings

User-facing strings such as tab and field labels can be written either as a bare string (shared across all languages) or as an inline table keyed by language code.

toml
label = "Name"
label = { en = "Name", ja = "名前" }

Localizable fields: label, hint, hint_direct, hint_env, sublabel, file_filter, key_label, value_label, the message of constraints/validation rules, and others.

Non-localizable fields: strings such as options, options_from, suffix, id, key, which serve as identifiers or as values stored in the config file. These use the same value regardless of the selected language.

Built-in 16 languages

CodeLanguage
arArabic
zhChinese (Mandarin)
deGerman
enEnglish
frFrench
hiHindi
itItalian
jaJapanese
koKorean
nlDutch
ptPortuguese
ruRussian
esSpanish
svSwedish
trTurkish
viVietnamese

When determining the OS language for lang = "os", the match is on an exact comparison of the primary language subtag (the ja part of "ja-JP"). Language codes not in the list fall back to English. Using [ui_strings], you can supply every string yourself even for language codes without built-in translations.