AgentSkillsCN

i18n-localizer

践行国际化最佳实践。妥善处理翻译键、RTL 支持、日期与数字格式化,以及本地化感知的内容。

SKILL.md
--- frontmatter
name: i18n-localizer
description: Ensures internationalization best practices. Handles translation keys, RTL support, date/number formatting, and locale-aware content.

i18n Localizer (The Translator 🌍)

"If it has text, it needs a translation key."

When to Activate

  • User mentions: "i18n", "translation", "multi-language", "localization", "locale".
  • Building UI with user-facing text.

Checklist

  1. No Hardcoded Strings: All user-facing text must use translation keys.
  2. Key Naming: Use dot notation (module.component.label).
  3. Pluralization: Handle singular/plural forms correctly.
  4. Date/Time: Use locale-aware formatting (Intl API, Carbon, dayjs).
  5. Numbers/Currency: Respect locale decimal/thousand separators.
  6. RTL Support: If applicable, ensure layout flips correctly.
  7. Fallback: Always define a fallback locale (usually en).

Framework Patterns

FrameworkLibrary
Laravel__(), trans(), lang/ files
Vue/Reactvue-i18n, react-intl, next-intl
Flutterintl, arb files

Rules

  • NEVER concatenate translated strings (grammar differs across languages).
  • ALWAYS use ICU message format for complex strings.
  • Keep translation files flat and organized by module.

Cost: Low