Skip to content
Back to skills

I18n Best Practices

ASecurity

- **next-intl**: Recommended for Next.js App Router (RSC-compatible, type-safe) - **react-intl**: ICU MessageFormat, good for complex plurals/gender - **i18next + react-i18next**: Framework-agnostic, largest ecosystem

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 27, 2026
developmentgoreactnextjsapi

Works with

  • vscode
  • cli
  • api

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add ByeongminLee/nextjs-claude-code --skill i18n-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of I18n Best Practices?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for I18n Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/byeongminlee-i18n-best-practices/badge)](https://www.skillsdirectory.com/skills/byeongminlee-i18n-best-practices)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Internationalization (i18n) Best Practices

## Library Choice
- **next-intl**: Recommended for Next.js App Router (RSC-compatible, type-safe)
- **react-intl**: ICU MessageFormat, good for complex plurals/gender
- **i18next + react-i18next**: Framework-agnostic, largest ecosystem

## Next.js App Router Setup (next-intl)
```
src/
  i18n/
    request.ts          # getRequestConfig()
    routing.ts          # defineRouting({ locales, defaultLocale })
  messages/
    en.json
    ko.json
  middleware.ts          # createMiddleware(routing)
  app/
    [locale]/
      layout.tsx         # NextIntlClientProvider
      page.tsx           # useTranslations('namespace')
```

## Key Patterns
- **Namespace separation**: Group by feature (`auth.login`, `dashboard.title`)
- **Type-safe keys**: Generate types from default locale JSON
- **Pluralization**: Use ICU format `{count, plural, one {# item} other {# items}}`
- **Date/Number formatting**: Use `useFormatter()` (next-intl) or `Intl` API, never manual formatting
- **Server Components**: `getTranslations()` in RSC, `useTranslations()` in client
- **Dynamic messages**: Avoid string concatenation; use interpolation `t('greeting', { name })`

## Common Mistakes
- Hardcoded strings in components (use extraction tools: `i18n-ally` VSCode extension)
- Locale in URL path AND cookie (pick one strategy)
- Missing fallback locale handling
- Not accounting for text expansion (German ~30% longer than English)
- Date/currency formatting without locale context

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.