18. Regional languages, fonts and layout
On this page
BASIC#
FUNCTION Run()
AWAIT SetGameLanguage({"language": "fr", "persist": true})
AWAIT ChangeVoiceLanguage({"language": "auto"})
END FUNCTIONLua#
local Script = {}
function Script.run()
await(SetGameLanguage({language = "fr", persist = true}))
await(ChangeVoiceLanguage({language = "auto"}))
end
return ScriptThese use the shared action names and property names. Their punctuation and waiting syntax depend on the scripting language.
The dedicated voice/subtitle actions update the running options, but do not by themselves promise a saved preference. The built-in Options menu's Apply Options saves the combined choices. If you use custom controls, arrange their persistence deliberately; do not assume a previous SetGameLanguage call saved voice changes made afterward.
For spoken-message actions, enter the original source sentence, then the appropriate Voice Key or explicit audio route. Do not switch the source sentence to French inside every branch of the script; let the translation table handle the language choice.
Use a base translation where it helps#
A regional code can fall back to its base. For example, a lookup for fr-ca can use fr text if there is no Canadian French override for that source.
1. Add fr and translate a sentence.
2. Add fr-ca with a clear name such as French (Canada).
3. Leave the Canadian French box empty for a line that can share the base translation.
4. Add a regional translation only where the wording needs to differ.
5. Register fr-ca before trying to select it through Set Game Language.
