i18n-react-rules

Configure react-i18next with language detection and namespace translation files for React Vite SPAs.

3|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill i18n-react-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: i18n-react-rules
Source: https://github.com/mauriciodelrio/delriodev-skills/tree/main/es-skills/software/frontend/i18n-react-rules
Command: npx skills add https://github.com/mauriciodelrio/delriodev-skills --skill i18n-react-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide a clear, production-ready pattern to add internationalization to Vite single-page React applications so translations, pluralization, locale detection, formatting, and RTL behavior work consistently and are maintainable across the codebase.

Core Features & Use Cases

  • Standardized Setup: Install and configure react-i18next with i18next-http-backend and i18next-browser-languagedetector to load namespaces from public locales and detect user language.
  • Pluralization and ICU: Support i18next native plural suffixes and optional i18next-icu for complex MessageFormat cases like gender selects and advanced plurals.
  • Locale-aware Formatting & RTL: Use the browser Intl API for dates, numbers, and currency and apply logical CSS properties or document dir toggling for reliable RTL support.
  • Use Case: Localize an e-commerce Vite SPA with namespace-separated translation files, proper plural handling for product counts, localized price/date formatting, and automatic language detection with cookie fallback.

Quick Start

Install and configure react-i18next with i18next-http-backend and i18next-browser-languagedetector, set a sensible fallback language and supported languages, place JSON namespace files under public/locales/<lng>, and import the i18n initializer before rendering the app.

Frequently Asked Questions about i18n-react-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up i18n in a React Vite SPA?

To set up i18n in a React Vite SPA, configure react-i18next with i18next-http-backend and i18next-browser-languagedetector to load namespaces from public locales and detect user language. Import the i18n initializer before rendering the app.

How do I handle plurals and gender selects in react-i18next?

Handle plurals and gender selects in react-i18next by using native plural suffixes or adding the optional i18next-icu plugin for complex MessageFormat cases like advanced plurals and gender selects.

Does react-i18next support RTL layout and locale-aware formatting?

Yes, react-i18next supports RTL layout and locale-aware formatting by using the browser Intl API for dates, numbers, and currency, and applying logical CSS properties or document dir toggling for reliable RTL support.

What is the best way to load translation files in a Vite single-page application?

The best way to load translation files in a Vite SPA is using i18next-http-backend to fetch namespace-separated JSON files placed under the public/locales/<lng> directory.

Can I use ICU MessageFormat with react-i18next for complex translations?

Yes, you can use ICU MessageFormat with react-i18next by integrating the optional i18next-icu plugin, which enables advanced pluralization and gender select features.

How does language detection work in a Vite SPA using i18next-browser-languagedetector?

Language detection in a Vite SPA using i18next-browser-languagedetector works by automatically identifying the user's language and applying a sensible fallback language to ensure content is always displayed.