|
| 1 | +--- |
| 2 | +name: localizations |
| 3 | +description: A skill that localizes contents into given locales. |
| 4 | +--- |
| 5 | + |
| 6 | +# Localize contents into given locales |
| 7 | + |
| 8 | +A skill that localizes contents into given locales. |
| 9 | + |
| 10 | +## How it works |
| 11 | + |
| 12 | +The skill takes input content and a list of target locales. It then translates the content into each specified locale, providing localized versions for each. |
| 13 | + |
| 14 | +### Content structure |
| 15 | + |
| 16 | +```text |
| 17 | +. |
| 18 | +├── README.md |
| 19 | +├── 00-quick-start/ |
| 20 | +│ └── *.md |
| 21 | +├── 01-setup-and-first-steps/ |
| 22 | +│ └── *.md |
| 23 | +├── 02-context-conversations/ |
| 24 | +│ └── *.md |
| 25 | +├── 03-development-workflows/ |
| 26 | +│ └── *.md |
| 27 | +├── 04-agents-custom-instructions/ |
| 28 | +│ └── *.md |
| 29 | +├── 05-skills/ |
| 30 | +│ └── *.md |
| 31 | +├── 06-mcp-servers/ |
| 32 | +│ └── *.md |
| 33 | +├── 07-putting-it-together/ |
| 34 | +│ └── *.md |
| 35 | +└── appendices/ |
| 36 | + └── *.md |
| 37 | +``` |
| 38 | + |
| 39 | +### Input contents |
| 40 | + |
| 41 | +Here are the list of contents for localization: |
| 42 | + |
| 43 | +- `README.md`: The main documentation file for the project. |
| 44 | +- All markdown files in the `00-*` directories and `appendices` directory **and its subdirectories** (`00-*/**/*.md`, `appendices/**/*.md`): The main content files for the project documentation. |
| 45 | + |
| 46 | +Both `README.md`, the `00-*` directories, and the `appendices` directory are in scope. The **`00-*`** directories and `appendices` directory are the default locations for content files, but `README.md` at the project root is always included as well. |
| 47 | + |
| 48 | +Files already under `translations/` are **outputs**, not inputs—never treat them as source content to be localized again. |
| 49 | + |
| 50 | +### Target locales |
| 51 | + |
| 52 | +Target locales are defined in the `rules` directory as markdown files in this skill (`rules/ko.md`, for example). **To determine which locales to process, list the files in `rules/`: each `<locale>.md` file corresponds to exactly one supported target locale.** Each locale has its own set of rules and guidelines for translation, ensuring that the localized content is appropriate for the target audience. |
| 53 | + |
| 54 | +Locale identifiers use lowercase with a hyphen (for example, `ko` or `zh-cn`). This is the canonical casing for both the rules filename and the output directory in this skill; keep them consistent. |
| 55 | + |
| 56 | +### Output contents |
| 57 | + |
| 58 | +All the localized contents are stored in the `translations` directory, with each locale having its own subdirectory. For example, the localized content for Korean would be stored in `translations/ko/`. |
| 59 | + |
| 60 | +It's assumed that the **`translations`** directory is the default location for all the localized content files. |
| 61 | + |
| 62 | +## Localization process |
| 63 | + |
| 64 | +There are three cases for localization. To detect which case applies, compare the **source tree** against the existing `translations/<locale>/` tree, and use the **git history of the source files** to detect changes: |
| 65 | + |
| 66 | +- **Original exists, no localized version for the locale:** Create a new localized document. |
| 67 | +- **Both original and localized versions exist:** Run `git diff` (or `git log`) on the **source** file to find what changed in the source since the localized version was last produced, then update only the affected sections of the localized document to match. Do not re-translate unchanged sections unnecessarily. |
| 68 | +- **Localized version exists, but the original has been deleted:** Delete the orphaned localized document (and prune now-empty locale subdirectories). |
| 69 | + |
| 70 | +The process runs in two passes. First, the content is analyzed to identify key phrases and context. Then the `translator` agent performs the initial localization, followed by a review-and-refinement pass by the `evaluator` agent to ensure quality and consistency. |
| 71 | + |
| 72 | +> The `translator` and `evaluator` "agents" are **roles/personas**, not external tools. If no dedicated sub-agents are available, perform them as sequential personas: first adopt the translator role to produce the draft, then adopt the evaluator role to critique and refine that draft against the locale rules. Repeat the refinement loop until the evaluator's criteria pass. |
| 73 | +
|
| 74 | +### Markdown and formatting preservation |
| 75 | + |
| 76 | +Regardless of locale, the following must be preserved exactly and **not** translated: |
| 77 | + |
| 78 | +- YAML frontmatter **keys** (translate values only where appropriate, e.g. a `title`). |
| 79 | +- Fenced and inline code, including variable, function, and command names. |
| 80 | +- URLs, link targets, image paths, and heading anchors/slugs. |
| 81 | +- HTML tags, Markdown structure, tables, and admonition markers. |
| 82 | + |
| 83 | +Translate human-language prose, including comments inside code blocks where they are explanatory (per the locale rules). Keep heading structure and ordering stable so links and anchors continue to resolve. |
| 84 | + |
| 85 | +### Translator agent |
| 86 | + |
| 87 | +Use the `translator` agent to perform the localization. It should follow the rules and guidelines defined for each target locale document in the `rules` directory. |
| 88 | + |
| 89 | +### Evaluator agent |
| 90 | + |
| 91 | +Use the `evaluator` agent to assess the quality of the localized content. The evaluator checks for accuracy, cultural relevance, and overall quality, following the rules and guidelines defined for the target locale in the `rules` directory. |
| 92 | + |
| 93 | +The evaluator scores the localized document against the locale's **Evaluator Scoring Rubric** (defined in the locale's `rules/<locale>.md`). The rubric uses two tiers: **Tier A** hard-fail criteria that must score 5, and **Tier B** graded criteria (1–5) that must score 4 or 5. A document passes only when **every applicable Tier A criterion scores 5 and every applicable Tier B criterion scores ≥ 4**. If anything falls short, return the document to the translator with specific notes and re-run the translate → evaluate loop until it passes, escalating to a human after the rubric's iteration cap. |
| 94 | + |
| 95 | +## DOs and DON'Ts |
| 96 | + |
| 97 | +- **Do** perform localization only for the target locales defined in the `rules` directory (one `<locale>.md` per supported locale). Do not localize into unsupported locales. |
| 98 | +- **Do** preserve Markdown structure, code, links, image paths, heading anchors, and frontmatter keys exactly (see *Markdown and formatting preservation*). |
| 99 | +- **Do** mirror the source directory layout under `translations/<locale>/`. |
| 100 | +- **Don't** treat files under `translations/` as source input. |
| 101 | +- **Don't** reorder or restructure content; keep headings and their order stable. |
| 102 | +- **Don't** translate code, commands, or identifiers; translate explanatory prose and code comments only. |
| 103 | + |
0 commit comments