Set up internationalization (next-intl, react-i18next)
✓Works with OpenClaudeYou are a frontend developer setting up internationalization in a React or Next.js application. The user wants to configure either next-intl (Next.js App Router) or react-i18next (general React) for multi-language support.
What to check first
- Run
npm list next react-i18next next-intlto see if i18n packages are already installed - Check your
package.jsonto confirm your Next.js version (next-intl requires Next.js 13.4+) and React version - Verify your project structure: Next.js App Router vs Pages Router, or plain React with routing library
Steps
- Install the appropriate i18n package:
npm install next-intlfor Next.js App Router ornpm install react-i18next i18nextfor general React apps - Create a
messagesfolder in your project root with language JSON files:messages/en.json,messages/de.json,messages/fr.jsoncontaining key-value translation pairs - For next-intl: Create
i18n.tsin your project root withcreateSharedPathnamesNavigation()andgetRequestConfig()functions - For next-intl: Update
next.config.jsto add thei18nplugin configuration with supported locales and default locale - For next-intl: Wrap your app in
NextIntlClientProviderat the layout level and set up dynamic locale routing in[locale]folder structure - For react-i18next: Create
i18n.jsto initialize i18next withi18n.use(HttpBackend).init()and load language resources - For react-i18next: Wrap your root
Appcomponent withSuspenseandI18nextProvider - Use
useTranslation()hook (react-i18next) oruseTranslations()hook (next-intl) in components to access translated strings
Code
// next-intl setup: i18n.ts
import { getRequestConfig } from 'next-intl/server';
import { createSharedPathnamesNavigation } from 'next-intl/navigation';
export const locales = ['en', 'de', 'fr'];
export const defaultLocale = 'en';
export default getRequestConfig(async ({ locale }) => ({
messages: (await import(`./messages/${locale}.json`)).default,
}));
export const { Link, redirect, usePathname, useRouter } =
createSharedPathnamesNavigation({ locales, defaultLocale });
// next.config.js
import createNextIntlPlugin from 'next-intl/plugin';
const withNextIntl = createNextIntlPlugin();
export default withNextIntl({
reactStrictMode: true,
});
// app/[locale]/layout.tsx
import { NextIntlClientProvider } from 'next
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Frontend Skills
Other Claude Code skills in the same category — free to download.
Component Generator
Generate React/Vue/Svelte components with props
Responsive Layout
Create responsive layouts with Tailwind/CSS Grid
Form Builder
Build forms with validation (React Hook Form, Formik)
State Management Setup
Set up state management (Zustand, Redux, Jotai)
Animation Creator
Create animations with Framer Motion or CSS
Dark Mode Setup
Implement dark/light mode toggle
Lazy Loading
Add lazy loading for images and components
SEO Optimizer
Add SEO meta tags, structured data, sitemap
Want a Frontend skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.