Configures internationalization for React Router apps using remix-i18next, including middleware, locale detection, language switching, and resource routes.
Ships in sergiodxa-agent-skills-1. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Guidelines for building a React Router i18n setup with remix-i18next. Focuses on middleware detection, locale storage, type safety, and client/server synchronization.
remix-i18next middleware/api/localesConfigure createI18nextMiddleware and type-safe resources.
export const [i18nextMiddleware, getLocale, getInstance] =
createI18nextMiddleware({
detection: {
supportedLanguages: ["es", "en"],
fallbackLanguage: "en",
cookie: localeCookie,
},
i18next: { resources },
plugins: [initReactI18next],
});
Define locale resources per language and re-export.
// app/locales/en/translation.ts
export default { title: "Example" };
Use a single namespace for small apps; multiple namespaces for large apps.
// Large app: common + route namespaces
export default { common, home, notFound };
Prefer cookie/session for speed, with DB as source of truth.
export const [i18nextMiddleware, getLocale] = createI18nextMiddleware({
detection: { cookie: localeCookie, fallbackLanguage: "en" },
});
Store locale in cookie/session and keep it in sync.
return data(
{ locale },
{ headers: { "Set-Cookie": await localeCookie.serialize(locale) } },
);
Send locale to the UI and sync <html lang dir>.
export async function loader({ context }: Route.LoaderArgs) {
let locale = getLocale(context);
return data(
{ locale },
{ headers: { "Set-Cookie": await localeCookie.serialize(locale) } },
);
}
Initialize i18next client with htmlTag detection.
i18next.init({ detection: { order: ["htmlTag"], caches: [] } });
Reuse the middleware instance in SSR with I18nextProvider.
<I18nextProvider i18n={getInstance(routerContext)}>
<ServerRouter context={entryContext} url={request.url} />
</I18nextProvider>
Serve /api/locales/:lng/:ns with validation and cache headers.
return data(namespaces[ns.data], { headers });
Use the bound t() in loaders and useTranslation in components.
let t = getInstance(context).getFixedT(locale);
Provide a 404 route so middleware runs and translations load.
rules/entry-client-init.md (opens in a new tab)rules/entry-server-provider.md (opens in a new tab)rules/language-switcher.md (opens in a new tab)rules/locale-detection.md (opens in a new tab)rules/locales-resource-route.md (opens in a new tab)rules/locales-structure.md (opens in a new tab)rules/namespaces-strategy.md (opens in a new tab)rules/not-found-i18n.md (opens in a new tab)rules/root-locale-sync.md (opens in a new tab)rules/setup-middleware.md (opens in a new tab)rules/use-bound-t-in-loader.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/sergiodxa-agent-skills-1:frontend-internationalization-best-practicesfrom sergiodxa-agent-skills-1
sergiodxa-agent-skills-1@cascade-code-languages-misc-1 is listed by joshuarweaver/cascade-code-languages-misc-1 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin sergiodxa-agent-skills-111 skills in this plugin
/frontend-accessibility-best-practicesAccessibility (a11y) best practices for React components. Use when creating UI components, forms, interactive elements, or reviewing code for accessibility compliance./frontend-async-best-practicesAsync/await and Promise optimization guidelines. Use when writing, reviewing, or refactoring asynchronous code to eliminate waterfalls and maximize parallelism. Triggers on tasks involving data fetching, loaders, actions, or Promise handling./frontend-js-best-practicesJavaScript performance optimization guidelines. Use when writing, reviewing, or refactoring JavaScript/TypeScript code to ensure optimal performance patterns. Triggers on tasks involving loops, data structures, DOM manipulation, or general JS optimization./frontend-react-best-practicesReact performance optimization guidelines. Use when writing, reviewing, or refactoring React components to ensure optimal rendering and bundle patterns. Triggers on tasks involving React components, hooks, memoization, or bundle optimization./frontend-react-router-best-practicesReact Router performance and architecture patterns. Use when writing loaders, actions, forms, routes, or working with React Router data fetching. Triggers on tasks involving React Router routes, data loading, form handling, or route organization./frontend-tailwind-best-practicesTailwind CSS patterns and conventions for frontend apps. Use when writing component styles, layouts, or working with CSS classes.Other plugins' skills for the same job