AGENT SKILL

i18n-architect

Architect-level internationalisation — externalised message catalogues with ICU plurals, locale-aware routing and detection, date/number/currency formatting, RTL and text-expansion layout, and the extraction pipeline that keeps translations from rotting. Use when a site must serve more than one language.

License 许可
MIT
最近更新
2026-11-13
Stars
★ 0
Forks
0

01 前言 Front Matter

name
i18n-architect
license
MIT
metadata
{ "crusor-path": "website-architect/frontend-development-architect/i18n-architect", "crusor-domain": "website-architect", "crusor-origin": "original", "crusor-sources": "unicode.org/reports/tr35; formatjs.io/docs; developer.mozilla.org/Intl", "crusor-triggers": "i18n, internationalization, localization, translation, locale, rtl, plurals, intl", "crusor-verified-on": "2026-10-30" }
description
Architect-level internationalisation — externalised message catalogues with ICU plurals, locale-aware routing and detection, date/number/currency formatting, RTL and text-expansion layout, and the extraction pipeline that keeps translations from rotting. Use when a site must serve more than one language.
compatibility
Framework-agnostic; ICU MessageFormat (FormatJS / i18next / framework built-ins)

03 SKILL.md 正文

Internationalisation Architect

Translation is a content pipeline, not a function call. Retrofitting i18n means touching every string, every layout and every date — decide it at the start or pay for it twice.

When to use

  • The product will ship in more than one language, ever.
  • Strings are hard-coded and a second locale is now required.
  • RTL, plurals, or locale-specific formatting is breaking layouts.

When NOT to use

  • Single-locale internal tools — but still externalise strings if a second locale is plausible.

Decision 1 — Strings are data

  • No user-visible string in code; all live in message catalogues keyed by meaning (checkout.summary.itemCount), not by English text.
  • ICU MessageFormat for plurals, gender and selects — never string concatenation or count === 1 ? "item" : "items".
  • Placeholders are named and typed; translators see the full sentence.
  • Keys are stable; changing a key is a migration, not a rename.

Decision 2 — Locale in the URL

Approach Use when
/en/…, /de/… (subpath) default for SEO and cacheability
subdomain separate brands/markets
cookie-only never for public pages — uncrawlable, uncacheable
  • The URL is the source of truth for locale; a redirect negotiates from Accept-Language once, then stays put.
  • <html lang> and hreflang links follow the URL, not the cookie.
  • Locale switching preserves the current route and its state.

Decision 3 — Formatting

  • Dates, numbers, currency, lists, relative time: Intl.*, never manual formatting or hard-coded separators.
  • Time zones explicit; store UTC, render in the user's zone.
  • Currency is an amount + code, not a float with a symbol baked in.
  • Sorting and search use Intl.Collator where locale matters.

Decision 4 — Layout for other languages

  • Text expands 30–40% (German, Finnish): no fixed-width buttons or single-line labels that clip.
  • RTL: use logical properties (margin-inline-start, padding-inline) — never left/right in shared styles.
  • Mirrored icons and directional glyphs handled explicitly; numbers stay LTR.
  • Fonts cover the target scripts; do not rely on fallback rendering for CJK or Arabic.

Decision 5 — Pipeline

  • Extraction runs in CI; a missing key fails the build, never falls back to a raw key in production.
  • Pseudo-locale (en-XA) in dev to surface unexternalised strings and overflow.
  • Lazy-load catalogues per locale per route; the initial bundle carries one.
  • Translators get context (screenshot/description), not bare strings.

Failure modes at scale

  • „{count} items" hard-coded in a component that ships in 12 languages.
  • Locale from a cookie → Google indexes one language; users share wrong URLs.
  • Dates rendered with toLocaleDateString() and no locale argument.
  • RTL shipped with left/right in 400 places.
  • Translation keys drift; half the UI shows raw checkout.title.

Verification receipts

  1. CI: every key present in every shipped locale (no fallback in prod).
  2. Pseudo-locale build reviewed for overflow and missed strings.
  3. Intl audit: no manual date/number/currency formatting.
  4. RTL pass on the primary journey; logical properties verified.
  5. hreflang + lang correctness on a sample of routes.

04 同仓库更多 Skills

SriAkhilSJ
SriAkhilSJ/PulseAIRepo

interaction-patterns-architect

Architect-level interaction design in code — choosing established patterns over invented ones, feedback and latency behaviour, destructive-action safeguards, navigation and overlay conventions, and the state model behind every interactive surface. Use when a screen has to behave, not just look.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

design-system-ops-architect

Architect-level operation of a design system in code — token pipelines and versioning, component API and variant policy, the catalogue as the contract, adoption metrics, and the governance that stops a system from forking into three. Use when a component library must survive several teams.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

design-handoff-architect

Architect-level design handoff — what must be specified before implementation starts, tokens over raw values, responsive and content-limit contracts, state matrices, and the review loop that catches drift between design and code. Use when a design is about to become code.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

content-microcopy-architect

Architect-level UI content — where strings live, voice and terminology consistency, error and empty-state copy as part of the interface, translation-ready authoring, and the content model a product needs before it multiplies screens. Use when the words in the interface matter as much as the pixels.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

ui-ux-implementation-architect

Architect-level direction for turning a design into working UI — the handoff contract, component ownership versus screen-level layout, interaction and state conventions, design QA gates, and the review habits that keep an implementation faithful without frozen pixels. Use before any specific UI implementation skill.

★ 0
SriAkhilSJ
SriAkhilSJ/PulseAIRepo

test-strategy-architect

Architect-level test strategy — allocating assertions across unit, integration, contract and end-to-end layers, designing for testability through dependency boundaries, fixture and data strategy, and the flake and coverage policies that keep a suite trustworthy. Use when defining how a codebase is tested.

★ 0