🗺️localization

🌍 Localization

Overview

SL-Chat supports multiple languages through JSON translation files located in data/language/.


Available Languages

Language
File

English

data/language/en.json

Polish

data/language/pl.json


Configuration

Set the default language in shared/translate.config.lua:

Translate.DefaultLanguage = 'pl'  -- or 'en'

Translation File Structure

English (en.json)

{
    "chat": {
        "cooldown": "You must wait {remaining} seconds before using this command.",
        "messageTooShort": "Message is too short.",
        "messageTooLong": "Message is too long.",
        "noPermission": "You don't have permission to use this command.",
        "playerNotFound": "Player not found.",
        "reportSent": "Report sent to staff.",
        "streamerModeEnabled": "Streamer mode enabled.",
        "streamerModeDisabled": "Streamer mode disabled."
    },
    "commands": {
        "me": {
            "description": "Describe your action"
        },
        "do": {
            "description": "Describe the environment"
        },
        "try": {
            "description": "Attempt an action",
            "success": "succeeded",
            "failure": "failed"
        }
    }
}

Polish (pl.json)


Adding New Language

  1. Create new file: data/language/de.json (German example)

  2. Copy structure from en.json

  3. Translate all strings

  4. Set in config:


Using Translations

In Server Scripts

With Placeholders


Placeholder Format

Use {placeholder} in translation strings:


Template Translations

Template labels can also be translated:


Next Steps

  • 🛠️ Configuration - Main config

  • 💬 Commands - Chat commands

  • 📝 Templates - Template system

Last updated