header.banner.textheader.banner.link

📋 switcore.localization.sections.overview.title

switcore.localization.sections.overview.description

    switcore.localization.sections.features.title

    ⚙️ switcore.localization.sections.config.title

    switcore.localization.sections.config.description

    Locale File Structure

    -- resources/[switcore]/core/locales/en.lua
    return {
        ["commands.help"] = "Help command",
        ["commands.help.description"] = "Shows help information",
        -- ... more translations
    }
    
    -- resources/[switcore]/core/locales/ro.lua
    return {
        ["commands.help"] = "Comandă ajutor",
        ["commands.help.description"] = "Afișează informații de ajutor",
        -- ... more translations
    }

    💻 switcore.localization.sections.usage.title

    switcore.localization.sections.usage.description

    switcore.localization.sections.usage.examples.command.title

    switcore.localization.sections.usage.examples.command.description

    RegisterCommand('help', function(source, args)
        local locale = exports['switcore:core']:GetLocale(source)
        local message = exports['switcore:core']:Translate(source, 'commands.help')
        TriggerClientEvent('chat:addMessage', source, {
            color = {255, 255, 255},
            multiline = true,
            args = {"System", message}
        })
    end, false)

    switcore.localization.sections.usage.examples.localeFile.title

    switcore.localization.sections.usage.examples.localeFile.description

    -- Each module has its own locales folder
    resources/[switcore]/core/locales/
        en.lua
        ro.lua
    
    resources/[switcore]/characters/locales/
        en.lua
        ro.lua

    📚 switcore.localization.sections.api.title

    switcore.localization.sections.api.description

    switcore.localization.sections.api.functions.title

    switcore.localization.sections.api.functions.getLocale.name

    switcore.localization.sections.api.functions.getLocale.description

    exports['switcore:core']:GetLocale(source)

    switcore.localization.sections.api.functions.setLocale.name

    switcore.localization.sections.api.functions.setLocale.description

    exports['switcore:core']:SetLocale(source, locale)

    switcore.localization.sections.api.functions.translate.name

    switcore.localization.sections.api.functions.translate.description

    exports['switcore:core']:Translate(source, key, params)