跳到正文
cccskills
免费在 GitHub 公开

i18n-setup

i18n decision guide: library choice, namespaces, key conventions, LatAm locales, lazy loading, anti-patterns.

中文简介正在准备中。当前显示原文说明。

SebastianLuser/claude-code-arcane星标 3(GitHub 3 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md3.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

i18n-setup — Internationalization Decision Guide

Markets: ES (AR/MX/CO/CL), PT (BR), EN. ES is source-of-truth locale. Use when: >1 country/language, backend content needs translation, local formats required. Skip when: monolingual MVP without multi-country roadmap, or user-generated content.

Library Choice

LayerLibrary
Web (React+Vite)i18next + react-i18next
Mobile (RN/Expo)i18next + react-i18next + expo-localization
Backend Gogo-i18n/v2 (nicksnyder)
Backend TSi18next server-side or intl-messageformat
FormattingNative Intl.* (DateTimeFormat, NumberFormat) — no external deps

Rejected: react-intl (verbose), lingui (large teams only), next-intl (Next.js only).

Namespace Strategy

Split by feature: common, auth, courses, notifications. One JSON per namespace per locale. Split when: 50+ keys, route-specific loading, separate team ownership. Keep shared UI (buttons, labels) in common.

Key Naming

Pattern: feature.component.element or feature.action.state Good: courses.list.empty, courses.create.error.duplicate | Bad: button1, text_here

Pluralization, Interpolation, and Formatting

  • CLDR plural suffixes: _zero, _one, _other (auto-handles all CLDR rules)
  • Interpolation ({{name}}) — never concatenate translated strings
  • HTML in translations: <Trans> with component mappings, never raw HTML in t()
  • Use native Intl.* exclusively for dates/numbers/currency
  • Currency: AR→ARS, BR→BRL, MX→MXN, Intl→USD
  • DB: store amount (integer minor units) + currency (ISO 4217)
  • RN: enable Hermes intl (jsEngine: "hermes" + intl: true)

LatAm Considerations

  • es-AR ≠ es-MX for currency/dates — always full BCP47 (pt-BR, not pt_br)
  • Voseo/tuteo differs by country — locale-specific strings
  • Portuguese tends longer — test for UI overflow

Detection, Lazy Loading, and Workflow

Detection order: 1. Query param 2. User pref (DB) 3. Cookie/localStorage 4. Browser locale 5. Fallback es. Persist on change, sync to backend on login. Lazy loading: web — always per route (i18next-http-backend); mobile — bundle if <50KB, dynamic otherwise; CDN with versioned cache. Workflow: dev adds ES key → i18next-parser in CI → Crowdin/Lokalise → auto-PR. CI fails on missing keys. Security: never interpolate user HTML in t(), validate locale against allowlist, log key+locale not rendered text.

Anti-patterns

  • Hardcoded strings mixed with t() — breaks extraction
  • Concatenating translations — use interpolation
  • Skipping pluralization — "1 cursos"
  • Manual date/currency formatting instead of Intl
  • No fallback language — missing key = broken UI
  • Language change not persisted — lost on reload
  • Assuming 1 language = 1 locale (es-AR ≠ es-MX)

Checklist

  • Library chosen per layer
  • Namespaces by feature, lazy-loaded by route
  • Plural keys use _one/_other/_zero
  • Formatting via native Intl APIs
  • Detection + persistence configured
  • CI extraction, missing keys fail build
  • ES as source-of-truth, translation platform integrated

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Plan, design, and implement A/B tests and experiments with statistical rigor. Covers hypothesis frameworks, sample sizing, metrics, and result analysis.

中文简介正在准备中。当前显示原文说明。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Web/mobile accessibility decision guide: WCAG 2.2 AA, ARIA, keyboard nav, focus management, contrast, testing. Use for: a11y, accessibility, wcag, aria, screen reader, keyboard, contrast.

中文简介正在准备中。当前显示原文说明。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Generate, iterate, and scale ad creative for paid advertising across Google, Meta, LinkedIn, and X. Covers platform specs, creative frameworks, and quality validation.

中文简介正在准备中。当前显示原文说明。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Musica interactiva para juegos: layering vertical, re-secuenciacion horizontal, stingers, reglas de transicion con sync points, y mapeo de estados de gameplay a musica. Usar para: musica adaptativa, sistema de musica dinamica, transiciones musicales, combat music.

中文简介正在准备中。当前显示原文说明。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Design multi-agent systems, create agent architectures, define communication patterns, and build autonomous agent workflows with structured evaluation frameworks.

中文简介正在准备中。当前显示原文说明。

SebastianLuser/claude-code-arcane32026年10月27日 更新

Inter-agent communication protocol for C-suite agent teams. Defines invocation syntax, loop prevention, isolation rules, response formats, and quality loops.

中文简介正在准备中。当前显示原文说明。

SebastianLuser/claude-code-arcane32026年10月27日 更新

查看 SebastianLuser 的全部技能

报告此技能的问题