agentleFS
aleen42aleen42/PersonalContext/skills/fix-err-i18n-translations/SKILL.md

fix-err-i18n-translations

Skill3 starsChanged 8 months agoMITView on GitHub

Retranslate i18n resource text marked with <err> from the matching *_zh_CN.* baseline while preserving HTML tags, attributes, placeholders, file encoding, and unrelated edits. Use when a user asks to handle machine-translation error markers, fix <err> labels in language resource files, or retranslate only the erroneous parts of properties/js i18n files based on Chinese source text.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill to repair machine-translated i18n resource entries marked with <err>.

    line 10
  2. Distinctive:

    Prefer the current working tree if markers still exist.

    line 15
  3. Very specific:

    If a previous attempt may have removed markers, recover the marker scope from git with git log -S'<err>' and git show <commit>:<file>.

    line 16
  4. Very specific:

    Do not rely on line numbers alone when files may have shifted.

    line 17
  5. Distinctive:

    If no baseline exists, stop and report the missing file.

    line 22
  6. Very specific:

    If a line has <err>, retranslate the corresponding Chinese visible text at the same structural position, then remove <err>.

    line 28
  7. Distinctive:

    Keep unrelated translated lines untouched.

    line 31
  8. Distinctive:

    Keep the original file encoding.

    line 32
  9. Very specific:

    Use scripts/audit_err_i18n.py to list marker scope and validate structure.

    line 44
  10. Distinctive:

    Keep punctuation natural for the target language, but do not alter surrounding HTML structure.

    line 68
  11. Distinctive:

    If uncertain about a target language phrase, prefer clear literal product UI wording over fluent paraphrase that changes meaning.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fix Err I18n Translations

Purpose

Use this skill to repair machine-translated i18n resource entries marked with <err>. A marker means the text was detected as wrong and must be translated again from the matching Simplified Chinese baseline, not simply removed.

Required Workflow

  1. Find the latest relevant source of <err> markers.
    • Prefer the current working tree if markers still exist.
    • If a previous attempt may have removed markers, recover the marker scope from git with git log -S'<err>' and git show <commit>:<file>.
    • Do not rely on line numbers alone when files may have shifted; pair line data with key names for .properties files.
  2. Locate the Simplified Chinese baseline file.
    • For files named like help_es.properties, use the sibling help_zh_CN.properties.
    • For other suffix patterns, replace the locale suffix with _zh_CN while preserving the basename and extension.
    • If no baseline exists, stop and report the missing file.
  3. Extract only the marked text fragments.
    • For .properties, parse logical entries, including continuation lines ending with \.
    • For HTML-valued entries, preserve tags, attributes, paths, entities, indentation, and trailing continuation backslashes.
    • Translate only visible text inside tags or plain text values. Do not translate tag names, attributes, style, class, src, placeholders, variables, or image filenames.
    • If a line has <err>, retranslate the corresponding Chinese visible text at the same structural position, then remove <err>.
  4. Replace narrowly.
    • Keep unrelated translated lines untouched.
    • Keep the original file encoding.
    • For CJK target languages, still preserve HTML structure exactly; only the visible text changes.
  5. Validate before reporting completion.
    • Count remaining <err> markers; it must be 0 in the handled files.
    • Decode every modified file with the original encoding.
    • Compare HTML tag sequences before and after for every originally marked line; mismatches must be 0.
    • Run git diff --check -- <modified files>.
    • Inspect diffs for accidental baseline changes or unrelated edits.

Helper Script

Use scripts/audit_err_i18n.py to list marker scope and validate structure. The script does not translate; it makes the fragile discovery and verification steps deterministic.

Common usage:

python3 /path/to/fix-err-i18n-translations/scripts/audit_err_i18n.py \
    --lang-dir <lang-resource-dir> \
    --commit <commit-with-err-markers> \
    --mode report

After edits:

python3 /path/to/fix-err-i18n-translations/scripts/audit_err_i18n.py \
    --lang-dir <lang-resource-dir> \
    --commit <commit-with-err-markers> \
    --mode validate

Translation Rules

  • Preserve product terms when the target language commonly uses them: AI, Agent, ICS, HTML, MCP.
  • Preserve UI label quoting consistently with nearby translations in the same file.
  • Keep punctuation natural for the target language, but do not alter surrounding HTML structure.
  • For very long paragraphs, translate the whole visible paragraph from Chinese to keep terminology consistent.
  • If uncertain about a target language phrase, prefer clear literal product UI wording over fluent paraphrase that changes meaning.

Red Flags

  • Deleting <err> without changing the text.
  • Replacing an entire HTML entry with translated text that drops tags or attributes.
  • Translating image paths like ai_02_zh.jpg or CSS attributes.
  • Changing *_zh_CN.* baseline files.
  • Letting shell tools corrupt non-UTF-8 resource files.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.