i18n
Skill706 starsChanged 6 months agoMITView on GitHub
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".
- Installs packages
29 other projects use a version of this.
Adopted by
Most recently taken up by
- muon-m2/magento2-toolstheir own version, first seen Oct 4, 2026
- Quad4-Software/skillstheir own version, first seen Oct 3, 2026
- lobehub/lobehubtheir own version, first seen Oct 1, 2026
- Cure-Consulting-Group/ProductEngineeringSkillstheir own version, first seen Sep 28, 2026
- casoon/ai-agent-configtheir own version, first seen Sep 27, 2026
- dafaalz/agent-skillstheir own version, first seen Sep 22, 2026
Used with
Projects with it also use oss-pr, pr-automation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
volovelySkillpr-fix
This skill should be used when the user asks to "fix PR comments", "address PR feedback", "resolve PR comments", provides a GitHub PR URL with intent to fix, or says "pr-fix". It reads all review comments on a PR, decides which need code fixes vs. replies, makes the fixes, and posts replies — all with explicit user approval before any GitHub action.
Also in 3 projects that use this
conorluddySkillstate-management
Cache management, configuration best practices, and progressive disclosure patterns for efficient context window usage. Use when working with large responses, optimizing token costs, or managing plugin state across operations.
Also in 4 projects that use this
MicrosoftSkillbump-version
Bump the VoxelPic version to a user-specified value. USE FOR: setting or updating the project version across all files that embed it. Applies to requests like 'bump version to X.Y.Z', 'set version', or 'update version'.
Also in 4 projects that use this
Svenja-devSkille2e-testing
Also in 5 projects that use this
- +2 more from CES-Ltd
Other versions29 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 29
- lobehub/lobehub★ 83ksame name
- iOfficeAI/AionUi★ 33ksame name
- d-kimuson/claude-code-viewer★ 1.3ksame name
- FerroxLabs/wayland★ 608same name
- TheBeardedBearSAS/claude-craft★ 106same name
- CES-Ltd/TitanX★ 48same name
- zzunkie/yardlet★ 17same name
- helderberto/agent-skills★ 16same name
- AI-Answer/Agent-Club★ 9same name
- YepAPI/skills★ 8same name
19 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository77 other files it gives its agents.
- ab-test-setupSkill
- affiliate-marketingSkill
- ahrefs-pythonSkill
- ai-citations-reportSkill
- generate-imageSkill
- apollo-outreachSkill
- backlink-auditSkill
- blueskySkill
- brand-monitorSkill
- brand-devSkill
- competitor-analysisSkill
- competitor-traffic-reportSkill
- content-calendarSkill
- content-gap-analysisSkill
- content-repurposingSkill
- content-strategySkill
- copy-editingSkill
- copywritingSkill
- demand-genSkill
- discord-botSkill
- domain-researchSkill
- email-sequenceSkill
- email-subject-linesSkill
- facebook-adsSkill
- feishu-larkSkill
- geo-analysisSkill
- geo-difficultySkill
- geo-query-finderSkill
- github-starsSkill
- glasser-researchSkill
- google-ads-reportSkill
- google-adsSkill
- google-analyticsSkill
- google-reviewsSkill
- growth-strategySkill
- gsc-portfolio-auditSkill
- hubspotSkill
- icp-builderSkill
- keyword-researchSkill
- launch-strategySkill
- lead-magnetSkill
- linkedin-adsSkill
- linkedin-contentSkill
- marketing-ideasSkill
- marketing-slidesSkill
- newsletterSkill
- onboarding-croSkill
- organize-skillsSkill
- page-croSkill
- podcast-editSkill
- podcast-marketingSkill
- pricing-strategySkill
- product-marketingSkill
- programmatic-seoSkill
- publish-articleSkill
- reddit-marketingSkill
- referral-programSkill
- schema-markupSkill
- search-consoleSkill
- semrush-researchSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 7 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Add complete internationalization to a Next.js (App Router) project using next-intl v4.
- Very specific: line 13
Check the Next.js version (package.json) — must be 13+ with App Router
- Very specific: line 14
Check if i18n is already partially set up (look for next-intl, next-i18next, [locale] routes)
- Distinctive: line 17
Ask the user which locales to support (default recommendation: en, es, fr, de, pt, ja, ar, zh, zh-tw, id, vi, ms, ru, hi)
- Very specific: line 27
Create 4 files under src/i18n/:
- Very specific: line 140
Create src/messages/en.json with all user-facing strings organized by section:
- Very specific: line 166
Use parallel Codex agents via the codex-tasks skill to save Claude credits:
- Distinctive: line 175
Keep technical terms in English (PowerPoint, PDF, API, etc.)
- Very specific: line 178
Write the result to src/messages/{locale}.json
- Distinctive: line 179
After Codex tasks complete, verify the results using the verification script below — Codex output quality varies and must be checked
- Distinctive: line 183
After translation, run a verification script to catch issues:
- Very specific: line 218
Update src/app/sitemap.ts to include hreflang alternates:
- Very specific: line 248
Add a language switcher component that uses useRouter and usePathname from @/i18n/navigation to switch locales while preserving the current …
- Very specific: line 253
Test English URLs have no prefix: https://example.com/tools
- Very specific: line 254
Test locale URLs have prefix: https://example.com/es/tools
- Distinctive: line 255
Verify sitemap has hreflang alternates
- Distinctive: line 256
Check RTL rendering for Arabic
- Distinctive: line 257
Run the translation verification script from Step 8
- Very specific: line 262
Middleware matcher: must exclude _next, api, sitemap, robots, and static asset paths
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
npm install next-intlStep 3: Create i18n Configuration Files
Create 4 files under src/i18n/:
src/i18n/config.ts
export const locales = ['en', 'es', 'fr', 'de', 'pt', 'ja', 'ar', 'zh', 'zh-tw', 'id', 'vi', 'ms', 'ru', 'hi'] as const
export type Locale = (typeof locales)[number]
export const defaultLocale: Locale = 'en'
export const localeNames: Record<Locale, string> = {
en: 'English',
es: 'Espanol',
fr: 'Francais',
de: 'Deutsch',
pt: 'Portugues',
ja: '日本語',
ar: 'العربية',
zh: '简体中文',
'zh-tw': '繁體中文',
id: 'Bahasa Indonesia',
vi: 'Tieng Viet',
ms: 'Bahasa Melayu',
ru: 'Русский',
hi: 'हिन्दी',
}
export const rtlLocales: Locale[] = ['ar']src/i18n/routing.ts
import { defineRouting } from 'next-intl/routing'
import { defaultLocale, locales } from './config'
export const routing = defineRouting({
locales,
defaultLocale,
localePrefix: 'as-needed', // English URLs stay clean, other locales get /es/, /fr/, etc.
})src/i18n/navigation.ts
import { createNavigation } from 'next-intl/navigation'
import { routing } from './routing'
export const { Link, redirect, usePathname, useRouter } = createNavigation(routing)src/i18n/request.ts
import { getRequestConfig } from 'next-intl/server'
import { routing } from './routing'
export default getRequestConfig(async ({ requestLocale }) => {
let locale = await requestLocale
if (!locale || !routing.locales.includes(locale as any)) {
locale = routing.defaultLocale
}
return {
locale,
messages: (await import(`../messages/${locale}.json`)).default,
}
})Step 4: Create Middleware
Create src/middleware.ts:
import createMiddleware from 'next-intl/middleware'
import { routing } from '@/i18n/routing'
export default createMiddleware({
...routing,
localeDetection: false, // Don't auto-redirect based on Accept-Language
})
export const config = {
matcher: ['/((?!_next|api|images|fonts|favicon|sitemap|robots).*)'],
}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:
import createNextIntlPlugin from 'next-intl/plugin'
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts')
// ... existing config ...
export default withNextIntl(nextConfig)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:{ "common": { "signIn": "Sign In", ... }, "tools": { "tool-slug": { "title": "...", "description": "..." } }, "faq": { "tool-slug": [{ "question": "...", "answer": "..." }] } } - Replace all hardcoded strings in components with
useTranslations():const t = useTranslations('common') return <button>{t('signIn')}</button> - For server components, use
getTranslations():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
- The full
- 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:
import json
locales = ['es', 'fr', 'de', 'pt', 'ja', 'ar', 'zh', 'zh-tw', 'id', 'vi', 'ms', 'ru', 'hi']
english_words = ['the ', 'and ', 'you ', 'your ', 'our ', 'this ', 'that ', 'with ', 'from ', 'will ']
with open('src/messages/en.json') as f:
en = json.load(f)
for loc in locales:
with open(f'src/messages/{loc}.json') as f:
data = json.load(f)
# Check: missing sections
missing = [s for s in en if s not in data]
# Check: residual English content
eng_count = 0
def check(d):
nonlocal eng_count # won't work in inline script; use list trick
if isinstance(d, dict):
for v in d.values(): check(v)
elif isinstance(d, str):
if sum(1 for w in english_words if w in d.lower()) >= 3:
eng_count += 1
check(data)
status = 'OK' if not missing and eng_count == 0 else 'ISSUES'
print(f'{loc}: {status} (missing={len(missing)}, english={eng_count})')Step 9: Update Sitemap with Hreflang
Update src/app/sitemap.ts to include hreflang alternates:
import { MetadataRoute } from 'next'
import { locales } from '@/i18n/config'
const baseUrl = 'https://www.example.com'
function buildAlternates(path: string): Record<string, string> {
const alternates: Record<string, string> = {}
for (const locale of locales) {
const prefix = locale === 'en' ? '' : `/${locale}`
alternates[locale] = `${baseUrl}${prefix}${path}`
}
return alternates
}
export default function sitemap(): MetadataRoute.Sitemap {
return pages.map((path) => ({
url: `${baseUrl}${path}`,
lastModified: new Date(),
alternates: { languages: buildAlternates(path) },
}))
}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.xmlconflicts with dynamicsrc/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 continuitylocaleDetection: falseprevents 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

