sergiodxa avatar

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-code

Installs 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-i18next middleware
  • 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

More from sergiodxa/agent-skills

All 10
1epicenterhq avatarsvelteepicenterhq/epicenterSvelte 5 component and state-module patterns for Epicenter apps. Use when editing `.svelte`, `.svelte.ts`, or Svelte UI state code involving runes, `$props`, sn192skills.sh installs
2oguzhan18 avatarangular-lifecycleoguzhan18/angular-ecosystem-skillsALWAYS use when working with Angular Lifecycle Hooks, ngOnInit, ngOnChanges, ngAfterViewInit, or component lifecycle in Angular.176skills.sh installs
3samhvw8 avatarfrontend-developmentsamhvw8/dotfilesMulti-framework frontend development. Frameworks: React 18+ (Suspense, hooks, TanStack), Vue 3 (Composition API, Pinia, Nuxt), Svelte 5 (Runes, SvelteKit), Angu174skills.sh installs
4srbhr avatartailwind-patternssrbhr/resume-matcherProduction-ready Tailwind CSS patterns for common website components: responsive layouts, cards, navigation, forms, buttons, and typography. Includes spacing sc170skills.sh installs
5pedronauck avatarui-ux-pro-maxpedronauck/skillsUI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind,168skills.sh installs
6modu-ai avatarmoai-domain-frontendmodu-ai/moai-adkFrontend development specialist covering React 19, Next.js 16, Vue 3.5, and modern UI/UX patterns with component architecture. Use when building web UIs, implem140skills.sh installs