Translation glossary guard for Japanese-English
Check a Japanese-English source and translation pair against a glossary CSV for missing or inconsistent terms, do-not-translate violations and untranslated leftovers, with line numbers.
What it does
Keeps terminology consistent when translating between Japanese and English. A glossary CSV is the single source of truth, and the script compares the source and target files read-only.
- Glossary terms in the source whose approved translation is missing from the target
- Discouraged translations (for example "log in" when the glossary says "sign in")
- Do-not-translate terms (brand names, product names, commands) that were translated or dropped
- Untranslated leftovers: Japanese characters in an English target, runs of 4+ English words in a Japanese target, or lines identical to the source
- Candidate terms that recur in the source but are not in the glossary (
--suggest)
When both files have the same number of non-empty lines, they are compared line by line, so each finding points at the exact lines. Code, URLs and HTML tags are skipped. A glossary template (ja, en, dnt, avoid, notes) is included.
How to use
python scripts/glossary_guard.py --glossary glossary.csv --source ja/guide.md --target en/guide.md --src-lang ja
The agent confirms the glossary, translates with it, runs the check, fixes findings and re-runs, then reports the remaining items with reasons and proposed glossary additions.
Requirements
- Python 3 (standard library only)
- UTF-8 CSV and text or Markdown files
Caveats
- It checks terminology and leftovers only, not fluency or accuracy.
- Japanese terms match as substrings, so very short terms cause more false positives.
- Add irregular English forms (such as "signed in") to the glossary explicitly.
- No file edits and no network access.
How to install
- Unzip the downloaded file (it contains a
translation-glossary-guard/folder withSKILL.md). - Copy the whole folder into your agent's skills folder.
- Claude:
~/.claude/skills/(per project:.claude/skills/) - Hermes Agent:
~/.hermes/skills/ - Codex:
~/.agents/skills// Cursor:~/.cursor/skills/ - Claude app (claude.ai): upload the ZIP in Customize → Skills
- Claude:
- Restart the agent and check that the skill appears in its skill list.
Seller
44 published skills