i18n-localization – skill Thiết kế & UI cho agent AI
Dùng khi thêm văn bản giao diện, thêm hoặc phát hành một ngôn ngữ, rà soát file dịch, hoặc xây dựng i18n vào ứng dụng. Kiểm tra key bị thiếu, placeholder và dạng số nhiều CLDR bằng locale_sync.py, tìm chuỗi hard-code bằng hardcoded_strings.py, và tạo pseudo-locale bằng pseudo_localize.py.
Cài skill i18n-localization bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/i18n-localization-b2deb.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /i18n-localization – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/i18n-localization-b2deb.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $i18n-localization – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/i18n-localization-b2deb.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /i18n-localization – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/i18n-localization-b2deb.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /i18n-localization – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
i18n Localization
> Portability: 3 stdlib Python scripts. No network, no translation service.
> They check and generate files; they never translate text or call an API.
A release with a new language usually breaks in the same places: keys added in
English and never synced, a placeholder renamed by a translator, Russian or
Arabic files that copied English's two plural forms, UI text that never went
through t(), and dates formatted in the server's locale. This skill makes each
of those a check that fails before the release, not a bug report after it.
Workflow
# 1 - Translation files: keys, placeholders, ICU syntax, CLDR plural forms
python scripts/locale_sync.py locales/ --source-locale en
# 2 - Code: user-facing text that bypasses t(), concatenation, locale-less formatting
python scripts/hardcoded_strings.py src/
# 3 - Layout: generate a pseudo-locale and click through the app in it
python scripts/pseudo_localize.py locales/en/common.json -o locales/en-XA/common.json
python scripts/pseudo_localize.py locales/en/common.json --bidi -o locales/ar-XB/common.jsonStep 1 reads JSON/ARB (i18next or ICU), .properties, Apple .strings,
Android strings.xml and gettext .po, pairs each target with the source file of
the same namespace, and blocks on missing or empty keys, changed placeholders,
ICU syntax errors, plural/select without other, a zero branch that can never
match, and plural categories the target locale needs (ru few/many, ar six
forms), using the embedded CLDR 49 table. Untranslated values, orphan keys,
fuzzy entries and markup drift are warnings.
Step 2 blocks on literal text between tags and literal user-facing
attributes (placeholder, alt, aria-label, title...), and warns on
literals rendered from {cond ? 'Saving...' : ...}, t('a') + x concatenation,
toLocaleString() with no locale, '$' + amount and hardcoded date patterns.
It is a text heuristic: read each finding. Use --warn-only to adopt it on a
legacy codebase, i18n-ignore on a line, and .i18n-allow for brand names.
Step 3 accents, pads (by translation-growth rates) and brackets every string
while keeping placeholders and ICU syntax intact. Plain English on screen is a
hardcoded string; a cut-off [[... is truncation; [[a]] [[b]] is concatenation.
Hard rules
- Never concatenate translated fragments. One message per sentence, with named placeholders and a plural branch.
- Plural forms follow CLDR for the target locale, not English. Never copy
_one/_otherinto ru, pl, uk, cs, ar, he files and call them done. =0, notzero, for an empty-count message in ICU.- Pass the locale to every formatter. Currency comes from the data, not the UI locale.
- Placeholders are code. A translator may move them, never rename or drop them; use positional
%1$swhere order can change. - Do not machine-translate to make the checker pass. A missing translation falls back to the source language; a wrong one ships silently. Mark gaps for a translator instead.
Scripts
| Script | Role | Exit codes |
|---|---|---|
| scripts/locale_sync.py | Translation files vs source locale: keys, placeholders, ICU, CLDR plurals, gettext | 0 · 2 warnings · 3 bad input · 4 blocked |
| scripts/hardcoded_strings.py | React/Vue/Svelte/HTML: untranslated text, concatenation, locale-less formatting | 0 · 2 · 3 · 4 |
| scripts/pseudo_localize.py | en-XA (or --bidi ar-XB) pseudo-locale from JSON/ARB/.properties | 0 · 3 |
All support --help, --sample and --output json.
References and assets
- [
references/plurals_and_messages.md](references/plurals_and_messages.md): CLDR categories per locale, ICU rules, library key shapes, placeholders (8 sources) - [
references/string_routing_and_formatting.md](references/string_routing_and_formatting.md): what to route throught(), Intl formatting, BCP 47 and fallback (7) - [
references/layout_rtl_pseudo.md](references/layout_rtl_pseudo.md): text expansion, pseudo-locales, RTL, release checklist (7) - [
assets/i18n-gate.yml](assets/i18n-gate.yml): CI job example - [
assets/i18n-allow.example](assets/i18n-allow.example): allowlist format
Skill liên quan
- claymorphism – Hướng dẫn triển khai Claymorphism cho Web và App. Kích hoạt khi người dùng muốn các phần…
- popular-web-designs – 54 hệ thống thiết kế thực tế (Stripe, Linear, Vercel) dưới dạng HTML/CSS.
- react-native-design – Làm chủ styling, navigation và animation Reanimated trong React Native cho phát triển…
- codebase-design – Từ vựng chung để thiết kế module sâu. Dùng khi người dùng muốn thiết kế hoặc cải thiện…
- codebase-to-wordpress-converter – Skill chuyên gia chuyển đổi bất kỳ codebase nào (React/HTML/Next.js) thành theme…
- color-blocking – Hướng dẫn triển khai Color Blocking cho Web và App. Kích hoạt khi người dùng muốn các…
- comfyui-gateway – Cổng REST API cho máy chủ ComfyUI. Quản lý workflow, xếp hàng job, webhook, bộ nhớ đệm…
- recsys-pipeline-architect – Thiết kế pipeline gợi ý, xếp hạng và feed có thể kết hợp, theo khung sáu giai đoạn…