πŸ—ΊοΈlocalization

The bot supports multiple languages. Translation files are in data/locale/.


Available Languages

Code
Language
File

en

English

data/locale/en.json

pl

Polish

data/locale/pl.json


Setting Language

In shared/config.lua:

Config.Locale = 'en'  -- or 'pl'

Translation Keys

en.json (English)

{
    "player_not_online": "❌ Player not online",
    "player_not_found": "❌ Player not found",
    "no_permission": "❌ No permission",
    "unknown_command": "❌ Unknown command: %s",
    "usage": "Usage: %s",
    
    "banned": "πŸ”¨ Banned **%s** for %s\nBan ID: `%s`\nReason: %s",
    "unbanned": "βœ… Unbanned **%s** (Ban ID: %s)",
    "no_active_ban": "❌ No active ban for: %s",
    "ban_found": "πŸ”¨ **Ban found:**\nBan ID: %s\nPlayer: %s\nReason: %s\nExpires: %s",
    "no_bans": "πŸ“‹ No active bans",
    "active_bans": "πŸ“‹ **Active bans (%d):**\n%s",
    
    "warned": "⚠️ Warned **%s** (%d/5)\nReason: %s",
    "no_warnings": "βœ… No warnings for: %s",
    "warnings_list": "⚠️ **Warnings (%d):**\n%s",
    "warning_removed": "βœ… Removed warning #%d for %s",
    "warning_not_found": "❌ Warning #%d not found",
    "warnings_cleared": "βœ… Cleared warnings for: %s",
    
    "kicked": "πŸ‘’ Kicked **%s**\nReason: %s",
    "no_players": "πŸ“‹ No players online",
    "players_online": "πŸ“‹ **Online (%d):**\n%s",
    
    "announced": "πŸ“’ Announced: %s",
    "announce_no_message": "❌ Please provide announcement message",
    
    "chat_warning": "You have been warned: %s (%d/5)",
    "ban_message": "You are banned!\n\nReason: %s\nBan ID: %s\nExpires: %s",
    "checking_ban": "Checking ban status...",
    
    "server_restarting_default": "Server is restarting...",
    "server_restart_announce": "Restart in %d seconds: %s",
    "server_restarting": "πŸ”„ Server restarting in %d seconds",
    
    "server_shutting_down_default": "Server is shutting down...",
    "server_shutdown_announce": "Shutdown in %d seconds: %s",
    "server_shutting_down": "πŸ›‘ Server shutting down in %d seconds",
    
    "kickall_default": "All players kicked by admin",
    "kicked_players": "πŸ‘’ Kicked %d players",
    
    "could_not_get_license": "Could not get license",
    "resource_not_found": "❌ Resource **%s** not found",
    "resource_invalid_action": "❌ Invalid action. Use: start, stop, restart"
}

Adding New Language

1

Create Translation File

Copy data/locale/en.json and rename to your language code, for example:

2

Translate Values

Translate all values, keeping the keys and placeholders. Example:

3

Set Language in Config

In shared/config.lua change the locale code:


Placeholder Reference

Placeholder
Description

%s

String (text)

%d

Number (integer)

%f

Number (decimal)

Examples:


Using Translations in Code

The L() function retrieves translations:


circle-info

Best Practices

  • Keep placeholders in order β€” The order of %s and %d must match the original.

  • Test your translations β€” Make sure all commands work after translating.

  • Use UTF-8 encoding β€” Save files with UTF-8 encoding for special characters.

  • Keep emoji β€” Emoji work in Discord; keep them for visual feedback.