i18n

Manages react-i18next locale keys, namespaces, and translation workflows for LobeChat.

Updated Jan 27, 2026
One-click install
npx skills add https://github.com/SmallAi-API/smaihub --skill i18n-smallai-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: i18n
Source: https://github.com/SmallAi-API/smaihub/tree/main/.agents/skills/i18n
Command: npx skills add https://github.com/SmallAi-API/smaihub --skill i18n-smallai-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding user-facing strings to a react-i18next project requires consistent key naming, correct namespace placement, and coordination with automated translation pipelines, which is error-prone without clear conventions. ## Core Features & Use Cases - Key Naming Conventions: Enforces flat dot-notation keys like feature.context.action and {{variable}} interpolation, avoiding nested objects and key conflicts. - Namespace Workflow: Guides adding keys to packages/locales/src/default/, exporting namespaces, and previewing en-US/zh-CN translations manually. - Translation Pipeline Coordination: Clarifies when to rely on the daily auto-i18n.yml workflow versus running bun run i18n manually. - Use Case: When adding a new settings panel, use this Skill to create properly named keys in the setting namespace, wire up useTranslation in the component, and let the automated workflow handle remaining locales. ## Quick Start Ask the assistant to add a new translated string for a feature using the i18n conventions and show how to reference it with useTranslation.

Frequently Asked Questions about i18n

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

FAQPage Schema
How do I add a new translation key in react-i18next?

Add the key to the appropriate namespace file in packages/locales/src/default/ using flat dot notation like 'feature.context.action', then export the namespace from index.ts. Reference it in components with useTranslation and the t() function.

How do I use multiple namespaces with useTranslation?

Pass an array of namespaces to useTranslation, such as useTranslation(['common', 'chat']), then prefix keys with the namespace like t('common:save'). Single-namespace usage only needs the namespace name as a string.

Should I edit locale JSON files directly in the locales directory?

No, only edit files in packages/locales/src/default/. The JSON files in locales/ are generated, except hand-written en-US and zh-CN previews. Other locales are handled by the daily auto-i18n.yml workflow.

When should I run bun run i18n manually?

Run bun run i18n only when the branch needs translations immediately, since it is slow and requires an OPENAI_API_KEY. Otherwise, leave generated locales to the daily auto-i18n.yml workflow which opens an automated translation PR.

Why do react-i18next keys conflict with each other?

Conflicts occur when one key is a prefix of another, like 'clientDB.solve' and 'clientDB.solve.backup.title'. Resolve this by renaming the leaf key, for example 'clientDB.solve.action', so no key is both a value and a parent path.