Skip to main content

Messages Language Mapping

Folder: mods/Zuxaw_RPGLeveling/languages/ Files: MessagesLanguageMapping_<lang>.json (e.g. MessagesLanguageMapping_english.json) Each language is one file in the languages/ folder. This page describes the file format. For the high-level system, the in-game picker, and how to ship a translation, see the Translation System guide.
Migration from older versions - A single mods/Zuxaw_RPGLeveling/MessagesLanguageMapping.json was used before. On first start after upgrading, that file is moved into the new languages/ folder. If it is not English, rename it with the correct suffix (example: MessagesLanguageMapping_french.json) and set language.display_name, otherwise it will appear as English in the picker.

Overview

Each file contains all translatable text strings for one language and includes messages for:
  • Stat names and descriptions - Health, Stamina, Damage, Defense, etc.
  • HUD messages - Level, XP progress, zone names
  • GUI labels and buttons - Stat allocation, navigation, confirmations
  • Error messages - Invalid commands, permission errors
  • Notification messages - Level up, stat allocation, system messages
  • Command descriptions and responses - Help text, feedback messages
  • Self-localizing display name - language.display_name shown in the Settings → Language picker

Translation Support

Each player picks their own language at runtime; the server-wide fallback is LevelingConfig.DefaultLanguage in RPGLevelingConfig.json (default "english"). New player-facing keys land in English first; missing keys in a translated file fall back to English then to in-code defaults so the GUI never shows a raw key.

Adding a language

Drop MessagesLanguageMapping_<your_code>.json in languages/ (e.g. MessagesLanguageMapping_french.json), set language.display_name inside it, and restart or /lvl reload. The picker will list it automatically.

Common language codes

Any lowercase code works - pick something simple and stable:
  • english (always present)
  • french, spanish, german, portuguese, russian, japanese, chinese, …
  • Short codes like de, es, pt_br, zh_cn are also fine.

Setting language from another server mod

Other plugins can assign the same language codes at runtime (for quests, portals, region scripts, etc.). The public API accepts an online player id, an online player reference, or a character name (online first, then offline profile when available); clearing uses an empty value so DefaultLanguage applies. Full method list and Java examples are on the API page under Player language.

File Structure

Each language file is organized into logical sections, including a language block that describes the file itself:

language.display_name

This is the only place a language declares its human-readable name. The in-game picker reads it directly from each detected file, so adding a language is a pure file-drop with no central table to update.
If display_name is missing, the picker falls back to a capitalized version of the code (frenchFrench).

Common Message Keys

Stat Names (stats.names)

Stat Descriptions (stats.descriptions)

HUD Messages (hud)

Stats GUI - Settings tab (gui tree)

These keys live under the merged gui object in MessagesLanguageMapping_<lang>.json (same nesting as other GUI strings the plugin writes). Defaults are defined in MessageService.createDefaultMessages(). Custom .ui layouts should leave translatable Text empty and set strings from Java (see StatsGUIPage.appendSettingsTabUi). Player data keys (in PlayerLevelData, persisted): HideXpProgressNotifications, HidePassiveNotifications, Language.

Stats GUI - Language section keys

The Settings → Language section uses keys nested under gui.settings.language (defaults in MessageService.createDefaultMessages()):

Notifications (notifications)

Errors (errors)

Command Messages (commands)


Example Translation (French)

A partial MessagesLanguageMapping_french.json:
Drop this file in languages/, restart or /lvl reload, and “Français” appears in the Settings → Language picker.

Placeholders

Messages use MessageFormat-style placeholders - {0}, {1}, {2} etc., where {0} is the first argument passed by the plugin, {1} the second, and so on. The order of arguments is fixed by the plugin code; you can move placeholders around in your sentence as long as {0} still represents the first argument. Example:
The plugin calls this with (level, currentXP, neededXP), so:
  • {0} → level
  • {1} → currentXP
  • {2} → neededXP
Numeric formatting (+1, 50%, 1250 / 2000) stays universal and is built in code - you translate the surrounding label, not the number itself.

Creating a Translation

To create a full translation:
  1. Start the server once so languages/MessagesLanguageMapping_english.json exists.
  2. Copy that file to languages/MessagesLanguageMapping_<your_code>.json.
  3. Set language.display_name to your language’s native name.
  4. Translate every string value (never the keys).
  5. Keep {0}, {1}, … placeholders intact.
  6. Restart or /lvl reload, switch to your language in Settings → Language, and verify the HUD, GUI, commands, and notifications.
See the Translation System guide for the full workflow.

Formatting Tips

  • Keep placeholders intact - {0}, {1}, … must stay; only their position in the sentence may change.
  • Maintain similar length - long translations may overflow the HUD or toast titles.
  • Consistent terminology - use the same word for “level”, “stat”, etc. throughout.
  • Test thoroughly - HUD, GUI, /lvl info, level-up titles, kill messages, zone warnings.

File location and reload

  • Folder: mods/Zuxaw_RPGLeveling/languages/
  • File pattern: MessagesLanguageMapping_<lang>.json
  • Default fallback: Set in RPGLevelingConfig.jsonDefaultLanguage (default "english").
  • Apply changes without restarting: /lvl reload (rpgleveling.command.reload). See Configuration Overview.

See Also