i18n

Manage react-i18next translations and locale data in React applications.

81.4k|15.8k|Updated May 21, 2023
One-click install
npx skills add https://github.com/lobehub/lobehub --skill i18n-lobehub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: i18n
Source: https://github.com/lobehub/lobehub/tree/main/.agents/skills/i18n
Command: npx skills add https://github.com/lobehub/lobehub --skill i18n-lobehub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers manage translations and locale data for React applications using react-i18next, reducing duplication and ensuring consistent keys across languages.

Core Features & Use Cases

  • Centralized key management with flat dot-notation keys in src/locales/default
  • Locales generation and synchronization across components using react-i18next
  • Real-world use: add a new language and update translations with minimal boilerplate

Quick Start

Install dependencies, place translation keys under src/locales/default, and run pnpm i18n to generate all language bundles and types.

Frequently Asked Questions about i18n

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

FAQPage Schema
How do I manage React i18n translations and ensure consistent keys across languages?

To manage React i18n translations, place translation keys under src/locales/default and run pnpm i18n to generate all language bundles and types. This synchronizes locale data across UI components using react-i18next with minimal boilerplate.

What is the best way to add a new language to a React app using react-i18next?

The best way to add a new language in react-i18next is to place translation keys under src/locales/default and run pnpm i18n. This generates all language bundles and types, ensuring consistency across UI components with minimal boilerplate.

Do I need to use flat dot-notation keys for localization in React applications?

Yes, this workflow requires flat dot-notation keys for localization in React applications. Centralized key management with flat dot-notation keys in src/locales/default ensures consistent translations and reduces duplication across languages.

Can I use pnpm to generate locale bundles and types for React i18n?

Yes, you can use pnpm to generate locale bundles and types for React i18n. After placing translation keys under src/locales/default, running pnpm i18n generates all language bundles and types for consistent UI component localization.

Why does running pnpm i18n help with locale generation and component synchronization?

Running pnpm i18n helps with locale generation by automatically creating language bundles and types from translation keys in src/locales/default. This synchronizes locale data across React components, reducing manual boilerplate and preventing inconsistent keys.