i18n-patterns
Installation
SKILL.md
Internationalization (i18n)
How It Works
Translations are written inline using the t() function. A Babel plugin transforms these calls at compile time into hash-based lookups against generated JSON bundles. The same t() API works in both server and client components — the Babel plugin selects the correct runtime automatically.
Source: t({ en: "Hello", zh: "你好" })
↓ Babel plugin
Server: __i18n_lookup("a8cfb50c") — reads from server JSON bundle
Client: useI18nLookup("a8cfb50c") — reads from React context (hook)
Supported Locales
en— Englishzh— Chinese
Defined as SupportedLocale in src/types.ts. Routes use [locale] parameter: /en/about, /zh/about.