lobehub avatar

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-code

Installs 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 in locales/ JSON (except en-US/zh-CN previews); generated locales change only through lobe-i18n, plus the key deletions described in Changing an existing key's English text
  • Leave generated locales to the daily auto-i18n.yml workflow by default; run bun run i18n manually 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

More from lobehub/lobe-chat

All 16

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs