i18n▌
lobehub/lobe-chat · updated Apr 8, 2026
Flat keys with dot notation (not nested objects):
LobeHub Internationalization Guide
- Default language: Chinese (zh-CN)
- Framework: react-i18next
- Only edit files in
src/locales/default/- Never edit JSON files inlocales/ - Run
pnpm i18nto generate translations (or manually translate zh-CN/en-US for dev preview)
Key Naming Convention
Flat keys with dot notation (not nested objects):
// ✅ Correct
export default {
'alert.cloud.action': '立即体验',
'sync.actions.sync': '立即同步',
'sync.status.ready': '已连接',
};
// ❌ Avoid nested objects
export default {
alert: { cloud: { action: '...' } },
};
Patterns: {feature}.{context}.{action|status}
Parameters: Use {{variableName}} syntax
'alert.cloud.desc': '我们提供 {{credit}} 额度积分',
Avoid key conflicts:
// ❌ Conflict
'clientDB.solve': '自助解决',
'clientDB.solve.backup.title': '数据备份',
// ✅ Solution
'clientDB.solve.action': '自助解决',
'clientDB.solve.backup.title': '数据备份',
Workflow
- Add keys to
src/locales/default/{namespace}.ts - Export new namespace in
src/locales/default/index.ts - For dev preview: manually translate
locales/zh-CN/{namespace}.jsonandlocales/en-US/{namespace}.json - Remind the user to run
pnpm i18nbefore creating PR — do NOT run it yourself (very slow)
Usage
import { useTranslation } from 'react-i18next';
const { t } = useTranslation('common');
t('newFeature.title');
t('alert.cloud.desc', { credit: '1000' });
// Multiple namespaces
const { t } = useTranslation(['common', 'chat']);
t('common:save');
Common Namespaces
Most used: common (shared UI), chat (chat features), setting (settings)
Others: auth, changelog, components, discover, editor, electron, error, file, hotkey, knowledgeBase, memory, models, plugin, portal, providers, tool, topic
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.8★★★★★33 reviews- ★★★★★Pratham Ware· Dec 12, 2024
We added i18n from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Zara Huang· Dec 12, 2024
i18n fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Hiroshi Patel· Oct 22, 2024
Keeps context tight: i18n is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Mateo Khan· Sep 17, 2024
Keeps context tight: i18n is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Luis Brown· Sep 5, 2024
i18n has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Yash Thakker· Sep 1, 2024
i18n reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Luis Chen· Aug 24, 2024
Useful defaults in i18n — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Dhruvi Jain· Aug 20, 2024
I recommend i18n for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Naina Abebe· Aug 8, 2024
Registry listing for i18n matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Valentina Huang· Jul 27, 2024
i18n fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
showing 1-10 of 33