Add 国服 (Simplified-Chinese) item-paste translation#2334
Draft
addohm wants to merge 1 commit into
Draft
Conversation
Lets players paste an item copied from the Simplified-Chinese (WeGame / 国服)
PoE2 client and have PoB parse it, by translating the paste to the English
item-paste text the parser already expects. No parser changes — a thin hook in
the Item constructor runs the translation before sanitiseText(); it is a no-op
when the text contains no CJK, so English pastes are completely unaffected.
What it translates: item class, rarity, base type, unique name, properties
(quality/spirit/sockets/item level + weapon & defence stats), requirements,
explicit/implicit/rune/desecrated mod lines (via the client's StatDescriptions,
with (min-max) range + (augmented) stripping), flask/charm charge & duration
lines, granted skills, anointments (配置 X -> Allocates X, incl. passive-node
names), and affix annotations ({ 前缀属性 "name" (等阶:N) } with the affix name
translated so PoB fills prefix/suffix tiers).
Data: src/Data/ChineseTranslation.lua is generated by the self-contained
datamine toolchain in tools/cn-translate/ (Node + pathofexile-dat) from the
WeGame client, joining en<->zh on the language-independent metadata Id. NOTE:
regeneration requires the 国服 client (the only source of the SC strings), so it
can't be reproduced from the international GGPK — see tools/cn-translate/README.md.
Tested: spec/System/TestChineseItemParse_spec.lua round-trips a corpus of real
国服 pastes through the parser (base recognised; affix tiers populated; mods
resolved). ~94.5% line coverage on the corpus (remainder is procedural rare
names + unique flavour, which PoB ignores). Baseline item-parse specs unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets players paste an item copied from the Simplified-Chinese (WeGame / 国服) PoE2 client and have PoB parse it, by translating the paste to the English item-paste text the parser already expects. No parser changes — a thin hook in the Item constructor runs the translation before sanitiseText(); it is a no-op when the text contains no CJK, so English pastes are completely unaffected.
What it translates: item class, rarity, base type, unique name, properties (quality/spirit/sockets/item level + weapon & defence stats), requirements, explicit/implicit/rune/desecrated mod lines (via the client's StatDescriptions, with (min-max) range + (augmented) stripping), flask/charm charge & duration lines, granted skills, anointments (配置 X -> Allocates X, incl. passive-node names), and affix annotations ({ 前缀属性 "name" (等阶:N) } with the affix name translated so PoB fills prefix/suffix tiers).
Data: src/Data/ChineseTranslation.lua is generated by the self-contained datamine toolchain in tools/cn-translate/ (Node + pathofexile-dat) from the WeGame client, joining en<->zh on the language-independent metadata Id. NOTE: regeneration requires the 国服 client (the only source of the SC strings), so it can't be reproduced from the international GGPK — see tools/cn-translate/README.md.
Tested: spec/System/TestChineseItemParse_spec.lua round-trips a corpus of real 国服 pastes through the parser (base recognised; affix tiers populated; mods resolved). ~94.5% line coverage on the corpus (remainder is procedural rare names + unique flavour, which PoB ignores). Baseline item-parse specs unaffected.
Fixes # .
Description of the problem being solved:
Steps taken to verify a working solution:
Link to a build that showcases this PR:
Before screenshot:
After screenshot: