internationalization
Skill này làm gì
Skill này mô tả cách giữ văn bản hướng đến người dùng trong các danh mục dịch của ứng dụng. Nó bao gồm ngôn ngữ nào được dùng, cách đặt tên khóa và cách chạy kiểm tra dịch. Skill dành cho lập trình viên thêm hoặc đổi văn bản trong các ứng dụng hỗ trợ nhiều ngôn ngữ.
Khi nào nên dùng
- ✓Khi bạn thêm hoặc đổi văn bản hiển thị, nhãn, thông báo hoặc trạng thái trống trong ứng dụng.
- ✓Khi một ứng dụng đã chọn thêm các ngôn ngữ khác và danh mục của chúng cần cập nhật.
- ✓Khi bộ chọn ngôn ngữ hiển thị các ngôn ngữ mà ứng dụng thực sự không tải được.
Liên kết skill
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/internationalization/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể thêm một nhãn mới vào trang cài đặt và cập nhật luôn bản dịch tiếng Pháp và tiếng Đức không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent thêm văn bản vào danh mục tiếng Anh trước, rồi chỉ cập nhật các locale mà ứng dụng liệt kê là đã bật. Nó giữ nguyên các khóa và placeholder, rồi chạy kiểm tra i18n.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Internationalization — opt-in translations
English (en-US) is the default source locale. Do not create or update
additional locale catalogs unless the app's agent-native.config.ts lists them
under translations.locales.
Rule
Visible framework/template UI copy belongs in the app's i18n catalog, not
inline in components. When you add or edit UI text, update the English source
catalog first, then update only the locale catalogs listed in
translations.locales, and run the i18n guard.
Catalogs
Templates use app/i18n/:
en-US.tsis the canonical source tree and fallback.- Other locale files keep the same non-plural keys and the same placeholders.
index.tsexports anAgentNativeI18nCatalogwith English bundled and non-English catalogs loaded by dynamic import.
Use BCP-47 filenames from the supported set: en-US, zh-CN, es-ES,
fr-FR, de-DE, ja-JP, ko-KR, pt-BR, hi-IN, ar-SA.
If an app only ships translations for a subset of that set, set
supportedLocales on the AgentNativeI18nCatalog to that subset. Without it,
<LanguagePicker /> lists every framework-supported locale regardless of
whether loadMessages can actually resolve it.
UI Pattern
- Wrap apps with
AppProviders i18n={{ catalog: i18nCatalog }}. - Read strings with
useT()and keep keys stable. - Apps expose a
/settingsroute without a sidebar item for it: Settings opens from the account menu in the sidebar footer and from ⌘, (Ctrl+, elsewhere). Core's Account › Preferences page already renders the Interface language row (with Timezone; both are the per-userlocalizationrecord, so a change applies in every app); don't add a second picker to an app's Settings page. Keep the header language icon only as a quick-access shortcut. - Don't add an "Agent settings" row to an app's settings page: the Agent
group's pages are part of Settings. Link to a page with
buildSettingsRoute(page, sub?), and localize the link's label. - Settings copy follows the same rules: page and group labels are core
agentChat.settingsShell.*keys, and an app's own rows, areas, and search entries take already translated strings from the app catalog. - Use
useFormatters()for dates, numbers, relative time, and lists instead of embedding formatted values in translation strings. - Do not translate stable identifiers: action names, route names, enum values, app-state keys, database values, protocol fields, env var names, or provider names.
Plurals And Placeholders
Plural strings use i18next/CLDR suffixes. Do not force every locale to copy English plural categories:
- English uses
_oneand_other. - Chinese and Japanese usually use
_other. - Arabic uses
_zero,_one,_two,_few,_many, and_other.
Keep interpolation placeholders identical across locales, such as
{{count}}, {{name}}, or ICU-style {count} arguments.
RTL
New UI should be RTL-safe. Prefer logical CSS utilities/properties such as
ms-*, me-*, ps-*, pe-*, start-*, end-*, text-start, and
text-end when direction matters. Avoid hardcoded left/right positioning for
new localized UI unless it is genuinely physical.
Verification
Run:
pnpm guard:i18n-catalogs
For broader changes, also run the affected template tests and pnpm typecheck.
Machine translation is only a starting point; high-visibility strings need
human review.
Câu hỏi thường gặp
Dịch có được bật mặc định không?
Không. Ứng dụng phải chọn thêm các locale khác trong cấu hình. Tiếng Anh là mặc định.
Tôi có phải đổi mọi file ngôn ngữ không?
Chỉ các locale mà ứng dụng liệt kê là đã bật. Danh mục tiếng Anh luôn được cập nhật trước.
Tôi có thể đặt văn bản trực tiếp trong component không?
Skill nói văn bản hiển thị nên nằm trong danh mục, không nằm trực tiếp trong component.
Chi tiết
Mô tả gốc của tác giả
How to add or edit localized UI copy in agent-native apps. Use when adding, removing, or changing user-visible interface text, prompts, toasts, labels, empty states, or date/number/list formatting. Apps opt in to additional locales from `agent-native.config.ts`.
repo: BuilderIO/agent-native
Độ phổ biến
- Sao GitHub
- 7.6k
- Vị trí xếp hạng
- #13165
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
design-exploration
7.6kGiúp agent của bạn khám phá nhiều hướng thiết kế giao diện song song, để bạn chọn một hướng rồi tinh chỉnh thiết kế đã chọn.
visual-edit
7.6kGiúp agent của bạn mở một ứng dụng cục bộ đang chạy trong trình chỉnh sửa trực quan, để bạn xem và sửa các màn hình thật cùng nhau.
turn-into-app
7.6kBiến quy trình, bảng tính hoặc dự án thành ứng dụng trực quan có màn hình đầy đủ dữ liệu, với agent làm việc phía sau các điều khiển.
visual-plan
7.6kBiến một kế hoạch viết bằng văn bản thuần thành kế hoạch trực quan tương tác, có sơ đồ, bản đồ file, đoạn code và các câu hỏi còn mở.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.