Skip to content

Language‐Files.md

Fragmer2 edited this page Feb 3, 2026 · 5 revisions

🌍 Language Files Guide

Overview

SpawnChestPlugin supports 10 languages with full localization. All messages, commands, and GUI text can be translated.


Supported Languages

Code Language Status
en English Complete
ru Russian (Русский) Complete
ua Ukrainian (Українська) Complete
es Spanish (Español) Complete
de German (Deutsch) Complete
fr French (Français) Complete
zh Chinese (中文) Complete
pt Portuguese (Português) Complete
pl Polish (Polski) Complete
it Italian (Italiano) Complete

Changing Language

In-Game Command

/chestconfig set language "ru"
/reloadchestconfig

Config File

Edit /plugins/SpawnChestPlugin/config.yml:

language: "ru"

Reload:

/reloadchestconfig

File Locations

/plugins/SpawnChestPlugin/lang/
├── en.yml    # English
├── ru.yml    # Russian
├── ua.yml    # Ukrainian
├── es.yml    # Spanish
├── de.yml    # German
├── fr.yml    # French
├── zh.yml    # Chinese
├── pt.yml    # Portuguese
├── pl.yml    # Polish
└── it.yml    # Italian

File Structure

Example (en.yml)

# System messages
system:
  plugin-enabled: "§a[SpawnChestPlugin] Plugin enabled!"
  plugin-disabled: "§c[SpawnChestPlugin] Plugin disabled!"
  config-reloaded: "§aConfiguration reloaded!"
  
# Commands
commands:
  no-permission: "§cYou don't have permission!"
  player-only: "§cThis command is for players only!"
  invalid-usage: "§cUsage: %usage%"
  
# Chest spawn messages
chest:
  spawn-broadcast: "§e🎁 %tier% Chest has spawned at: §fX: %x% Y: %y% Z: %z%"
  spawn-title: "§6§lChest Spawned!"
  spawn-subtitle: "§e%tier% §7at §f%distance% blocks"
  
  opened: "§aYou opened a %tier% chest!"
  disappeared: "§cA chest has disappeared!"
  
# Timer messages
timer:
  next-chest: "§e⏰ Next chest will spawn in §f%time%"
  set-interval: "§aSpawn interval set to %seconds% seconds"
  reset: "§aTimer reset! Chest will spawn in 10 seconds."
  
# And so on...

Message Placeholders

Common Placeholders

Placeholder Description Example
%player% Player name Steve
%tier% Chest tier Legendary
%count% Item count 25
%x% %y% %z% Coordinates 100, 64, -200
%time% Time remaining 5 minutes 23 seconds
%distance% Distance 450
%fraction% Item fraction 1/3 - One third
%type% Chest type Double Chest

Usage Example

chest:
  spawn-broadcast: "§e🎁 %tier% Chest at X: %x% Y: %y% Z: %z%"

Output:

🎁 Legendary Chest at X: 825 Y: 64 Z: -1456

Color Codes

Minecraft Color Codes

Code Color Example
§0 Black §0Text
§1 Dark Blue §1Text
§2 Dark Green §2Text
§3 Dark Aqua §3Text
§4 Dark Red §4Text
§5 Dark Purple §5Text
§6 Gold §6Text
§7 Gray §7Text
§8 Dark Gray §8Text
§9 Blue §9Text
§a Green §aText
§b Aqua §bText
§c Red §cText
§d Light Purple §dText
§e Yellow §eText
§f White §fText

Format Codes

Code Format Example
§l Bold Text
§m Strikethrough Text
§n Underline Text
§o Italic Text
§r Reset Normal

Usage

chest:
  spawn-title: "§6§lChest Spawned!"
  #           color+bold

Creating Custom Language

Step 1: Copy Template

cd /plugins/SpawnChestPlugin/lang
cp en.yml custom.yml

Step 2: Translate Messages

Edit custom.yml:

system:
  plugin-enabled: "Your translation here"
  plugin-disabled: "Your translation here"
  # ... translate all keys

Important:

  • Keep all keys (left side)
  • Only change values (right side)
  • Keep placeholders (%player%, etc.)
  • Keep color codes (§a, etc.)

Step 3: Set Custom Language

Edit config.yml:

language: "custom"

Reload:

/reloadchestconfig

Translation Guidelines

1. Keep Placeholders

** CORRECT:**

# English
opened: "§aYou opened a %tier% chest!"

# Russian
opened: "§aВы открыли %tier% сундук!"

** WRONG:**

# Russian (missing placeholder)
opened: "§aВы открыли сундук!"

2. Preserve Color Codes

** CORRECT:**

# English
spawn-title: "§6§lChest Spawned!"

# Spanish
spawn-title: "§6§l¡Cofre Apareció!"

** WRONG:**

# Spanish (removed colors)
spawn-title: "¡Cofre Apareció!"

3. Keep Line Breaks

# English
reset-warning-lore:
  - "§7You want to reset §e%tier% §7tier"
  - "§7Current items: §e%count%"
  - ""
  - "§cOnly items will be deleted!"

