openclaudia/openclaudia-skills/i18n
Claude Code and agent skill by openclaudia/openclaudia-skills
- community
Checking that the SKILL.md file is still in the repository.
Add full internationalization (i18n) to a Next.js project using next-intl. Supports 14+ languages, SEO-friendly locale routing, hreflang sitemaps, and bulk translation. Use when the user asks to "internationalize", "add i18n", "add translations", "multi-language", "localize", "add language support", or "translate my site".
Install
npx vskill@latest install openclaudia/openclaudia-skills/i18nSKILL.md
Internationalize a Next.js Project
Add complete internationalization to a Next.js (App Router) project using next-intl v4. This skill handles routing, translation files, sitemap hreflang, and bulk translation across all locales.
Step 1: Assess the Project
- Check the Next.js version (
package.json) — must be 13+ with App Router - Check if i18n is already partially set up (look for
next-intl,next-i18next,[locale]routes) - Identify all pages/routes that need translation
- Identify all user-facing strings (hardcoded text in components)
- Ask the user which locales to support (default recommendation: en, es, fr, de, pt, ja, ar, zh, zh-tw, id, vi, ms, ru, hi)
Step 2: Install Dependencies
Step 3: Create i18n Configuration Files
Create 4 files under src/i18n/:
src/i18n/config.ts
src/i18n/routing.ts
src/i18n/navigation.ts
src/i18n/request.ts
Step 4: Create Middleware
Create src/middleware.ts:
Key decision: localeDetection: false prevents auto-redirecting users based on browser language. This keeps English URLs stable for SEO. Users can manually switch languages via a language selector.
Step 5: Update next.config
Wrap the existing config with createNextIntlPlugin:
Step 6: Add [locale] Dynamic Route
Move all page content under src/app/[locale]/:
- Create
src/app/[locale]/layout.tsxwith:
generateStaticParams()returning all localessetRequestLocale(locale)call<NextIntlClientProvider>wrapping children<html lang={locale} dir={rtlLocales.includes(locale) ? 'rtl' : 'ltr'}>- Hreflang
<link>tags in<head>for all locales +x-default
- Move existing pages into
src/app/[locale]/ - Each page should call
setRequestLocale(locale)for static generation
Step 7: Extract Strings into Translation Files
- Create
src/messages/en.jsonwith all user-facing strings organized by section:
``json { "common": { "signIn": "Sign In", ... }, "tools": { "tool-slug": { "title": "...", "description": "..." } }, "faq": { "tool-slug": [{ "question": "...", "answer": "..." }] } } ``
- Replace all hardcoded strings in components with
useTranslations():
``typescript const t = useTranslations('common') return <button>{t('signIn')}</button> ``
- For server components, use
getTranslations():
``typescript const t = await getTranslations('common') ``
Step 8: Translate to All Locales
For each non-English locale, create src/messages/{locale}.json with the same structure as en.json.
Translation Strategy
Use parallel Codex agents via the codex-tasks skill to save Claude credits:
- Launch one Codex task per locale (up to 7 in parallel) using
/codex-tasks - Each task reads
en.json, translates all strings, writes{locale}.json - Codex prompt should include:
- The full
en.jsoncontent (or path to read it) - Target language name and locale code
- Instructions:
- Translate naturally, not literally
- Keep technical terms in English (PowerPoint, PDF, API, etc.)
- Preserve JSON structure exactly (same keys, same nesting)
- Preserve interpolation variables like
{count},{name}unchanged - Write the result to
src/messages/{locale}.json
- After Codex tasks complete, verify the results using the verification script below — Codex output quality varies and must be checked
Verification
After translation, run a verification script to catch issues:
Step 9: Update Sitemap with Hreflang
Update src/app/sitemap.ts to include hreflang alternates:
Important: Generate one canonical URL per page with hreflang alternates, NOT one URL per locale. This prevents duplicate content in search results.
Step 10: Add Language Selector (Optional)
Add a language switcher component that uses useRouter and usePathname from @/i18n/navigation to switch locales while preserving the current path.
Step 11: Verify
- Build the project:
npm run build— check that all static pages generate correctly - Test English URLs have no prefix:
https://example.com/tools - Test locale URLs have prefix:
https://example.com/es/tools - Verify sitemap has hreflang alternates
- Check RTL rendering for Arabic
- Run the translation verification script from Step 8
Common Pitfalls
- `public/sitemap.xml` conflicts with dynamic
src/app/sitemap.tsin dev mode — delete the static one or rename it - Middleware matcher must exclude
_next,api,sitemap,robots, and static asset paths - `localePrefix: 'as-needed'` is critical — it keeps default locale URLs clean for SEO continuity
- `localeDetection: false` prevents unwanted redirects that break SEO and confuse users
- Large translation files (5000+ lines per locale) can make git pushes fail — use
git config http.postBuffer 524288000 - Verify translations thoroughly — automated translation often produces mixed-language output; always verify with the English word detection script after Codex tasks complete
Locale Count Reference
- 14 locales x N pages = 14N static pages at build time
- Each locale JSON file is typically 2-5x the size of en.json (CJK characters, verbose languages)
- Build time increases linearly with locale count
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/i18n/SKILL.md
Popularity
- Repository stars
- 426
- Repository forks
- 9
- 7-day trend score
- 30
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 15 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openclaudia/openclaudia-skills/i18n)