i18n

Originally fromlobehub/lobe-chat
Installation
Summary

Internationalization setup for React apps using react-i18next with flat dot-notation keys.

  • Use flat key structure with dot notation (e.g., feature.context.action) in src/locales/default/ files; never edit JSON files in locales/
  • Support dynamic parameters via {{variableName}} syntax and access translations in components with useTranslation() hook
  • Run pnpm i18n to auto-generate translations for all languages; manually translate zh-CN and en-US files for dev preview
  • Common namespaces include common, chat, and setting; avoid key conflicts by ensuring parent keys don't duplicate child key prefixes
SKILL.md

LobeHub Internationalization Guide

  • Default language: English (en-US)
  • Framework: react-i18next
  • Only edit files in src/locales/default/ - Never edit JSON files in locales/
  • Run pnpm i18n to 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': '已连接',
};
Related skills

More from lobehub/lobehub

Installs
1.2K
Repository
lobehub/lobehub
GitHub Stars
77.4K
First Seen
Jan 27, 2026