Skip to content

Localization

NagasonicDev edited this page Aug 16, 2026 · 1 revision

Localization

Alkatraz includes a localization system that lets server owners override any user-facing string the plugin displays. All messages — menu titles, tooltips, spell names, error messages — are stored in a single .lang file using a simple key = value format.

Overview

The plugin ships with a built-in English language file bundled inside the JAR. At startup, LangManager loads the bundled English strings first as a base layer, then overlays the language configured in config.yml. Any key you define in your filesystem .lang file overrides the corresponding bundled key.

Localization also supports YAML overrides — you can change the display_name or description of spells and research nodes directly from the lang file without editing the spell YAML files.

File Location

Bundled (read-only, inside the plugin JAR):

lang/english.lang          (loaded automatically as the base)

Custom (server filesystem):

plugins/Alkatraz/lang/<language>.lang

For example, to create a French translation:

plugins/Alkatraz/lang/french.lang

How to Configure

  1. Set the language in plugins/Alkatraz/config.yml:

    language: french

    The default value is english. The language name must match the filename (without .lang).

  2. Create your .lang file at plugins/Alkatraz/lang/<language>.lang. You only need to include the keys you want to change — any missing keys fall back to the bundled English strings.

  3. Reload the plugin with /alkatraz reload.

How to Override

Overriding UI strings

Copy the key from the bundled english.lang (see the full list below) and set your own value:

menu.spells = &5Hechizos
common.close = &cCerrar
spells.cast.not_enough_mana = &cNo hay suficiente maná

Overriding spell names and descriptions

You can override any spell's display_name and description using the override.spells.<id>.<field> format. The spell <id> is the folder name under spells/ (lowercase, no underscores — e.g. fireball, airblades).

override.spells.fireball.name = &6Bola de Fuego
override.spells.fireball.description = &7Una pequeña bola de fuego que puede\n&7lanzarse contra los enemigos.

Overriding research names and descriptions

Research nodes and categories can be overridden with override.research.nodes.<id>.<field> and override.research.categories.<id>.<field>:

override.research.categories.combat.name = &cCombate
override.research.nodes.fire_mastery.name = &6Maestría del Fuego
override.research.nodes.fire_mastery.description = &7Domina el arte del fuego.\n&7Daño incrementado con hechizos de fuego.

Formatting Codes

The & character is used as the color/formatting code prefix (Bukkit/Adventure compatible):

Code Effect
&0 - &9, &a - &f Colors
&k Obfuscated
&l Bold
&o Italic
&n Underline
&m Strikethrough
&r Reset

Placeholders

Placeholders use the %placeholder% syntax and are replaced at runtime:

Placeholder Context
%player% Player name
%spell% Spell display name
%circle% Circle level
%element% Element name
%value% Generic value
%current% / %max% Current and max values
%target% Target player
%duration% Effect duration
%slot% Equipment slot name
%points% Point amount
%amount% Amount
%name% Generic name
%time% Cooldown time
%page% / %total% Pagination
%mode% Cast mode
%count% Count
%spell% Spell name
%description% Description text

Example: Complete French Localization File

# ==============================
# Alkatraz — French Language File
# ==============================

# --- Common ---
common.back = &cRetour
common.close = &cFermer
common.confirm = &aConfirmer
common.cancel = &cAnnuler
common.info = &eInfo
common.next_page = &aPage Suivante
common.previous_page = &aPage Précédente
common.page_indicator = &ePage %current% / %total%

# --- Menu Titles ---
menu.spells = &5Sorts
menu.stats = &eStats de %player%
menu.progression = &5Progression
menu.arcane_table = &5Table Arcane
menu.equipment = &8Équipement
menu.grimoire = &6Grimoire
menu.recipe_book = &6Livre de Recettes
menu.research_library = &5Bibliothèque de Recherche

# --- Spell Casting ---
spells.cast.too_low_circle = &cCercle magique trop bas
spells.cast.cannot_cast_now = &cVous ne pouvez pas lancer de sort
spells.cast.not_enough_mana = &cPas assez de mana
spells.cast.please_wait = &cVeuillez patienter %time%s
spells.cast.not_discovered = &cVous n'avez pas découvert ce sort.

# --- Spell Override Example ---
override.spells.fireball.name = &6Boule de Feu
override.spells.fireball.description = &7Une petite boule de feu qui peut\n&7être lancée sur les ennemis.

Notes

  • Fallback behavior: If a key is missing in your lang file, the bundled English value is used. If a placeholder key is not found at all, the raw key string is returned (so missing translations are easy to spot).
  • Newlines in descriptions: Use \n in .lang files to insert line breaks. The system splits on \n when setting multi-line descriptions (e.g. spell descriptions, research descriptions).
  • Comments: Lines starting with # are ignored. Empty lines are also ignored.
  • UTF-8: Files are read as UTF-8, so non-ASCII characters (accents, special characters) are fully supported.
  • Reload: After creating or editing a lang file, run /alkatraz reload to apply changes without restarting the server.
  • English always loads first: The bundled English file is always loaded as the base. Your custom file only needs to contain the keys you want to override — you do not need to copy the entire English file.

Clone this wiki locally