Skip to main content

TableLocaleLoader

Loads a table-driven translator's already-decoded, in-memory entries. The data is a single locale already in memory, so there is no per-locale laziness -- every entry point queues the full set once.

Registered as a service by the JSONTranslator that owns it, and writes land on the TranslatorService resolved from the same bag. Shares the loader surface (LoadSourceLocale / LoadLocale / LoadAllLocales) with InstanceLocaleLoader so JSONTranslator can drive either the same way.

Functions

new

TableLocaleLoader.new(
translatorNamestring,
entries{any}--

already-decoded localization entries

) → TableLocaleLoader

Constructs a new TableLocaleLoader. Register it on the ServiceBag that provides the TranslatorService its writes land on.

Init

TableLocaleLoader.Init(
serviceBagServiceBag
) → ()

Initializes the loader. Should be done via ServiceBag.

LoadSourceLocale

TableLocaleLoader.LoadSourceLocale(selfTableLocaleLoader) → ()

Queues the entries. See TableLocaleLoader.

PromiseSourceLocale

TableLocaleLoader.PromiseSourceLocale(selfTableLocaleLoader) → Promise<()>

Queues the entries and resolves. In-memory data has nothing to fetch, so the source locale is available the moment it is asked for. Mirrors InstanceLocaleLoader.PromiseSourceLocale so JSONTranslator can await either.

LoadAllLocales

TableLocaleLoader.LoadAllLocales(selfTableLocaleLoader) → ()

Queues the entries. See TableLocaleLoader.

PromiseAllLocales

TableLocaleLoader.PromiseAllLocales(selfTableLocaleLoader) → Promise<()>

Queues the entries and resolves. Mirrors InstanceLocaleLoader.PromiseAllLocales so TranslatorService.PromiseLoadAllLocales can drive either.

LoadLocale

TableLocaleLoader.LoadLocale(
_localeIdstring
) → ()

Queues the entries. In-memory data is fully loaded up front, so there is nothing to defer for a specific locale.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new [TableLocaleLoader]. Register it on the [ServiceBag] that provides the\n[TranslatorService] its writes land on.",
            "params": [
                {
                    "name": "translatorName",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "entries",
                    "desc": "already-decoded localization entries",
                    "lua_type": "{ any }"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "TableLocaleLoader"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "src/clienttranslator/src/Shared/Loaders/TableLocaleLoader.lua"
            }
        },
        {
            "name": "Init",
            "desc": "Initializes the loader. Should be done via [ServiceBag].",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "TableLocaleLoader"
                },
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 65,
                "path": "src/clienttranslator/src/Shared/Loaders/TableLocaleLoader.lua"
            }
        },
        {
            "name": "LoadSourceLocale",
            "desc": "Queues the entries. See [TableLocaleLoader].",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "TableLocaleLoader"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 76,
                "path": "src/clienttranslator/src/Shared/Loaders/TableLocaleLoader.lua"
            }
        },
        {
            "name": "PromiseSourceLocale",
            "desc": "Queues the entries and resolves. In-memory data has nothing to fetch, so the source\nlocale is available the moment it is asked for. Mirrors\n[InstanceLocaleLoader.PromiseSourceLocale] so [JSONTranslator] can await either.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "TableLocaleLoader"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<()>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 87,
                "path": "src/clienttranslator/src/Shared/Loaders/TableLocaleLoader.lua"
            }
        },
        {
            "name": "LoadAllLocales",
            "desc": "Queues the entries. See [TableLocaleLoader].",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "TableLocaleLoader"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 96,
                "path": "src/clienttranslator/src/Shared/Loaders/TableLocaleLoader.lua"
            }
        },
        {
            "name": "PromiseAllLocales",
            "desc": "Queues the entries and resolves. Mirrors [InstanceLocaleLoader.PromiseAllLocales] so\n[TranslatorService.PromiseLoadAllLocales] can drive either.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "TableLocaleLoader"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<()>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 106,
                "path": "src/clienttranslator/src/Shared/Loaders/TableLocaleLoader.lua"
            }
        },
        {
            "name": "LoadLocale",
            "desc": "Queues the entries. In-memory data is fully loaded up front, so there is nothing to\ndefer for a specific locale.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "TableLocaleLoader"
                },
                {
                    "name": "_localeId",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 118,
                "path": "src/clienttranslator/src/Shared/Loaders/TableLocaleLoader.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "TableLocaleLoader",
    "desc": "Loads a table-driven translator's already-decoded, in-memory entries. The data is a\nsingle locale already in memory, so there is no per-locale laziness -- every entry\npoint queues the full set once.\n\nRegistered as a service by the [JSONTranslator] that owns it, and writes land on the\n[TranslatorService] resolved from the same bag. Shares the loader surface\n(LoadSourceLocale / LoadLocale / LoadAllLocales) with [InstanceLocaleLoader] so\n[JSONTranslator] can drive either the same way.",
    "source": {
        "line": 14,
        "path": "src/clienttranslator/src/Shared/Loaders/TableLocaleLoader.lua"
    }
}