Translation System
The RPG Leveling plugin supports full localization with per-player languages. Each player picks their own language from the in-game Settings tab and the HUD, notifications, level-up titles, zone warnings, kill messages and/lvl info follow that choice. Server-side messages (logs, console output, broadcasts without a specific recipient) use the server default language.
How it works
The languages/ folder
All translation files live in:
<lang> is a lowercase identifier (no spaces) - for example english, french, spanish, de, pt_br. The exact code is what players store on their character; pick something simple and stable.
Examples:
Migration from older versions - If you upgrade from a version that usedmods/Zuxaw_RPGLeveling/MessagesLanguageMapping.json(single-file translation), the file is moved automatically intolanguages/on first start. If your old file is not English, rename it to the correct suffix (example:MessagesLanguageMapping_french.json) and setlanguage.display_name(example:Français), otherwise it will appear as English in the in-game picker.
Auto-discovery
On startup the plugin scanslanguages/ for any file matching MessagesLanguageMapping_*.json and loads it. There is no central registry to edit - drop a file in, restart, and the language appears in the in-game picker.
If MessagesLanguageMapping_english.json is missing, the plugin creates it from the in-code defaults so English is always available as a fallback.
Self-localizing display names
Each bundle declares its own display name under thelanguage section:
language.display_name for each detected file. There is no central translation table to keep in sync - the file describes itself.
If language.display_name is missing, the picker falls back to a capitalized version of the language code (french → French).
Keeping translations up to date
Every time the server starts (and on/lvl reload), language files are updated to include new text entries added by plugin updates while keeping your existing translated text:
- New entries are added with English text as placeholders.
- Old unused entries are removed.
- Your translated lines stay untouched.
- A short per-file report is printed in console.
Player-aware message routing
Every player has aLanguage field on their PlayerLevelData. When the plugin needs to display text to a specific player, it resolves the bundle in this order:
- The player’s chosen language (
PlayerLevelData.Language). - The server’s
DefaultLanguage(fromRPGLevelingConfig.json). english(always present).- In-code defaults (last-resort fallback so the game never shows a raw key).
Setting language from another mod
Server mods can change a player’s RPG Leveling language in code using the same bundle codes as inlanguages/. See API - Player language for dependencies, methods (setPlayerLanguage, setPlayerLanguageByUsername, etc.), and examples.
Server default language
The server-wide default lives inmods/Zuxaw_RPGLeveling/RPGLevelingConfig.json:
- New players who have not opened the picker yet.
- Server console output and log lines.
- Broadcasts that do not target a specific player (e.g. global XP boost titles still use each recipient’s own language; only truly recipient-less messages fall back to the default).
languages/ (for example "french" for a fully French-speaking server).
Picking a language in-game
- Open the Stats GUI (
/lvl gui, default key, or Open RPG GUI binding). - Click the Settings tab in the sidebar.
- Scroll to Language.
- Click Switch next to the language you want.
Adding a new translation
- Make sure the server has been started at least once so
languages/MessagesLanguageMapping_english.jsonexists. - Copy that file to
languages/MessagesLanguageMapping_<your_lang>.json(e.g.MessagesLanguageMapping_french.json). - Open your copy and translate the values only - never change the keys.
- Set
"language"."display_name"to what should appear in the picker (e.g."Français"). - Restart the server (or
/lvl reload). - Open Settings → Language in-game; your file should appear in the list.
What to translate, what to keep
- ✅ Translate the string values.
- ❌ Do not rename the keys (e.g.
level_up_title). - ❌ Do not change placeholders like
{0},{1}- they are replaced with player names, levels, XP values, etc. by the plugin. The order of placeholders must stay the same; you can move them around in the sentence as long as{0}still means “first argument”. - ❌ Do not translate plugin-internal identifiers (UUIDs, stat keys, brand name “RPG Leveling”).
Length and formatting
- The HUD and toast titles have limited width. If a translation overflows, prefer shorter wording over very long sentences.
- Numeric formatting (
+1,50%,100/200,Level 12) stays universal and is composed in code, so you usually translate the surrounding label, not the number.
Testing
After editing a file:- Run
/lvl reloadto pick up changes without restarting. - Switch to your language in Settings → Language.
- Check: HUD, level-up title, an XP gain toast, the kill message,
/lvl info, the Stats GUI Settings tab.
Smart merge report (console)
On startup or/lvl reload, each language file produces a short report:
Troubleshooting
My language file is not in the picker.- File name must match
MessagesLanguageMapping_<lowercase_code>.jsonexactly. - It must be inside
mods/Zuxaw_RPGLeveling/languages/(not in the parent folder). - Run
/lvl reloador restart the server; the picker reads the registry on open.
- Open your file and search for keys flagged in the merge report - they are probably new and still default to English.
- Missing keys fall back to English by design; this prevents broken GUIs after plugin updates.
MessagesLanguageMapping.json disappeared.
- It was moved to
languages/MessagesLanguageMapping_english.jsonby the upgrade migration. Your translations are preserved there.
- Delete
languages/MessagesLanguageMapping_<lang>.jsonand restart. For English, the plugin recreates it from defaults; for any other language you keep the file you authored.
Translation quality policy
This project does not rely on automatic AI translation quality for official language files.- We prefer translations made and reviewed by real players/community members.
- If you are not sure about a language, leave it in English until a native speaker provides a proper version.
Sharing translations
If you create a translation, please share it on our Discord - it can be added to the next release as an officially bundled language file.See also
- Messages Language Mapping - the file format in detail.
- Configuration Overview - all config files and
/lvl reload. - Commands -
/lvl reloadand friends.
