feat: add --lang zh for Chinese CLI output - #96
Conversation
Introduce an i18n catalog with en/zh strings and wire --lang / AFDOCS_LANG through the CLI and runner so JSON messages, scoring resolutions, and diagnostics can be emitted in Chinese with English fallback for missing keys. Co-authored-by: Cursor <cursoragent@cursor.com>
Consumers installing from GitHub need compiled dist/; keep husky only when .git exists. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop prepare-husky helper; developers can run husky locally. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thank you for the PR! Your catalog is comprehensive and I appreciate the effort in threading through where relevant and updated tests. But after thinking through the maintenance considerations this would introduce, I think I need to close this rather than merge it. Routing every user-facing string through a two-language catalog is a permanent commitment: every future message change needs paired en/zh edits, and I can't verify translation accuracy or maintain the zh catalog myself. I took a look at how other projects handle this, and projects that localize CLIs successfully (git, the GNU tools) do it with per-locale maintainer teams and drift-detection tooling; projects that accepted translations without that (kubectl) have seen them go stale. I don't currently have signal on which locales users need or a sustainable ownership model. If there's real demand, I'd rather design for it deliberately (extraction tooling, community locale ownership) than start from a single catalog. Feel free to open an issue, instead, if you'd like to see this tracked as a potential future addition. I'm happy to track interest there and gather info about what other locales people might want to support if there's enough demand for this to justify future feature development around it. |
Summary
--lang zh/AFDOCS_LANGwith an i18n catalog so check messages, scoring resolutions, and diagnostics can be emitted in Chinese (missing keys fall back to English)t(), and update CLI docs plus unit testsprepareso Git installs builddist/, ensuring consumers get compiled outputTest plan
npm test(includingtest/unit/i18n/*) passesafdocs check <url> --lang zhprints Chinese messages / resolutions / diagnostics--lang, oren) matches the previous English outputAFDOCS_LANG=zhand CLI--langbehave consistentlydist/present)Made with Cursor