Skip to main content

JsonToLocalizationTable

Utility to build a localization table from json, intended to be used with rojo. Can also handle Rojo json objects turned into tables!

Functions

localeFromName

JsonToLocalizationTable.localeFromName(
namestring--

The name to parse

) → string--

The locale

Extracts the locale from the name

getOrCreateLocalizationTable

JsonToLocalizationTable.getOrCreateLocalizationTable() → string--

The locale

Gets or creates the global localization table. If the game isn't running (i.e. test mode), then we'll just not parent it.

loadFolder

JsonToLocalizationTable.loadFolder(
tableNamestring,--

Used for source

folderFolder--

A Roblox folder with StringValues containing JSON, named with the localization in mind

) → ()

Loads a folder into a localization table.

toLocalizationTable

JsonToLocalizationTable.toLocalizationTable(
tableNamestring,--

Used for source

firstInstance | string,
secondtable?
) → LocalizationTable

Extracts the locale from the folder, or a locale and table.

loadTable

JsonToLocalizationTable.loadTable(
tableNamestring,--

Used for source

localeIdstring,--

the defaultlocaleId

dataTabletable--

Data table to load from

) → LocalizationTable

Extracts the locale from the name

addJsonToTable

JsonToLocalizationTable.addJsonToTable(
localizationTableLocalizationTable,--

The localization table to add to

localeIdstring,--

The localeId to use

jsonstring,--

The json to add with

tableNamestring--

Used for source

) → ()

Adds json to a localization table

Show raw api
{
    "functions": [
        {
            "name": "localeFromName",
            "desc": "Extracts the locale from the name",
            "params": [
                {
                    "name": "name",
                    "desc": "The name to parse",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "The locale",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 58,
                "path": "src/clienttranslator/src/Shared/Conversion/JsonToLocalizationTable.lua"
            }
        },
        {
            "name": "getOrCreateLocalizationTable",
            "desc": "Gets or creates the global localization table. If the game isn't running (i.e. test mode), then\nwe'll just not parent it.",
            "params": [],
            "returns": [
                {
                    "desc": "The locale",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 72,
                "path": "src/clienttranslator/src/Shared/Conversion/JsonToLocalizationTable.lua"
            }
        },
        {
            "name": "loadFolder",
            "desc": "Loads a folder into a localization table.",
            "params": [
                {
                    "name": "tableName",
                    "desc": "Used for source",
                    "lua_type": "string"
                },
                {
                    "name": "folder",
                    "desc": "A Roblox folder with StringValues containing JSON, named with the localization in mind",
                    "lua_type": "Folder"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 100,
                "path": "src/clienttranslator/src/Shared/Conversion/JsonToLocalizationTable.lua"
            }
        },
        {
            "name": "toLocalizationTable",
            "desc": "Extracts the locale from the folder, or a locale and table.",
            "params": [
                {
                    "name": "tableName",
                    "desc": "Used for source",
                    "lua_type": "string"
                },
                {
                    "name": "first",
                    "desc": "",
                    "lua_type": "Instance | string"
                },
                {
                    "name": "second",
                    "desc": "",
                    "lua_type": "table?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "LocalizationTable"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 125,
                "path": "src/clienttranslator/src/Shared/Conversion/JsonToLocalizationTable.lua"
            }
        },
        {
            "name": "loadTable",
            "desc": "Extracts the locale from the name",
            "params": [
                {
                    "name": "tableName",
                    "desc": "Used for source",
                    "lua_type": "string"
                },
                {
                    "name": "localeId",
                    "desc": "the defaultlocaleId",
                    "lua_type": "string"
                },
                {
                    "name": "dataTable",
                    "desc": "Data table to load from",
                    "lua_type": "table"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "LocalizationTable"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 148,
                "path": "src/clienttranslator/src/Shared/Conversion/JsonToLocalizationTable.lua"
            }
        },
        {
            "name": "addJsonToTable",
            "desc": "Adds json to a localization table",
            "params": [
                {
                    "name": "localizationTable",
                    "desc": "The localization table to add to",
                    "lua_type": "LocalizationTable"
                },
                {
                    "name": "localeId",
                    "desc": "The localeId to use",
                    "lua_type": "string"
                },
                {
                    "name": "json",
                    "desc": "The json to add with",
                    "lua_type": "string"
                },
                {
                    "name": "tableName",
                    "desc": "Used for source",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 166,
                "path": "src/clienttranslator/src/Shared/Conversion/JsonToLocalizationTable.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "JsonToLocalizationTable",
    "desc": "Utility to build a localization table from json, intended to be used with rojo. Can also handle Rojo json\nobjects turned into tables!",
    "source": {
        "line": 7,
        "path": "src/clienttranslator/src/Shared/Conversion/JsonToLocalizationTable.lua"
    }
}