feat(glossary): add Japanese (ja) translation glossary - #69
Conversation
Adds glossary/ja.json with 357 terms mirroring the English term set and contexts of the existing zh-cn / fa glossaries. Bundled copy added under dist-action/glossary/ja.json so the action loads it automatically when target-language is `ja`. - Economic, mathematical, statistical and finance terminology translated to standard Japanese. - Abbreviations expand to the full Japanese term with the abbreviation in parentheses (e.g. GDP -> "国内総生産(GDP)"). - Personal names transliterated to katakana; CJK-origin researcher names flagged for author review (preferred kanji). Marked as a draft pending native-speaker review in glossary/README.md and docs/user/glossary.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new built-in Japanese translation glossary to the action-translation repository, alongside documentation updates intended to expose target-language: ja support and ensure the bundled dist-action/ artifact contains the new glossary.
Changes:
- Added a new Japanese glossary file (
glossary/ja.json) and bundled copy (dist-action/glossary/ja.json) with 357 terms. - Updated glossary documentation to list Japanese as a draft glossary and reflect current status/metadata.
- Updated user docs to include Japanese in the built-in glossary table and add a draft status note.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| glossary/README.md | Documents Japanese glossary status/contents and updates “Last updated” metadata. |
| glossary/ja.json | Adds the new built-in Japanese glossary (357 terms). |
| docs/user/glossary.md | Adds Japanese to the built-in glossaries table and notes draft status. |
| dist-action/glossary/ja.json | Bundled (built) copy of the Japanese glossary for runtime use in the GitHub Action distribution. |
…y is usable SYNC mode's getInputs() calls validateLanguageCode() (src/inputs.ts), which throws for any language not in LANGUAGE_CONFIGS. With only en/zh-cn/fa configured, `target-language: ja` errored out before the glossary loader was ever reached, so the new glossary/ja.json could not be loaded. Addresses Copilot review on #69 (same root cause fixed for fr in #68). - Add `ja` entry to LANGUAGE_CONFIGS (src/language-config.ts) with Japanese typography rules (full-width 、。「」, CJK–MyST spacing, mirroring zh-cn). - inputs.test.ts: move `ja` from futureLanguages to supportedLanguages. - language-config.test.ts: repoint the "unconfigured language" examples to `ko` and add positive assertions that `ja` is now configured. - docs/user/language-config.md: list `ja` as configured + add Japanese rules. - glossary/README.md: structure tree now shows only files that exist (zh-cn/fa/ja); planned languages stay in the naming-convention section. - Rebuild dist-action bundle so the distributed action recognizes `ja`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs: add 2026-07-15 deep technical review (Fable 5) Follow-up to the 2026-07-05 review. Verifies plan status, audits the v0.16.0 delta, and reports new findings — headline items: shipped French typography corruption of footnote/link-reference definitions, stale v0 floating tag, lint glob covering only 32/78 files, missing LICENSE, and a family of silent-data-loss paths in the sync merge logic. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: add MIT LICENSE file README, package.json, and docs/myst.yml have claimed MIT since the project started, but no LICENSE file existed — GitHub reported the repository as unlicensed and consumers had no actual license grant. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(fr): stop typography pass corrupting footnote/link-reference definitions The French NBSP pass rewrote line-leading definition labels — `[^mung]: text` became `[^mung]<NBSP>: text` — which stops the line parsing as a definition under CommonMark/MyST: it renders as literal paragraph text and every reference to it breaks. This shipped in the fr seed (pandas.md footnotes). Fix: mask `[label]:` / `[^footnote]:` at line start before applying the spacing rule (the definition text after the colon is still typeset), and repair the exact corruption the earlier transform produced (NBSP between label and colon can never be legitimate), so running scripts/typography/apply.mjs on an affected repo heals it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: lint glob only matched 32 of 78 source files; clean up the fallout "eslint src/**/*.ts" runs under /bin/sh, which has no globstar — the pattern expanded to src/*/*.ts, so every core module (index, translator, parser, reviewer, ...), the CLI commands, and all CLI tests were never linted, locally or in CI. Quote the glob, lint .tsx too, and gate at --max-warnings 0 so the count can only ratchet down. Fallout from the 46 newly-visible files: remove unused imports/variables (15 errors, 22 test-file warnings), convert an inner function declaration, drop 4 unnecessary escapes (string value unchanged), and annotate the six deliberate yaml.load `any`s pending the Phase 6 typing work. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * style: apply prettier across src (mechanical) One-time `npm run format` over all 78 source files, now that the format glob actually matches them. No behavioral change: tsc, eslint (--max-warnings 0), and all 1,066 tests pass identically before/after. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: PLAN Phase 1 correctness fixes — pagination, CRLF, truncation guards - Paginate the five unpaginated GitHub API calls: sync-path pulls.listFiles (PRs with >30 files were silently truncated), review mode's two listFiles, rebase's pulls.list (siblings beyond 100), and postReviewComment's listComments (beyond 30 comments the existing review was missed and duplicates accumulated). - parseSourcePRNumber: accept \r\n — GitHub normalizes edited PR bodies to CRLF, which permanently broke review mode for that PR. - Check stop_reason after every Claude call (translator, reviewer, and the three CLI analysis sites): a max_tokens stop now fails the operation loudly instead of committing truncated output — in backward bulk a truncated analysis previously parsed as NO_BACKPORT and reported the file as clean. - Guard response.content[0] everywhere: an empty content array (e.g. a refusal stop) now produces a clean error instead of a bare TypeError. - formatGlossary: skip (and log) terms with no translation for the target language instead of rendering `"term" → "undefined"` into the prompt. - Add CI format check; regression tests for the truncation and empty-content guards. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore(deps): clear in-range advisories; mark package private; add engines npm audit fix resolves the ws (uninitialized memory / DoS), lodash (_.template injection / prototype pollution), and js-yaml (merge-key prototype pollution — a direct prod dep bundled into dist-action) advisories. The remaining undici pair rides on @actions/core 1.x / @actions/github 6.x and is deferred to the major-bump + node24 change tracked in PLAN 1.4/5.8. private: true — the package was publish-unsafe: no files allowlist, the bin name `translate` collides with an unrelated npm package, and a stray `npm publish` would have shipped .dev/ notes and local settings files. engines codifies the node >= 20 floor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs: fix the high-severity accuracy gaps - examples/README.md: sync examples used secrets.GITHUB_TOKEN, which cannot push cross-repo — switch to the PAT pattern with an explanatory note; replace stale @v0.11 pins with @v0 (now current); replace the ja example (sync throws — ja has no LANGUAGE_CONFIGS entry) with fr; drop pre-v0.6.3 pr-labels; align the glossary example with the real schema. - docs/index.md: landing page claimed v0.8.0 / 873 tests / two modes / two languages — now v0.16.0, 40 suites, three modes, fr included. - docs/myst.yml: add the six tutorials and developer/legacy-tools to the toc — index.md links them but they 404ed on the live site. - tutorials/add-language.md: the LANGUAGE_CONFIGS entry was marked "(optional)" — it is required; sync throws without it (the #68/#69 trap). - README.md: resolve the 1056-vs-1005 test-count contradiction (counts are now non-exact outside the release checklist) and list rebase mode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: CHANGELOG entries, .dev refresh, tick 16 completed PLAN boxes - CHANGELOG [Unreleased]: full entries for the review-round fixes. - .gitignore: drop the stale "ncc" comment and the never-generated licenses.txt ignore (build is esbuild) — PLAN 1.4. - .dev/STATE.md: refresh to post-v0.16.0 reality (fr is in production, v0 tag moved, this PR in flight, new issues #81/#82); add session log. - .dev/PLAN.md: tick the items this branch (and #80) completed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * build: rebuild dist-action with the review-round fixes Bundles the typography definition-label fix, pagination, truncation and empty-content guards, CRLF fix, glossary skip, and the patched js-yaml. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: restore MAX_TOKENS.analysis interpolation in CLI truncation messages The shell heredoc that inserted the guards swallowed the template interpolation, leaving a literal "max_tokens=" with no value in the error message. Addresses Copilot review feedback on #83 — Copilot flagged 2 of the sites; all 4 (incl. backward-evaluator's two) had it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
|
Thanks @mmcky ! I think that
|
|
Hi @jstac, Thanks for your suggestions.
I don't have a good sense of how this term is translated, but I couldn't find anything relevant by searching for レイクモデル on Google.
I agree with this point. References to non-Japanese economists are often written in English, which makes it easier for readers to look up the relevant literature. This convention is generally followed even for economists whose names have kanji equivalents, such as Chinese economists.
I think this approach is fine as long as the paper is written in English. However, in presentations, it's also very common to write Japanese economists' names in kanji on the slides. |
|
Thanks @jstac — I'm a native Japanese speaker, so here are my thoughts on the three points. 1. lake model — I agree that レイクモデル looks odd, but I would write it as 2. Non-Japanese economists — I fully agree. Please keep them in English. 3. Japanese researchers — if we are citing a paper written in English, English is better. But when the name appears in a normal sentence, kanji reads much better. If we know the person's research area and university, we can almost always find the correct kanji, so we are not guessing here. I am happy to do this myself. Before we decide, though, I would like to check how these names are actually used in the lecture text. |
|
@jstac and @xuanguang-li -- I just had a look at So thinking about it again, I'm fine with keeping all of the names in English. One rule for everything is simpler. What do you think? |
|
Many thanks @xuanguang-li @Chihiro2000GitHub , nice comments.
Yes, one rule is much simpler, I agree. We have to think about efficiency and, at least in this case, it doesn't cost us much quality. |
|
Hi @Chihiro2000GitHub and @jstac, Thanks for your feedback. I also agree with the principle of keeping the rules simple. I read through the
I also found the following terms a bit unusual, although I'm not sure whether they should be changed:
I would appreciate any suggestions on these terms. |
|
Hi everyone, (cc @jstac ) John has just asked me for my thoughts on translating technical terms. (I'm Japanese and a former RA and student of his.) I think it is better to keep technical terms in English, partly because this makes it easier for students to transition to materials taught entirely in English later on. Personally, I also find technical terms more difficult to learn in Japanese than in English, since the Japanese translations often use quite complicated kanji. I also looked at the teaching slides by Professor Abe at Hitotsubashi University, whose lecture notes I used when I first learned dynamic programming. He uses the English terms “value function” and “Bellman equation.” Here is his lecture note link. |
|
Thanks @sayaikegawa , super helpful! |
|
@xuanguang-li — I completely agree with your suggestions. On Hi @sayaikegawa, thanks for joining! Professor Abe's lecture note is very well known. I think it is probably the first thing a Japanese student finds when they search for dynamic programming in Japanese, so using it as a reference is a really good idea. The examples you gave are dynamic programming terms — "value function" and "Bellman equation" — and I agree that those should stay in English. But I would like to note that a general rule of "keep technical terms in English" would make some terms feel unnatural. For example, In fact, the same lecture note does exactly this:
Here it writes Of course, there may be a question of whether words like |
|
Thanks @Chihiro2000GitHub for your additional comments. Summarizing: We can use Japanese when there's a well-known and stardard Japanese counterpart, as in 予算制約 for "budget constraint", and English otherwise. Even an AI might be able to make these judgements... |
|
Hi @jstac, @mmcky, @xuanguang-li and @sayaikegawa, Sorry this took a while — I wanted to go through the whole glossary carefully rather than just skim it. Here is what I found. I have split it into three parts: changes I would suggest, terms I think should stay in English, and a few questions I am not confident about. 1. Suggested changes
One further note on the table: Recessions and Expansions. These two are a pair, but the glossary has 景気後退 for one and 景気拡大局面 for the other. Both are fine, but we should add 局面 to both or to neither. 2. Terms I would keep in English
3. Questions for @xuanguang-li and @sayaikegawaI am not confident about these, and I would like your views. Market clearing → 市場清算. I have heard 市場清算(条件)before, but honestly it does not sound natural to me as Japanese. I would expect something like 市場均衡(条件). What do you think? State-contingent claims → 状態依存請求権. This is the Arrow-Debreu context, I assume. 請求権 does not feel like the word normally used here. In derivatives, "contingent claim" is usually 条件付き請求権, so 状態条件付き請求権 might be closer, but I am not sure. Counter CDF → 相補累積分布関数. I have not studied this area much, so I cannot judge it. Does this look right to you? Reform and liberalization → 改革と自由化. I first thought this meant China's 改革開放, but that is usually "Reform and Opening Up" in English, so I may be wrong. It is worth noting that the zh-cn glossary renders this same entry as 改革开放, which suggests it is the China context. Could someone check which lecture this comes from? = versus ・ in compound names. The file mixes the two: コブ=ダグラス and ギアリー=ケイミス use =, while ペロン・フロベニウス, コルモゴロフ・スミルノフ and ソロー・スワン use ・. Claude suggested that the convention is = for one person's compound name and ・ for joining two different people, which would make コブ・ダグラス the consistent choice. But when I searched, I found コブ・ダグラス, コブ=ダグラス and コブダグラス all in use, so I am not sure Japanese writers distinguish these very carefully in practice. Do you have a preference? Either way I think we should pick one and apply it consistently. |
|
One clarification on my previous comment, in case it was confusing. Section 2 ("terms I would keep in English") was not meant as a complete list of the terms that should stay in English. Those were just the ones I found borderline, or that had already come up in this thread. There are many others — So I am not proposing anything different from @jstac's summary: Japanese where there is a well-known and standard Japanese counterpart, English otherwise. I was applying that rule, not making exceptions to it — please take my list as suggestions rather than conclusions. |
|
Thanks @Chihiro2000GitHub . I propose the following rule: if in doubt, keep it in English. Most (maybe all?) Japanese undergraduate students will be comfortable reading Japanese sentences that have some English words. |
Adds a Japanese built-in glossary (
glossary/ja.json, 357 terms), mirroring the English term set andcontextfields of the existingzh-cn/faglossaries so coverage is identical across languages.What's included
glossary/ja.json— 357 terms (economics, macro/micro, finance, linear algebra, probability/statistics, time series, network science, economist & mathematician names).dist-action/glossary/ja.json— the bundled copy produced bynpm run build, so the action loads it automatically whentarget-language: ja(the CI dist-action freshness guard passes).Conventions followed
GDP → "国内総生産(GDP)",OLS → "最小二乗法(OLS)".Robert Solow → "ロバート・ソロー".This is an initial draft produced for native-speaker review (per the glossary quality guidelines), marked 🟡 Draft in
glossary/README.md. A Japanese-speaking economist should confirm terminology before promotion to ✅ Complete. Two areas to prioritise:🤖 Generated with Claude Code