Skip to content

feat(glossary): add Japanese (ja) translation glossary - #69

Open
mmcky wants to merge 2 commits into
mainfrom
feat/glossary-ja
Open

feat(glossary): add Japanese (ja) translation glossary#69
mmcky wants to merge 2 commits into
mainfrom
feat/glossary-ja

Conversation

@mmcky

@mmcky mmcky commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Adds a Japanese built-in glossary (glossary/ja.json, 357 terms), mirroring the English term set and context fields of the existing zh-cn / fa glossaries 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 by npm run build, so the action loads it automatically when target-language: ja (the CI dist-action freshness guard passes).
  • Docs updated: Japanese row in docs/user/glossary.md and the "Current Glossaries" entry in glossary/README.md (🚧 Planned → 🟡 Draft).

Conventions followed

  • Same English keys + contexts as the other glossaries (verified programmatically — identical order, no missing/extra terms).
  • Abbreviations expand to the full Japanese term with the abbreviation in parentheses, e.g. GDP → "国内総生産(GDP)", OLS → "最小二乗法(OLS)".
  • Personal names transliterated to katakana, e.g. Robert Solow → "ロバート・ソロー".

⚠️ Review note

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:

  • CJK-origin researcher names are currently katakana placeholders (e.g. Hiroki Kondo → ヒロキ・コンドウ, Yoshi Fujiwara → ヨシ・フジワラ, and the Chinese-origin names). The authors should supply preferred kanji.
  • A few term choices worth a second look: 連結状態 (communicating states), 残余費用関数 (cost-to-go function), レイクモデル (lake model).

Note: this PR and #68 (French) both add a row to the same glossary table; whichever merges second will need a trivial rebase.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 9, 2026 08:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/user/glossary.md
Comment thread glossary/README.md
…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>
mmcky added a commit that referenced this pull request Jul 15, 2026
* 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>
@jstac

jstac commented Jul 29, 2026

Copy link
Copy Markdown

Thanks @mmcky !

