Localization
Localization
Section titled “Localization”The Info Hub supports multiple languages and full UI text customization.
Bundled Languages
Section titled “Bundled Languages”The following languages are included out of the box:
| Code | Language |
|---|---|
en-US | English (default fallback) |
de-DE | German |
fr-FR | French |
es-ES | Spanish |
pt-BR | Portuguese (Brazil) |
ru-RU | Russian |
pl-PL | Polish |
tr-TR | Turkish |
it-IT | Italian |
Folder Structure
Section titled “Folder Structure”plugins/InfoHub/localization/├── en-US.json # English (default/fallback)├── de-DE.json # German├── fr-FR.json # French├── es-ES.json # Spanish├── pt-BR.json # Portuguese (Brazil)├── ru-RU.json # Russian├── pl-PL.json # Polish├── tr-TR.json # Turkish├── it-IT.json # Italian├── custom_en-US.json # Custom overrides for English (optional)├── custom_de-DE.json # Custom overrides for German (optional)└── [your-lang].json # Your custom languageAdding a New Language
Section titled “Adding a New Language”- Copy an existing file (e.g.,
en-US.json) - Rename to your language code (e.g.,
ja-JP.json) - Translate all values
- Set
languageinconfig.jsonto the new code
{ "language": "ja-JP"}Custom Translation Overrides
Section titled “Custom Translation Overrides”You can override individual translation keys without modifying the bundled files. Create a file named custom_{lang}.json in the localization/ folder:
localization/custom_en-US.json{ "hub.title": "My Custom Hub Title", "hub.welcome": "Hey there, {player}!"}Custom files are loaded after the base language file, so only the keys you specify are overridden. This is the recommended way to customize text because your overrides survive language file updates.
:::tip Multiple Custom Files
You can use multiple custom files with any suffix: custom_en-US.json, custom_en-US_extra.json, etc. They are loaded in alphabetical order.
:::
Translation Keys
Section titled “Translation Keys”Hub Main Page
Section titled “Hub Main Page”{ "_localization_version": "1",
"hub.title": "Info Hub", "hub.welcome": "Welcome, {player}!", "hub.search.placeholder": "Search commands, rules, FAQ...", "hub.search.button": "Search", "hub.search.no_results": "No results found"}Sections
Section titled “Sections”{ "hub.section.commands": "Commands", "hub.section.commands.description": "All server commands", "hub.section.rules": "Rules", "hub.section.rules.description": "Server rules", "hub.section.faq": "FAQ", "hub.section.faq.description": "Frequently asked questions", "hub.section.serverinfo": "Server Info", "hub.section.serverinfo.description": "Server information and links", "hub.section.team": "Team", "hub.section.team.description": "Meet our team"}Commands Section
Section titled “Commands Section”{ "commands.title": "Commands", "commands.execute": "Execute", "commands.execute.confirm": "Are you sure?", "commands.aliases": "Aliases", "commands.permission": "Permission", "commands.usage": "Usage", "commands.no_permission": "You don't have permission for this command"}Rules Section
Section titled “Rules Section”{ "rules.title": "Server Rules", "rules.consequence": "Consequence", "rules.severity.low": "Info", "rules.severity.medium": "Warning", "rules.severity.high": "Severe", "rules.severity.critical": "Critical"}FAQ Section
Section titled “FAQ Section”{ "faq.title": "FAQ", "faq.questions": "Questions", "faq.count": "{count} Questions", "faq.search.placeholder": "Search FAQ...", "faq.expand_all": "Expand All", "faq.collapse_all": "Collapse All"}Team Section
Section titled “Team Section”{ "team.title": "Team", "team.members": "Members", "team.online": "Online", "team.offline": "Offline", "team.refresh": "Refresh"}Navigation
Section titled “Navigation”{ "nav.back": "Back", "nav.prev": "Previous", "nav.next": "Next", "nav.page": "Page {current}/{total}", "nav.close": "Close"}Messages
Section titled “Messages”{ "message.no_permission": "You don't have permission for this.", "message.reloaded": "Info Hub configuration reloaded.", "message.error": "An error occurred.", "message.link_copied": "Link copied to chat!"}Placeholders
Section titled “Placeholders”| Placeholder | Description |
|---|---|
{player} | Player name |
{count} | Number (e.g., commands, rules) |
{current} | Current page number |
{total} | Total page count |
{name} | Dynamic name |
{command} | Command name |
Complete Example (German)
Section titled “Complete Example (German)”{ "_localization_version": "1",
"hub.title": "Info Hub", "hub.welcome": "Willkommen, {player}!", "hub.search.placeholder": "Suche Commands, Regeln, FAQ...", "hub.search.button": "Suchen", "hub.search.no_results": "Keine Ergebnisse gefunden",
"hub.section.commands": "Commands", "hub.section.commands.description": "Alle Server-Befehle", "hub.section.rules": "Regeln", "hub.section.rules.description": "Server-Regeln", "hub.section.faq": "FAQ", "hub.section.faq.description": "Häufig gestellte Fragen", "hub.section.serverinfo": "Server Info", "hub.section.serverinfo.description": "Server-Informationen und Links", "hub.section.team": "Team", "hub.section.team.description": "Unser Team",
"commands.title": "Commands", "commands.execute": "Ausführen", "commands.aliases": "Aliase", "commands.permission": "Berechtigung",
"rules.title": "Server-Regeln", "rules.consequence": "Konsequenz", "rules.severity.low": "Info", "rules.severity.medium": "Warnung", "rules.severity.high": "Schwer", "rules.severity.critical": "Kritisch",
"faq.title": "FAQ", "faq.expand_all": "Alle ausklappen", "faq.collapse_all": "Alle einklappen",
"team.title": "Team", "team.online": "Online", "team.offline": "Offline",
"nav.back": "Zurück", "nav.prev": "Vorherige", "nav.next": "Nächste", "nav.page": "Seite {current}/{total}",
"message.no_permission": "Du hast keine Berechtigung dafür.", "message.reloaded": "Info Hub Konfiguration neu geladen."}Automatic Version Updates
Section titled “Automatic Version Updates”Each bundled language file includes a _localization_version key. When the plugin updates and adds new translation keys, it automatically:
- Creates a backup of your current file (e.g.,
en-US.json.backup-v8) - Extracts the new version from the JAR
- Logs the update in the server console
Your custom overrides in custom_*.json files are preserved through updates.
Per-Player Language
Section titled “Per-Player Language”Players can set their preferred language with /kslang. All Info Hub pages, section titles, and content respect the player’s individual language setting. The plugin checks I18nContext for per-player language first, falling back to the server-wide language setting in config.json.
Best Practices
Section titled “Best Practices”- Keep translations consistent - Use same terminology
- Test in-game - Some strings may be too long
- Include placeholders - Don’t remove
{player}etc. - Use custom files - Override keys in
custom_*.jsonto survive updates - Fallback - en-US is always loaded as the fallback language