WHLang — NPC Dialogue Localization
WHLang is an addon for NeoForge 1.21.1 and Forge 1.20.1 that adds multilingual dialogue support to the Without Honor: NPCs mod.
It allows each player to choose their preferred language for NPC dialogues, without requiring creators to duplicate or manually modify the original dialogue files.
The addon uses a hash-based identification system to recognize each dialogue entry and associate it with its corresponding translation. This keeps translations organized and helps preserve them even when the original dialogues are modified.
Features
-
Individual language selection: Each player can choose their own language.
-
Hash-based identification: Each dialogue entry receives a unique identifier.
-
Automatic dialogue scanning: Reads and registers text from Without Honor: NPCs dialogue files.
-
Translation management: Organizes translations into separate JSON files for each language.
-
Change detection: Identifies new or modified dialogue entries.
-
Translation preservation: Keeps existing translations during subsequent scans.
-
Text variations: Supports individual strings or arrays of alternative text entries.
-
Translation reloading: Reloads translation files without restarting the server.
-
Missing translation detection: Includes tools to find entries that still need translations.
-
Language detection: Identifies the language of existing text.
How It Works
-
Dialogues are created normally using the Without Honor: NPCs editor.
-
WHLang scans the dialogue files and identifies the entries that need translation.
-
Unique identifiers and JSON files are generated for each dialogue and language.
-
Translations are added to their respective files.
-
Each player selects their preferred language using
/whlang set. -
When interacting with NPCs, the system automatically displays dialogue in the selected language.
If a translation is unavailable, the original text is displayed as a fallback.
Included Tools
-
scan_dialogues.py— Scans dialogue files and manages translation entries. -
detectar_idioma.py— Detects the language of text. -
ver_dialogos.py— Allows users to inspect dialogues and find missing translations.
Compatibility
-
Minecraft 1.21.1
-
NeoForge
-
Without Honor: NPCs
WHLang aims to simplify dialogue localization for servers and projects using NPCs, allowing creators to write their conversations in a single language while providing translated experiences for players.