
Frontend Internationalization Best Practices
This walks you through wiring up remix-i18next in React Router framework mode with all the gotcha details: middleware setup, cookie-based locale detection, serving translation files from resource routes, and keeping client and server hydration in sync. You'll want this when you're past the basic tutorial phase and need to handle language switching, proper caching headers, and type-safe translation resources. The rules cover the full round trip from middleware detection through to bound t() functions in loaders and useTranslation hooks in components. It's opinionated about cookie persistence over URL prefixes, which makes sense for most apps but isn't universal.
- skills.sh installs
- 193
- GitHub stars
- 92
- last updated
- Aug 21, 2026
Install
$ npx -y skills add sergiodxa/agent-skills --skill frontend-internationalization-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
Internationalization Best Practices
Guidelines for building a React Router i18n setup with remix-i18next. Focuses on middleware detection, locale storage, type safety, and client/server synchronization.
When to Apply
- Adding i18n to a React Router app
- Wiring
remix-i18nextmiddleware - Implementing language switching or locale detection
- Serving locale resources from
/api/locales
Rules Summary
Setup & Middleware (CRITICAL)
setup-middleware - @rules/setup-middleware.md
Configure createI18nextMiddleware and type-safe resources.
export const [i18nextMiddleware, getLocale, getInstance] =
createI18nextMiddleware({
detection: {
supportedLanguages: ["es", "en"],
fallbackLanguage: "en",
cookie: localeCookie,
},
i18next: { resources },
plugins: [initReactI18next],
});
locales-structure - @rules/locales-structure.md
Define locale resources per language and re-export.
// app/locales/en/translation.ts
export default { title: "Example" };
Namespaces (HIGH)
namespaces-strategy - @rules/namespaces-strategy.md
Use a single namespace for small apps; multiple namespaces for large apps.
Sponsors
Details
- Repository
- github.com/sergiodxa/agent-skills
- Categories
- Frontend Development, Backend & APIs, AI & Agent Building
- First seen
- Jun 3, 2026