The remaining Chinese was one measurement bug and one structural gap.
Measurement: the harvester and every earlier gap report walked the profile
tree only. 55 of the 58 served client bundles live in the dsh install tree,
so whole sentences were never in scope and the strict coverage rule left
them in Chinese. Scanning the tree the browser actually receives showed
74.27% coverage, not the ~100% previously claimed.
Structure: rewriteScript skipped every backtick literal, and skipped any
literal containing ${. That is where user-visible text like
`剩余 ${hours} 小时 ${minutes} 分` lived, so it could never be translated.
- scripts/analyze.ts walks the resolved served-bundle set (exported to
~/.cache/c2e/served.json by scripts/served.mjs) instead of a plugin root.
- src/dictionary.residual.json: 1,452 entries covering the measured gap.
- src/rewrite.ts: substituteInterpolated handles template literals. Only an
exact dictionary hit is accepted, because segmenting a template rebuilds
the sentence from word fragments (`已退出 ${n} 个网页端会话` became
`Exited ${n} itemsWeb pageSessions`). A translation that changes the
number of interpolations is rejected.
- src/strings.ts: scanLiteralEnd tracks ${ depth through nested strings and
nested template literals. Previously `` `a ${c ? `b` : ""}` `` was cut at
the inner backtick and rewritten as a fragment.
- scripts/merge-dict.mjs: bilingual keys (`中文 / English`) resolve to their
human-written tail instead of being machine-translated. Also merges the
residual dictionary.
- scripts/mt-fill.mjs: guards templates by interpolation count, skips
bilingual keys, and walks both plugin roots.
Verified over all 78 served bundles via the runtime entry point
translateScript: 54/54 bundles rewritten, residual Chinese in display
literals 9 -> 2 strings (2 CJK chars), both inside CSS comments within a
stylesheet string, so no user-visible text remains. All 5,437 Chinese-bearing
display literals now resolve.
57 lines
1.3 KiB
JSON
57 lines
1.3 KiB
JSON
{
|
|
"name": "chinese2english",
|
|
"version": "0.1.0",
|
|
"description": "Universal English translation patch for DeepSeek Harness third-party plugins",
|
|
"type": "module",
|
|
"main": "./lib/index.js",
|
|
"exports": {
|
|
".": "./lib/index.js",
|
|
"./client": "./lib/client.js",
|
|
"./package.json": "./package.json"
|
|
},
|
|
"files": [
|
|
"lib",
|
|
"cordis.patch.yml",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"keywords": [
|
|
"deepseek-harness",
|
|
"dsh",
|
|
"dsh-plugin",
|
|
"cordis",
|
|
"translation",
|
|
"english",
|
|
"i18n",
|
|
"localization"
|
|
],
|
|
"dsh": {
|
|
"bundle": {
|
|
"patch": "./cordis.patch.yml"
|
|
},
|
|
"client": {
|
|
"inject": [
|
|
"locale"
|
|
],
|
|
"platform": "web"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"mt": "node scripts/mt-fill.mjs",
|
|
"dict": "node scripts/merge-dict.mjs",
|
|
"build": "node scripts/build.mjs",
|
|
"build:dict": "node scripts/mt-fill.mjs && node scripts/merge-dict.mjs && node scripts/build.mjs"
|
|
},
|
|
"peerDependencies": {
|
|
"@deepseek-ai/cordis": ">=4.0.0"
|
|
},
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://git.oiupoyt.space/oiupoyt/chinese2english.git"
|
|
},
|
|
"bugs": {
|
|
"url": "https://git.oiupoyt.space/oiupoyt/chinese2english/issues"
|
|
},
|
|
"homepage": "https://git.oiupoyt.space/oiupoyt/chinese2english#readme"
|
|
}
|