I think that

  • "lake model" should stay in English --- the katakana looks strange to me, and Japanese readers are probably happy if 90% of the sentence is in Japanese.
  • non-Japanese economists names should stay in English --- easy for a Japanese reader to parse if the rest of the sentence is in Japanese; not-so-famous people won't have standard katakana and it's not obvious from the English spelling what the katakana should be. (Claude translates my name as スタチャースキー based on the guess that it's pronounced "Sta-chur-ski", but in fact a more accurate translation, which I use for banking etc., is スタハースキー).
  • I would even say that Japanese economists could be rendered in English at a first pass, not much harm done, better than trying to guess the Kanji.

@xuanguang-li

Copy link
Copy Markdown

Hi @jstac,

Thanks for your suggestions.

"lake model" should stay in English

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.

non-Japanese economists' names should stay in English

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 would even say that Japanese economists could be rendered in English at a first pass

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.

@Chihiro2000GitHub

Chihiro2000GitHub commented Jul 29, 2026

Copy link
Copy Markdown

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 lake モデル: keep the model name in English, and translate only model. Writing the name in English and the rest in Japanese is common in Japanese academic writing. If a Japanese term is already widely used, we should use it — for example 世代重複モデル (OLG model) or ソロー・スワン成長モデル (Solow-Swan growth model). But there is no such term for lake.

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.

@Chihiro2000GitHub

Copy link
Copy Markdown

@jstac and @xuanguang-li -- I just had a look at glossary/ja.json, and there are almost no Japanese economists in it — only two names (Hiroki Kondo and Yoshi Fujiwara).

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?

@jstac

jstac commented Jul 30, 2026

Copy link
Copy Markdown

Many thanks @xuanguang-li @Chihiro2000GitHub , nice comments.

So thinking about it again, I'm fine with keeping all of the names in English. One rule for everything is simpler.

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.

@xuanguang-li

Copy link
Copy Markdown

Hi @Chihiro2000GitHub and @jstac,

Thanks for your feedback. I also agree with the principle of keeping the rules simple.

I read through the json file and looked up the terms flagged by @mmcky.

  • communicating states: I think we can use コミュニケートする状態, which I found in a lecture slide.

状態 𝑥から出発し、状態 𝑦 に到達する確率が正、すなわち𝜌_𝑥𝑦 = 𝑃_𝑥(𝑇𝑦 < ∞) > 0であるとき𝑥 は𝑦にコミュニケートするといい、 𝑥 → 𝑦と表す.

  • cost-to-go function: I think cost-to-go can remain in English, as it is used in the title of this paper.

近似的最適cost-to-go関数を用いて3D誘導性能をマッピングする

I also found the following terms a bit unusual, although I'm not sure whether they should be changed:

  • forcing variable (強制変数)
  • forward-looking difference equation (先見的差分方程式)

I would appreciate any suggestions on these terms.

@sayaikegawa

Copy link
Copy Markdown

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.

@jstac

jstac commented Jul 31, 2026

Copy link
Copy Markdown

Thanks @sayaikegawa , super helpful!

@Chihiro2000GitHub

Copy link
Copy Markdown

@xuanguang-li — I completely agree with your suggestions.

On forcing variable and forward-looking difference equation, I would like to look through some Japanese textbooks and papers myself and think about them a bit more. I'll come back with suggestions.

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, 行列 is much more familiar than "matrix", and 予算制約 is the normal way to write "budget constraint". Budget constraint → 予算制約 is in the glossary, and 行列 appears in many entries such as 隣接行列 (adjacency matrix) and 確率行列 (stochastic matrix).

In fact, the same lecture note does exactly this:

予算制約を使って、今期の資本ストックと来期の資本ストックの可能な組み合わせ、ここでは1600×1600の行列の各要素に消費水準を割り当てる。

Here it writes 予算制約 rather than "budget constraint", and 行列 rather than "matrix".

Of course, there may be a question of whether words like 予算制約 and 行列 count as "technical terms" in the first place...

@jstac

jstac commented Aug 1, 2026

Copy link
Copy Markdown

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...

@Chihiro2000GitHub

Copy link
Copy Markdown

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

Term Current Suggestion Reason
Annuity 年金(アニュイティ) 年金 年金 alone is enough. The katakana gloss is not needed.
Eigenvector decomposition 固有ベクトル分解 固有値分解 固有値分解 is the phrase actually used in Japanese, even though "vector" drops out of it.
Exercise 演習 演習問題 演習問題 sounds more natural in teaching material.
Fiscal theory of price levels 物価水準の財政理論 物価水準の財政理論(FTPL) FTPL is fairly widely used in Japan.
Flow utility function フロー効用関数 各期の効用関数 More familiar to me, though this may be a matter of taste.
Gross Domestic Product 国内総生産 国内総生産(GDP) GDP is more familiar to Japanese readers than 国内総生産 alone.
Kernel カーネル カーネル is the normal word here.
Marginal utility of wealth 富の限界効用 資産の限界効用 資産 is more familiar, if "wealth" means assets in this context.
Matrix inversion 逆行列 逆行列の計算 逆行列 means "inverse matrix" — it is a noun, not the name of an operation.
Multiple consumer economy 複数消費者経済 複数の消費者からなる経済 Reads more naturally.
Projected corporate tax revenue 予測法人税収 法人税収の見通し The current one reads like a literal translation.
Real bills theory 真正手形理論 真正手形説 (or 真正手形学説) I did not know this term, so I looked it up. 説 / 学説 seems to be more common.
Trigonometric form 三角形式 三角関数表記 I could not find 三角形式 in any search. See for example this page.
Unpleasant monetarist arithmetic 不愉快なマネタリストの算術 マネタリストの不愉快な算術 This word order is the one that has settled in Japanese.

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

Term Current Reason
Authority centrality オーソリティ中心性 オーソリティ is not a familiar word in Japanese. I would treat this as a technical term and leave it as authority centrality.
Cost-to-go function 残余費用関数 Agreeing with @xuanguang-li's earlier suggestion.
Forcing variable 強制変数 @xuanguang-li flagged this. I looked into it as well and could not find a good Japanese equivalent.
Forward-looking difference equation 先見的差分方程式 Same as above.
Survey of Consumer Finances 消費者金融調査(SCF) 消費者金融 means the consumer lending business in Japanese, so 消費者金融調査 is misleading. This is also the proper name of a survey, so I would leave it in English — the same as FRED and NBER, which the glossary already keeps as they are.

3. Questions for @xuanguang-li and @sayaikegawa

I 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.

@Chihiro2000GitHub

Copy link
Copy Markdown

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 — Bellman equation, as @sayaikegawa mentioned — where English is clearly the right choice, and I did not list them.

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.

@jstac

jstac commented Aug 12, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants