Internationalization changes
Use the localization system already present in the project. This skill does not prescribe a framework or require localization where the product has intentionally chosen otherwise.
Discover the localization contract
Before editing:
- Find the translation API used at the relevant frontend or backend boundary.
- Locate the source catalogs and determine which are authoritative, generated, or fallback-only.
- Inspect key naming, interpolation, plural, date, number, list, and directionality conventions.
- Find validation or tests that check catalog completeness and placeholder consistency.
- Determine whether server and client share catalogs or maintain separate message domains.
Add or change user-visible text
- Reuse an existing key when the meaning and placeholders match exactly.
- Otherwise add a stable, semantic key using the project's naming convention.
- Update every catalog required by the project's completeness policy. Do not fabricate translations when accurate translation is unavailable; use the established fallback or clearly identify the untranslated locale.
- Keep placeholder names, types, and plural variables consistent across locales.
- Pass dynamic values as interpolation arguments rather than concatenating translated fragments.
- Keep developer-only logs, protocol identifiers, and internal diagnostics out of catalogs unless users see them.
Do not replace a project's named placeholders with positional placeholders, or vice versa, without updating all callers and validation.
Formatting and grammar
Use locale-aware formatters for dates, times, numbers, currencies, percentages, lists, and relative time. Use the project's plural/select mechanism rather than branching on English grammar in application code.
Avoid composing sentences from independently translated fragments when word order can differ by language. Give translators enough context through the project's supported comments or metadata.
Frontend and backend boundaries
- Resolve UI labels through the frontend translation mechanism.
- Resolve user-facing backend errors or messages at the established boundary, using the request or account locale.
- Keep machine-readable error codes stable when clients depend on them; localize presentation separately when that is the project contract.
- Preserve server-rendering and hydration behavior when locale affects initial markup.
Locale and directionality support
When adding a locale, verify:
- Locale identifiers and negotiation aliases.
- Fallback behavior.
lang and text direction (ltr or rtl).
- Font and layout support where relevant.
- Formatting behavior for representative values.
- The complete required key set.
Do not assume language codes, supported locales, or right-to-left behavior from another project.
Verify
Run available catalog validation and focused tests. At minimum check:
- Missing and extra keys according to project policy.
- Placeholder and plural-variable parity.
- Fallback behavior for an absent translation.
- Representative interpolation and plural cases.
- Frontend rendering or backend response behavior.
- Directionality when an RTL locale is supported.
1---2name: i18n3description: Preserve an existing application's internationalization system when adding or changing user-visible text, validation messages, formatting, locales, or directionality. Use for frontend or backend localization work; follow the project's catalogs, fallback rules, and translation API.4---56# Internationalization changes78Use the localization system already present in the project. This skill does not prescribe a framework or require localization where the product has intentionally chosen otherwise.910## Discover the localization contract1112Before editing:13141. Find the translation API used at the relevant frontend or backend boundary.152. Locate the source catalogs and determine which are authoritative, generated, or fallback-only.163. Inspect key naming, interpolation, plural, date, number, list, and directionality conventions.174. Find validation or tests that check catalog completeness and placeholder consistency.185. Determine whether server and client share catalogs or maintain separate message domains.1920## Add or change user-visible text2122- Reuse an existing key when the meaning and placeholders match exactly.23- Otherwise add a stable, semantic key using the project's naming convention.24- Update every catalog required by the project's completeness policy. Do not fabricate translations when accurate translation is unavailable; use the established fallback or clearly identify the untranslated locale.25- Keep placeholder names, types, and plural variables consistent across locales.26- Pass dynamic values as interpolation arguments rather than concatenating translated fragments.27- Keep developer-only logs, protocol identifiers, and internal diagnostics out of catalogs unless users see them.2829Do not replace a project's named placeholders with positional placeholders, or vice versa, without updating all callers and validation.3031## Formatting and grammar3233Use locale-aware formatters for dates, times, numbers, currencies, percentages, lists, and relative time. Use the project's plural/select mechanism rather than branching on English grammar in application code.3435Avoid composing sentences from independently translated fragments when word order can differ by language. Give translators enough context through the project's supported comments or metadata.3637## Frontend and backend boundaries3839- Resolve UI labels through the frontend translation mechanism.40- Resolve user-facing backend errors or messages at the established boundary, using the request or account locale.41- Keep machine-readable error codes stable when clients depend on them; localize presentation separately when that is the project contract.42- Preserve server-rendering and hydration behavior when locale affects initial markup.4344## Locale and directionality support4546When adding a locale, verify:4748- Locale identifiers and negotiation aliases.49- Fallback behavior.50- `lang` and text direction (`ltr` or `rtl`).51- Font and layout support where relevant.52- Formatting behavior for representative values.53- The complete required key set.5455Do not assume language codes, supported locales, or right-to-left behavior from another project.5657## Verify5859Run available catalog validation and focused tests. At minimum check:60611. Missing and extra keys according to project policy.622. Placeholder and plural-variable parity.633. Fallback behavior for an absent translation.644. Representative interpolation and plural cases.655. Frontend rendering or backend response behavior.666. Directionality when an RTL locale is supported.