Skip to content

fix(messages): repair message file defects and complete zh/nl localization - #83

Open
wangzhizhou wants to merge 3 commits into
ez-plugins:mainfrom
OrzMC:fix/messages-files
Open

fix(messages): repair message file defects and complete zh/nl localization#83
wangzhizhou wants to merge 3 commits into
ez-plugins:mainfrom
OrzMC:fix/messages-files

Conversation

@wangzhizhou

Copy link
Copy Markdown

Summary

Fixes #80 and delivers the Chinese localization tracked in #81 — repairs duplicate keys, structural defects, and missing live keys in messages_zh.yml / messages_nl.yml, and completes the zh translation for all strings that actually render in-game.

Commits

  1. fix(messages): remove duplicate YAML keys across message files — merges the duplicated shop.common blocks in zh/nl (SnakeYAML kept only the last block, silently dropping 8 keys and logging duplicate keys found : common); adds regression test MessageFilesDuplicateKeyTest that parses all four messages_*.yml files in strict mode (allowDuplicateKeys = false).
  2. fix(messages): fully localize messages_zh.yml — translates ~130 live keys (those referenced by {translate:...} macros in config.yml / stock-gui.yml / shop.yml); adds missing live keys (commands.reload-*, commands.stock-admin.*, shop.categories.food.item-note, valuables.experience-bottle-display-name, stock-GUI localization); fixes shop.shop.rotationsshop.rotations and see-all.lore list → line1/line2 map.
  3. fix(messages): align messages_nl.yml with en structure — same structural fixes for nl, plus the missing shop.stock.gui keys (filters.*, pagination.*, localization.item-*).

Scope note

Only strings that flow through the message system are included. Java-hardcoded strings (e.g. PlayerShopMessages defaults, setup-shop GUI) are intentionally untouched.

Testing

  • MessageFilesDuplicateKeyTest — strict parse of all four message files, passes.
  • Verified the packaged jar embeds the updated files byte-for-byte.

Closes #80
Closes #81

Merge duplicated shop.common blocks in messages_zh.yml and messages_nl.yml
(8 keys were silently dropped, falling back to English), remove a stray
duplicate player-shops.messages key in messages_es.yml, and relocate the
Dutch player-shop message keys from the malformed hooks block to
player-shops.messages. Add a strict SnakeYAML regression test that fails on
any duplicate key in the bundled messages_*.yml files.
Translate ~130 live keys from English to Chinese across shop UI, stock
GUI, daily rotations and commands; add missing live keys (stock-admin,
reload messages, food.item-note, valuables.experience-bottle-display-name)
and fix two upstream structural bugs in the zh file:

- shop.shop.rotations double-nesting -> shop.rotations
- see-all.lore defined as a list, but stock-gui.yml references
  see-all.lore.line1/line2 -> convert to a line1/line2 map

zh now covers 327 keys; only inert sections remain untranslated
(player-shops chat messages and setup-shops GUI are Java defaults).
messages_nl.yml had the same two structural bugs as messages_zh.yml
previously, plus missing live keys referenced by stock-gui.yml translate
macros (which would render empty in Dutch):

- shop.shop.rotations double-nesting -> shop.rotations
- see-all.lore defined as a list, but stock-gui.yml references
  see-all.lore.line1/line2 -> convert to line1/line2 map
- add missing shop.stock.gui keys: localization.item-price-format /
  item-blocked / item-frozen / no-items, filters.*, pagination.*

en/es were already correct; this brings nl to full live-key coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Localization] Full Chinese translation of messages_zh.yml [Bug] messages_zh.yml / messages_nl.yml duplicate keys and structural defects

1 participant