惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
T
Threatpost
N
News and Events Feed by Topic
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
D
Docker
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
T
Troy Hunt's Blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
量子位
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
F
Full Disclosure
B
Blog
O
OpenAI News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
Forbes - Security
Forbes - Security
Know Your Adversary
Know Your Adversary
B
Blog RSS Feed
MongoDB | Blog
MongoDB | Blog
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
博客园 - 聂微东
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
Recorded Future
Recorded Future
IT之家
IT之家
Project Zero
Project Zero
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
SecWiki News
SecWiki News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How I Designed a 4-Layer i18n Architecture for Minecraft's Standard UI in Spigot
m.b · 2026-05-13 · via DEV Community

Introduction

This article is an implementation note on how I organized the i18n architecture for TreasureRun, a Minecraft Spigot plugin project.

When building multilingual messages in a Spigot plugin, custom plugin messages are relatively straightforward to manage with files such as languages/*.yml or messages.yml.

However, Minecraft's built-in standard UI text and system messages cannot be fully controlled by a Spigot plugin alone.

Examples include:

  • Standard text resolved by the Minecraft client's language files
  • Translatable components included in server-to-client packets
  • Text that can be supplemented through ResourcePack lang JSON files
  • Client-side language state that may need Fabric runtime sync
  • Login screens, settings screens, and other areas that the server cannot reach

Instead of trying to handle everything inside Spigot, TreasureRun separates the problem into four responsibilities:

  1. ProtocolLib boundary layer
  2. Server-side ResourcePack
  3. Fabric runtime language sync
  4. Pure Java packet localizer

This article explains how I separated Minecraft-dependent boundaries from pure i18n logic and made the core packet localization logic testable without starting a Minecraft server.


Background: Spigot alone cannot fully control Minecraft standard UI

Localizing custom messages in a Spigot plugin is not difficult by itself.

For example, a plugin can manage its own messages with files such as:

  • languages/ja.yml
  • languages/en.yml
  • languages/de.yml
  • languages/fr.yml
  • languages/ojp.yml

For custom game messages, the plugin can simply look up the player's selected language and return the corresponding string.

Minecraft's standard UI is different.

Minecraft has built-in translation keys that are resolved by the client-side language files.

Server-to-client JSON components can also include a translate key, such as:

{
  "translate": "multiplayer.player.left",
  "with": [
    {
      "text": "PlayerName"
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode

This kind of text cannot be handled just by replacing calls to sendMessage() on the Spigot side.


Understanding the problem

Minecraft text belongs to different layers, and the way it can be controlled depends on where it is owned.

Type Main owner Can Spigot alone control it?
Custom plugin messages Spigot plugin Yes
Some chat, title, and ActionBar packet messages Server-to-client packet Partially
Minecraft standard translation keys Client lang JSON Difficult with Spigot alone
Lang keys that ResourcePack can override ResourcePack Partially
Runtime client language state Fabric Mod Requires client-side support
Login screen and settings UI Minecraft client Basically no

In other words, Minecraft standard UI i18n is not just a translation file problem.

It is also a boundary design problem: I needed to identify which layer owns each piece of text.


Solution: separating the system into four layers

TreasureRun separates Minecraft standard UI i18n into four layers.

The following diagram shows the overall structure.

flowchart TD
    A["Minecraft Client<br/>Player UI"] --> B["Server-side ResourcePack<br/>Minecraft standard lang JSON"]
    A --> C["Fabric runtime sync<br/>Client-side language state / built-in ResourcePack"]

    D["Spigot Plugin<br/>TreasureRun game logic"] --> E["ProtocolLib Boundary Layer<br/>PacketEvent / Player / WrappedChatComponent"]
    E --> F["Pure Java Packet Localizer<br/>PacketI18nJsonLocalizer"]
    F --> G["Translator Callback<br/>languages/*.yml"]
    G --> F
    F --> E
    E --> A

    H["lang-map.yml<br/>TreasureRun lang code ↔ Minecraft locale code"] --> B
    H --> C
    H --> D

    I["JUnit Tests<br/>Boundary / Delegation / Pure i18n"] --> F
    I --> E

Enter fullscreen mode Exit fullscreen mode

In this design, Minecraft / Bukkit / ProtocolLib dependent code is kept inside the ProtocolLib Boundary Layer.

The JSON component parsing, translation key mapping, placeholder extraction, and translator callback handling are separated into the Pure Java Packet Localizer.

ResourcePack and Fabric runtime sync complement the client-side display and language state. lang-map.yml acts as a single source of truth for mapping TreasureRun language codes to Minecraft locale codes.

This separation allows the core packet i18n logic to be tested with JUnit without starting a Minecraft server.

Layer Responsibility
ProtocolLib boundary layer Observes server-to-client packets and writes modified JSON components back
Server-side ResourcePack Supplements Minecraft standard translation keys with lang JSON files
Fabric runtime sync Complements client-side language state and built-in ResourcePack behavior
Pure Java packet localizer Parses packet JSON, maps translation keys, extracts placeholders, and remains testable

The important point is separating Minecraft-dependent boundary code from pure i18n logic.


Layer 1: ProtocolLib boundary layer

The ProtocolLib boundary layer handles packet events, player lookup, packet type checks, and reading/writing WrappedChatComponent.

This layer depends heavily on Bukkit, ProtocolLib, and the Minecraft runtime.

If JSON parsing and translation logic are written directly in this layer, the logic becomes difficult to test without running a Minecraft server.

In TreasureRun, the ProtocolLib listener is treated as a boundary adapter. The actual JSON localization logic is delegated to the pure Java side.

Process Owned by
Receive PacketEvent ProtocolLib boundary layer
Look up the player's language ProtocolLib boundary layer
Extract JSON from WrappedChatComponent ProtocolLib boundary layer
Find translate keys in JSON Pure Java localizer
Extract placeholders Pure Java localizer
Convert the result back into a JSON text component Pure Java localizer
Write the result back to the packet ProtocolLib boundary layer

Layer 2: Server-side ResourcePack

The ResourcePack layer supplements Minecraft standard translation keys as lang JSON files.

ResourcePacks can affect standard translation keys that are resolved on the Minecraft client side.

In TreasureRun, I placed language JSON files in the ResourcePack based on Minecraft 1.20.1 standard translation keys.

Example paths:

resourcepacks/treasurerun-i18n-pack/assets/minecraft/lang/ja_jp.json
resourcepacks/treasurerun-i18n-pack/assets/minecraft/lang/en_us.json
resourcepacks/treasurerun-i18n-pack/assets/minecraft/lang/ojp_jp.json

Enter fullscreen mode Exit fullscreen mode

The ResourcePack is sent to the player after joining the server.

However, ResourcePack is not a complete solution.

For example, it cannot fully guarantee control over:

  • Login UI
  • Authentication screens
  • Client settings screens
  • Fully client-local UI
  • Text shown before the server sends packets or ResourcePacks

So I do not describe this project as fully controlling the entire Minecraft UI.

More accurately, it is a practical layered design for localizing the parts that can realistically be reached after a player joins the server.


Layer 3: Fabric runtime language sync

ResourcePack alone cannot always handle runtime client language state.

For this reason, the Fabric Mod side handles runtime language sync.

In TreasureRun, the Fabric side is responsible for:

  • Registering built-in ResourcePack support
  • Reading lang-map.yml
  • Receiving the selected language code from the server
  • Mapping TreasureRun language codes to Minecraft locale codes
  • Complementing the client-side language state

A key point is that the server does not send huge translation JSON files for all languages every time.

Instead, the server basically sends the selected language code.

The translation resources themselves live on the ResourcePack / Fabric Mod side.

This keeps the communication payload small and makes lang-map.yml the single source of truth for language mapping.


Layer 4: Pure Java packet localizer

The most important part of this design is the pure Java packet localizer.

TreasureRun separates packet JSON localization into a class named PacketI18nJsonLocalizer.

This class does not depend on Bukkit, ProtocolLib, Fabric, or Minecraft runtime APIs.

It only knows:

  • Raw JSON string
  • Selected language code
  • Translator callback

Conceptually, its responsibility looks like this:

PacketI18nJsonLocalizer.localizeJson(
    rawJson,
    lang,
    translator
);

Enter fullscreen mode Exit fullscreen mode

The pure Java localizer finds translate keys inside JSON components and maps Minecraft standard translation keys to TreasureRun i18n keys.

For example:

multiplayer.player.left

Enter fullscreen mode Exit fullscreen mode

can be handled as:

minecraft.packet.multiplayer.player.left

Enter fullscreen mode Exit fullscreen mode

Then it extracts placeholders and passes them to the translator callback.

Because this class is independent from the Minecraft runtime, it can be tested with JUnit.


Boundary tests

This design is not just separated in theory. It is also protected by tests.

Two representative tests are:

1. Pure i18n package boundary test

This test verifies that plugin.i18n does not import Bukkit, ProtocolLib, Fabric, or Minecraft runtime APIs.

In other words, it checks that the pure i18n package is not contaminated by platform dependencies.

This works as an architectural fitness function.

2. ProtocolLib listener delegation test

This test verifies that the ProtocolLib listener delegates JSON parsing to PacketI18nJsonLocalizer instead of directly owning the parsing logic.

This helps keep the packet boundary layer separate from the testable pure Java logic.


lang-map.yml as the single source of truth

TreasureRun centralizes the mapping between TreasureRun language codes and Minecraft locale codes in lang-map.yml.

Example:

mappings:
  ja:        ja_jp
  en:        en_us
  de:        de_de
  fr:        fr_fr
  es:        es_es
  ojp:       ojp_jp
  asl_gloss: asl_us

Enter fullscreen mode Exit fullscreen mode

With this design, adding a new language does not require adding another Java switch statement.

The intended flow for adding a new language is:

  1. Add one line to lang-map.yml
  2. Add languages/<lang>.yml
  3. Add <minecraft_locale>.json to the ResourcePack
  4. Add <minecraft_locale>.json to the Fabric side
  5. Let CI verify the consistency

This keeps language expansion configuration-driven instead of hard-coding every language in Java.


CI checks

As the number of i18n files grows, localization systems become easier to break.

TreasureRun uses GitHub Actions to run checks such as:

  • Java compile
  • YAML syntax check
  • Required key check
  • Referenced key check
  • Duplicate key check
  • Suspect key check
  • ResourcePack SHA1 check
  • i18n expansion check

These checks are run with a combination of Gradle tests and custom verification scripts.

For example, the checks verify whether referenced translation keys are actually defined, whether duplicate or suspicious keys remain, and whether the ResourcePack SHA1 matches the generated artifact.

For multilingual systems, adding translations is only one part of the problem.

It is just as important to detect broken states early.


Runtime verification

At runtime, I checked the system through logs such as:

  • ResourcePack sent
  • ResourcePack accepted
  • ResourcePack loaded
  • PacketI18n translate audit, monitored through PacketI18nJsonLocalizer
  • PacketI18n replace, handled through PacketI18nJsonLocalizer
  • Translation missing: 0
  • I18n Missing key warning: 0

The important point is that I did not just check whether it “seemed to work.”

I wanted to see which layer worked and how far the system actually reached.


What this design can do

This design makes it possible to:

  • Manage custom plugin messages with languages/*.yml
  • Supplement Minecraft standard translation keys through ResourcePack lang JSON
  • Observe translatable components in server-to-client packets
  • Replace some packet JSON based on the player's selected language
  • Complement runtime language sync on the Fabric side
  • Test the pure Java localizer without starting a Minecraft server
  • Detect broken i18n configuration through CI

What this design cannot do

There are still things this design cannot fully control.

A Spigot plugin alone cannot guarantee control over:

  • Login UI
  • Authentication screens
  • Client settings screens
  • Fully client-local UI
  • Text displayed before packets or ResourcePacks are sent
  • Text fully owned by the Minecraft client internally

So the scope of this project is:

This is not a system that fully translates the entire Minecraft UI. It is a layered design that separates Spigot-limited Minecraft standard UI boundaries into ProtocolLib, ResourcePack, Fabric, and a pure Java localizer, focusing on the parts that can realistically be reached after joining the server.


What I learned

The biggest lesson from this implementation was that i18n is not only translation work.

In a platform like Minecraft, I had to ask questions such as:

  • Is this text owned by the server?
  • Is it owned by the client?
  • Can it be observed in packets?
  • Can it be supplemented with a ResourcePack?
  • Does it need help from a Fabric Mod?
  • Is it effectively outside the server side's control?

In that sense, i18n was also a boundary design problem.

In TreasureRun, I separated Minecraft-dependent boundaries from pure logic so that the core i18n behavior could be tested as a normal Java component.


Conclusion

Spigot alone cannot fully control Minecraft standard UI text.

TreasureRun separates the problem into four layers:

  1. ProtocolLib boundary layer
  2. Server-side ResourcePack
  3. Fabric runtime language sync
  4. Pure Java packet localizer

With this separation, Minecraft-dependent boundary code stays inside adapter-like layers, while pure packet JSON localization logic can be tested with JUnit.

This design is based on the constraints of Minecraft as a platform.

The key was deciding which parts should be handled on the server side, which parts should be handled by ResourcePack or Fabric, and which parts are simply outside the practical reach of a Spigot plugin.

i18n was not just about adding more translation files.

It was about identifying which layer owns each piece of text and designing around the boundaries that can actually be controlled.