OneLocale

OneLocale_Init(): Setup

locale_info := OneLocale_Init(optional_args := "")

What it does

Detects the user’s language, loads the best-matching .lang file (or baked map), and prepares everything for sT().

Accepts an object containing named values. See the table below.

Returns an object with various named values. Check .success first — if false, show .errmsg and abort.

Typical usage

locale_info := OneLocale_Init()
if !locale_info.success {
    MsgBox locale_info.errmsg, , "Icon!"
    ExitApp
}

Most useful optional_args (all others keep sensible defaults)

Key Default Meaning
sLangFolder “lang” Where your .lang files live
sName Script name Base name for ini/lang files
noLangFile false Use the .ini itself as the language file
sFallback “en” Language to use when nothing else matches
mapPriority true Baked maps win over loose .lang files

Parameters

{Object} optional_args - a set of named values, listed below. You only need to supply the values which are non-default.

Return Value

{Object} with the following properties:

Back to README