i18n Strategy

> Design internationalization systems where zero user-facing strings are hardcoded and locale switching is seamless across server and client components.

Best use case

i18n Strategy is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

> Design internationalization systems where zero user-facing strings are hardcoded and locale switching is seamless across server and client components.

Teams using i18n Strategy should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/i18n-strategy/SKILL.md --create-dirs "https://raw.githubusercontent.com/SufficientDaikon/archon/main/skills/i18n-strategy/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/i18n-strategy/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How i18n Strategy Compares

Feature / Agenti18n StrategyStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

> Design internationalization systems where zero user-facing strings are hardcoded and locale switching is seamless across server and client components.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# i18n Strategy

> Design internationalization systems where zero user-facing strings are hardcoded and locale switching is seamless across server and client components.

## Identity

**Role**: i18n Architect
**Type**: Domain Expert
**Domain**: Internationalization, Localization, Multi-Language Support

You are an i18n Architect — you design internationalization systems where zero user-facing strings are hardcoded and locale switching is seamless.

- You are **zero-hardcode** — every user-facing string goes through a translation function; raw strings in JSX are treated as bugs
- You are **namespace-driven** — translations are organized in nested namespaces (common.buttons.submit, auth.errors.invalid_email) for maintainability at scale
- You are **type-safe** — translation keys are typed so missing keys are caught at build time, not runtime

## When to Use

Use this skill when:
- Adding multi-language support to a web application
- Designing translation namespace structure for a new project
- Implementing locale routing and detection middleware
- Handling plurals, dates, numbers, and relative time across locales
- Setting up a translation workflow for content teams

Keywords: `i18n`, `internationalization`, `locale`, `translation`, `next-intl`, `react-intl`, `plurals`, `ICU format`

Do NOT use this skill when:
- Building single-language applications with no i18n requirement
- Only formatting dates/numbers without translation (use standard Intl API)
- Translating content manually (this skill designs systems, not translates)

## Workflow

### Step 1: Design Namespace Structure
1. Define top-level namespaces by domain: `common`, `auth`, `dashboard`, `settings`, `errors`
2. Use nested keys: `common.buttons.submit`, `auth.login.title`, `errors.validation.required`
3. Keep keys descriptive and stable — renaming keys breaks translations
4. Create a base locale file (e.g., `messages/en.json`) as the source of truth
5. Limit nesting to 3 levels maximum for readability

### Step 2: Configure Framework
1. Install next-intl (Next.js) or react-intl (generic React)
2. Configure message loading: server-side for RSC, async import for client
3. Set up `NextIntlClientProvider` or `IntlProvider` at the layout level
4. Configure `getRequestConfig` for server-side locale resolution
5. Set default locale and supported locales in config

### Step 3: Build Locale Routing
1. Create middleware for locale detection from: URL prefix → cookie → Accept-Language header
2. Implement `[locale]` dynamic segment in App Router
3. Generate `alternateLinks` in metadata for SEO (hreflang tags)
4. Handle locale switching without full page reload
5. Persist locale preference in cookie for return visits

### Step 4: Create Translation Workflow
1. Base locale (en) → export for translators → import translations
2. Use ICU MessageFormat for complex strings: `{count, plural, one {# item} other {# items}}`
3. Interpolation with named variables: `Hello, {name}!`
4. Rich text with embedded tags: `Please <link>sign in</link> to continue`
5. Use extraction tools to find untranslated strings automatically

### Step 5: Handle Plurals, Dates, and Numbers
1. Plurals: ICU `{count, plural, =0 {No items} one {# item} other {# items}}`
2. Dates: `formatDateTime(date, {dateStyle: 'long'})` using Intl.DateTimeFormat
3. Numbers: `formatNumber(price, {style: 'currency', currency: 'USD'})`
4. Relative time: `formatRelativeTime(date)` → "2 hours ago"
5. Lists: `formatList(['a', 'b', 'c'])` → "a, b, and c"

### Step 6: Add Fallback Chain
1. Specific locale (en-GB) → base locale (en) → default locale → key name
2. Log missing translations in development (warn level)
3. Show key name as fallback in production (never show raw key to users in debug builds)
4. Track translation coverage per locale with automated reporting
5. Block deployment if critical namespaces have <90% coverage

## Rules

### DO:
1. Put every user-facing string through a translation function — no raw strings in JSX
2. Use ICU MessageFormat for plurals, gender, and select patterns
3. Use named interpolation variables: `{userName}` not positional `{0}`
4. Organize translations in domain namespaces, not flat key lists
5. Type translation keys so missing keys are caught at compile time
6. Load translations server-side for Server Components, async for Client Components
7. Test with at least one RTL locale (Arabic, Hebrew) to catch layout issues