# Translate each line separately

4. Unicode Characters

For non-Latin scripts (Chinese, Russian, etc.), save as UTF-8:

Windows (Notepad++):

  1. Encoding → Convert to UTF-8
  2. Save

Linux:

file -bi zh.yml
# Should show: charset=utf-8

Contributing Translations

Want to add a new language?

  1. Fork repository on GitHub
  2. Copy en.yml to new language code:
    • ja.yml (Japanese)
    • ko.yml (Korean)
    • ar.yml (Arabic)
    • etc.
  3. Translate all keys
  4. Test in-game
  5. Submit pull request

Requirements:

  • Complete translation (all keys)
  • Native speaker preferred
  • Tested in-game
  • UTF-8 encoding

Language File Sections

System

Plugin startup/shutdown messages.

system:
  plugin-enabled: "Plugin enabled"
  plugin-disabled: "Plugin disabled"
  config-reloaded: "Config reloaded"
  custom-loot-saved: "Custom loot saved"

Commands

Command feedback messages.

commands:
  no-permission: "No permission"
  player-only: "Players only"
  invalid-usage: "Invalid usage"
  next-chest: "Next chest in..."

Chest

Chest spawn/open messages.

chest:
  spawn-broadcast: "Chest spawned at..."
  spawn-title: "Chest Spawned!"
  opened: "You opened chest"
  disappeared: "Chest disappeared"

GUI

Custom loot GUI text.

gui:
  custom-loot-title: "Custom Chest Loot"
  edit-common: "Edit Common"
  save-button: "Save & Enable"
  reset-button: "Reset & Disable"

Statistics

Stats and achievements.

statistics:
  your-stats: "Your Statistics"
  chests-opened: "Chests Opened"
  achievement-unlocked: "Achievement Unlocked!"

Abilities

Legendary item abilities.

abilities:
  dragon-slayer-activated: "Dragon Slayer activated!"
  phoenix-resurrected: "Phoenix Feather saved you!"
  on-cooldown: "On cooldown: %time%"

Testing Translations

In-Game Testing

  1. Change language:
/chestconfig set language "your_lang"
/reloadchestconfig
  1. Test features:

    • Spawn chest: /chestnow
    • Check timer: /nextchest
    • Open GUI: /putintothechest
    • View stats: /mystats
  2. Check for:

    • Missing translations (shows key instead)
    • Broken placeholders
    • Encoding issues (weird characters)

Console Testing

Check console for errors:

[SpawnChestPlugin] ERROR: Missing translation key: gui.save-button

If you see this, add missing key to language file.


Common Issues

Issue: Weird Characters (���)

Cause: File not saved as UTF-8

Fix:

  1. Open file in Notepad++ / VSCode
  2. Save as UTF-8 encoding
  3. Reload config

Issue: Message Shows Key Instead of Text

Player sees: "gui.save-button"
Instead of: "Save & Enable"

Cause: Missing translation key

Fix: Add key to language file:

gui:
  save-button: "Save & Enable"

Issue: Placeholder Not Replaced

Player sees: "You opened %tier% chest"
Instead of: "You opened Legendary chest"

Cause: Typo in placeholder

Fix: Check spelling:

  • %tier%
  • %teir%
  • %Tier%

Advanced: Multi-Line Messages

Lists

reset-warning-lore:
  - "§7Line 1"
  - "§7Line 2"
  - ""
  - "§cLine 4"

Output:

Line 1
Line 2

Line 4

Paragraphs

help-message: |
  §6=== SpawnChestPlugin Help ===
  §e/chestnow §7- Spawn chest now
  §e/nextchest §7- Check timer
  §e/mystats §7- View statistics

Output:

=== SpawnChestPlugin Help ===
/chestnow - Spawn chest now
/nextchest - Check timer
/mystats - View statistics

Language File Template

Minimal working language file:

# Your Language (Language Code)
# Translator: Your Name

system:
  plugin-enabled: "§a[SpawnChestPlugin] Enabled!"
  plugin-disabled: "§c[SpawnChestPlugin] Disabled!"
  config-reloaded: "§aConfig reloaded!"

commands:
  no-permission: "§cNo permission!"
  next-chest: "§e⏰ Next chest: §f%time%"

chest:
  spawn-broadcast: "§e🎁 %tier% Chest spawned!"
  opened: "§aOpened %tier% chest!"

gui:
  custom-loot-title: "§6Custom Loot"
  save-button: "§a✓ Save"

# ... add all other keys

Credits

Official Translations

  • English (en): Original
  • Russian (ru): [Translator Name]
  • Ukrainian (ua): [Translator Name]
  • Spanish (es): [Translator Name]
  • German (de): [Translator Name]
  • French (fr): [Translator Name]
  • Chinese (zh): [Translator Name]
  • Portuguese (pt): [Translator Name]
  • Polish (pl): [Translator Name]
  • Italian (it): [Translator Name]

Want to help translate? Submit a pull request!


Questions?

Translation help:

  • Discord #translations channel
  • GitHub Discussions

Report translation errors:

Clone this wiki locally