
I18n
Handles react-i18next internationalization for LobeHub projects using a flat-key convention like `feature.context.action` instead of nested objects. Kicks in when you're adding user-facing strings, creating locale keys, or working with `useTranslation` hooks. The workflow is strict: edit only the TypeScript files in `src/locales/default/`, then run `pnpm i18n` to generate translations. It covers the full cycle from key naming to avoiding conflicts (don't use `clientDB.solve` as both a string and a prefix) to interpolation syntax with double curly braces. Opinionated but practical if you're working in the LobeHub ecosystem where consistency matters more than flexibility.
- skills.sh installs
- 1.3K
- GitHub stars
- 79.8K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add lobehub/lobe-chat --skill i18n --agent claude-codeInstalls into .claude/skills of the current project.
Files
LobeHub Internationalization Guide
- Default language: English (en-US)
- Framework: react-i18next
- Only edit files in
packages/locales/src/default/- Never hand-write translations inlocales/JSON (except en-US/zh-CN previews); generated locales change only throughlobe-i18n, plus the key deletions described in Changing an existing key's English text - Leave generated locales to the daily
auto-i18n.ymlworkflow by default; runbun run i18nmanually only when they are needed immediately
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': '数据备份',
Sponsors
Details
- Repository
- github.com/lobehub/lobe-chat
- First seen
- May 16, 2026