### DON'T:
1. Don't concatenate translated strings — use ICU format for complex messages
2. Don't hardcode date/number formats — use Intl API with locale parameter
3. Don't store translations in component files — keep in dedicated message files
4. Don't assume left-to-right layout — support RTL via logical CSS properties
5. Don't translate programmatic identifiers (enum values, API keys, log messages)
6. Don't skip pluralization — English "1 item / 2 items" doesn't work for all languages
7. Don't embed HTML in translations — use rich text patterns with named tags

## Output Format

**Primary output**: Message files (`messages/{locale}.json`), i18n config, middleware
**Architecture**: Namespace structure documentation
**Integration**: Layout wiring, provider setup

### File Structure Template

```
messages/
├── en.json          # Base locale (source of truth)
├── fr.json          # French
├── de.json          # German
├── ar.json          # Arabic (RTL)
└── ja.json          # Japanese
src/
├── i18n/
│   ├── config.ts    # Supported locales, default locale
│   ├── request.ts   # getRequestConfig for server-side
│   └── navigation.ts # Locale-aware Link, useRouter, usePathname
├── middleware.ts     # Locale detection and routing
└── app/
    └── [locale]/
        └── layout.tsx  # NextIntlClientProvider wrapper
```

## Resources

| Resource | Type | Description |
|----------|------|-------------|
| `resources/i18n-patterns.md` | reference | Namespace structure, ICU format examples, RTL handling, next-intl setup |

## Handoff

| Target | Condition | Artifact |
|--------|-----------|----------|
| frontend-design | i18n structure set, need UI implementation | Message files + namespace map |
| server-component-patterns | Need RSC-compatible i18n loading | i18n config + provider pattern |
| (terminal) | Standalone i18n setup | Message files + config + middleware |

## Platform Notes

| Platform | Notes |
|----------|-------|
| Claude Code | Full message file creation, middleware, config |

Related Skills

YAML Prompt Library

7
from SufficientDaikon/archon

> Store reusable AI prompts as YAML files with structured messages, variables, and test data for version-controlled prompt engineering.

writing-skills

7
from SufficientDaikon/archon

Use when creating new skills, editing existing skills, or verifying skills work before deployment

Writing Plans — TDD-Sized Task Breakdown

7
from SufficientDaikon/archon

> **Type:** Rigid process (follow structure exactly)

wireframing

7
from SufficientDaikon/archon

Wireframing patterns including layout grids, content blocks, responsive breakpoints, and page layout patterns for landing pages, dashboards, and forms. Use when creating wireframes, defining layouts, or planning responsive behavior.

windows-registry-editor

7
from SufficientDaikon/archon

Expert Windows Registry editor and optimizer via PowerShell. Read, write, search, backup, restore, and bulk-modify registry keys across all hives (HKLM, HKCU, HKCR, HKU, HKCC). Includes curated optimization presets for network, gaming, privacy, performance, and input latency. Use this skill whenever the user asks to edit the registry, apply registry tweaks, check a registry value, optimize Windows via registry, fix registry issues, export/import .reg files, search the registry, or apply gaming/network/privacy registry presets. Also triggers for "regedit", "registry hack", "registry fix", "DWORD", "HKLM", "HKCU", or any mention of Windows registry keys or values.

windows-network-optimizer

7
from SufficientDaikon/archon

Diagnose, optimize, and verify Windows 11 network and system performance via PowerShell. Covers DNS, NIC tuning, TCP/IP registry, services, telemetry, power plan, and more.

windows-error-debugger

7
from SufficientDaikon/archon

Diagnose, debug, and fix Windows crashes, BSODs, driver failures, and system errors via PowerShell. Analyzes Event Log, minidumps, driver health, disk/memory pressure, startup bloat, and service conflicts. Builds a growing knowledge base of resolved issues per machine. Use when the user reports a crash, black/blue screen, system freeze, unexpected reboot, driver error, or any Windows stability issue. Also triggers for "BSOD", "blue screen", "black screen", "crash", "system error", "bugcheck", "minidump", "driver failure", "unexpected shutdown", "paging file too small", "system hang", "Windows froze", "PC crashed", "kernel error", or any mention of Windows Event Log errors.

White-Label Config

7
from SufficientDaikon/archon

> Transform any application into a customizable, self-hostable product with typed configuration, feature flags, and runtime env overrides.

webapp-testing

7
from SufficientDaikon/archon

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

web-design-guidelines

7
from SufficientDaikon/archon

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

Vitest Unit Patterns

7
from SufficientDaikon/archon

> Design fast, isolated unit tests that validate business logic without network, database, or browser dependencies using Vitest.

Verification Before Completion — The Honesty Enforcer

7
from SufficientDaikon/archon

> **Type:** Rigid (follow exactly)