Commit 8659a47
Add 国服 (Simplified-Chinese) item-paste translation
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>1 parent e5a5091 commit 8659a47
24 files changed
Lines changed: 41082 additions & 0 deletions
File tree
- spec/System
- src
- Classes
- Data
- Modules
- tools
- cn-translate
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
0 commit comments