LocQA checks a translated string table before it ships and produces a report a localization lead can act on.
It runs in two passes:
- Rule checks (instant, free, no API key): broken placeholders and tags, changed numbers, UI length overflow, glossary violations, Simplified Chinese characters left in Japanese text, missing line breaks, empty strings.
- AI review (optional, uses Claude): mistranslations, omissions, character-voice and tone problems, unnatural Japanese. It returns a suggested fix for each issue.
The non-zero exit code on errors lets you put it in CI and block a broken string table before it reaches a build.
Most localization bugs that reach players are mechanical: {1} deleted from a reward popup, [icon=btn_a] changed to btn_b, a stat value of 150 that became 1500, a button label too long for its frame. Human reviewers miss these because they read for meaning. LocQA catches the mechanical ones automatically, so reviewers can spend their time on meaning and voice. The AI review helps there too.
python -m locqa check samples/strings.csv -g samples/glossary.csvOpen reports/report.html. The sample contains 21 strings with deliberately injected bugs. The rule pass finds 11 issues in 9 strings.
With the AI review (needs pip install anthropic and an Anthropic API key in ANTHROPIC_API_KEY):
pip install -r requirements.txt
python -m locqa check samples/strings.csv -g samples/glossary.csv -s samples/style_guide.txt --llm --lang ja--lang sets the language of the AI comments (en, ja, zh).
Set CLAUDE_PROVIDER:
| value | uses | when |
|---|---|---|
anthropic (default) |
Claude API, ANTHROPIC_API_KEY |
production, client work |
bedrock |
Claude on Amazon Bedrock, your AWS credentials and AWS_REGION |
teams already on AWS |
claude-code |
the local Claude Code CLI, signed in with your own Claude subscription | local development and demos only, at no extra cost. Not for running a service for others |
set CLAUDE_PROVIDER=claude-code
python -m locqa check samples/strings.csv -g samples/glossary.csv -s samples/style_guide.txt --llmStrings — CSV or JSON:
| column | required | example |
|---|---|---|
id |
yes | quest.reward |
source |
yes | 完成任务获得{0}金币和{1}经验。 |
target |
yes | 任務を完了すると{0}ゴールドを獲得。 |
context |
no | Princess Lyra - arrogant (speaker and situation; used by the AI review) |
max_len |
no | 6 (UI character limit) |
Glossary — CSV or JSON with source, target, optional note.
Style guide — any plain text: character voices, UI conventions. Used only by the AI review.
| check | severity | catches |
|---|---|---|
placeholder |
error | {0}, {name}, {{var}}, %s, %1$d missing or added (order may change) |
tag |
error | <color=…>, <b>, [icon=…] missing or altered |
number |
error | numbers changed (full-width digits are normalized; tag colors ignored) |
length |
error | target longer than max_len (markup excluded) |
glossary |
error | glossary term not translated as specified |
script |
error | Simplified-only characters (这, 个, 们 …) in Japanese text |
untranslated |
error / warning | empty target / target identical to source |
linebreak |
warning | \n or real line-break count differs |
whitespace |
warning | stray leading/trailing or double spaces |
llm:* |
error / warning | mistranslation, omission, tone, naturalness, terminology |
reports/report.html (filterable, works offline, light/dark), report.md (paste into a ticket), and report.json (for pipelines).
python -m unittest -vlocqa/
rules.py deterministic checks
llm.py Claude semantic review (structured JSON output, batched)
report.py HTML / Markdown / JSON rendering
loader.py CSV / JSON input
cli.py command line
samples/ demo string table, glossary, style guide
tests/ unit tests for the rules
MIT
LocQA 是一个面向「中文 → 日文」游戏本地化的自动 QA 工具。
- 规则检查不需要 API,可以离线运行。它检查占位符、标签、数值、UI 字数、术语表,以及日文里残留的简体字。
- 加上
--llm后,会再用 Claude 检查误译、漏译、角色口吻和不自然的日语,并给出修改建议。
