Localize a repository README.md without breaking the repo mechanics around it.
The default job is translate + wire-up:
- read the source-of-truth README
- create localized sibling files such as
README.zh.md - preserve GitHub-flavored Markdown structure and repo-specific tokens
- add or update a shared language selector near the top of every variant
This skill is for multilingual README workflows, not general website/app i18n.
Inputs
Expect these inputs when available:
- source README path, default
README.md - source language, default inferred or English
- one or more target languages
- optional glossary or do-not-translate list
- optional filename override if the repo already uses a different multilingual naming pattern
If target languages are not named, inspect existing translated files, selectors, filenames, issues, or prior repo conventions. If that still leaves the target languages unclear, ask once. Do not invent target languages.
Defaults And Decision Rules
- Treat the root
README.mdas the source-of-truth unless the user explicitly says otherwise. - If the source language is ambiguous, ask once. Otherwise assume English.
- Keep section order aligned with the source README. Only make a small heading wording adjustment when needed to produce a valid localized anchor.
- Output localized siblings with
README.<bcp47-tag>.mdnaming unless the repo already has a different established pattern that should be preserved. - Update an existing language selector in place. Do not duplicate it.
- Translate only human-language content.
- Preserve project names, package names, commands, CLI flags, option names, environment variables, URLs, file paths, inline code, code fences, HTML attributes, and badge/image URLs.
- Badge alt text or visible labels may be translated only when the change does not require changing the badge URL, query params, or image source.
- If a glossary or do-not-translate list is provided, apply it consistently across every target language.
Workflow
1. Establish the source README and languages
- Confirm the source README path. Default to
README.md. - Identify the source language from the file contents and repo context.
- Determine target languages from the request or existing repo pattern.
- Note any glossary terms, product names, or phrases that must stay untranslated.