Skip to content
cccskills
FreePublished on GitHubEnglish overview

i18n

Organize user-facing text for a react-i18next app by adding locale keys, choosing namespaces, and using interpolation. Follow the translation workflow, preview English and Chinese changes, and handle changed source text so generated translations do not remain stale.

OriginalShow the original description

Use for user-facing strings and react-i18next locale keys, namespaces, interpolation, translations or bun run i18n.

lobehub/lobehub83,509 stars(GitHub 83,509 + cccskills 0)

Run score Not tested

See how to install

Good for

  • Adding translated text to a react-i18next feature
  • Choosing keys and namespaces for interface strings
  • Updating translations after changing English source text
  • Generating locale files when translations are needed right away

Overview

What it does

This skill guides you through adding and managing user-facing text as translation keys in an app that uses react-i18next. It recommends flat, dot-separated keys with names that describe the feature, context, and purpose. It also covers {{variableName}} interpolation and using multiple namespaces. The workflow starts with English keys; when needed, you can update English and Chinese previews, then leave other languages to the automated translation workflow. It also explains what to do when an edited English string leaves already generated translations out of date.

When it helps

Use it when adding text for a new screen or feature, or when a team wants consistent key naming and namespace choices. It can also help when English source text changes and you need to understand how to reflect the change in other languages.

Example requests

  • “How do I add a translation key for the settings screen?”
  • “Suggest a key name and namespace for this screen text.”
  • “I changed an existing English string. How should I update its translations?”

Notes

Edits generally belong in packages/locales/src/default/. Translation generation with bun run i18n takes time and requires OPENAI_API_KEY. Generated files for other languages are normally updated by a daily automated workflow.

This overview was written by AI (OpenAI Codex) from the public SKILL.md. Check the original below for the exact behavior.

Document check

AI checked the SKILL.md for operations that need care and for setup requirements. The score comes only from actually running the skill (hands-on test).

SafetyAre sending data, deleting files, and running commands disclosed?
BPartly lackingIt includes deleting and regenerating locale keys, with case-specific conditions.
Easy setupDoes it need few tools or API keys, and are they documented?
BPartly lacking`bun run i18n` requires `OPENAI_API_KEY`; setup steps are not provided.

Not counted in the score. Rated by AI (OpenAI Codex) as of Oct 26, 2026. Treat it as a guide and read the original before installing.

Disagree? Request a re-evaluation

Tell us which point is wrong and why. No login needed. We will check it against the SKILL.md, redo the evaluation, and show the result here.

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

Files included (1)

  • SKILL.md3.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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': '数据备份',

// ✅ Solution
'clientDB.solve.action': '自助解决',
'clientDB.solve.backup.title': '数据备份',

Workflow

  1. Add keys to packages/locales/src/default/{namespace}.ts
  2. Export new namespace in packages/locales/src/default/index.ts
  3. For dev preview: manually translate locales/zh-CN/{namespace}.json and locales/en-US/{namespace}.json
  4. Leave all other locales to .github/workflows/auto-i18n.yml, which runs daily and opens an automated translation PR
  5. Run bun run i18n manually only when the branch needs those translations immediately; it is slow and requires OPENAI_API_KEY

Changing an existing key's English text

lobe-i18n (both the daily workflow and bun run i18n) only translates keys that are missing from a locale. It never re-translates a key whose English value changed, so editing an existing value leaves every generated locale on the old text indefinitely (e.g. expanded settingsSearch.tabKeywords.* stayed stale in 16 locales for weeks).

When a change alters an existing key's meaning or content (not just a typo), do one of:

  • Rename the key, so it is missing everywhere and gets translated fresh.
  • Re-translate it in the same PR: delete the key from every generated locales/*/{namespace}.json (all except en-US/zh-CN), run bun run i18n, and commit only those keys — the run also fills unrelated missing keys, which belong to the daily workflow PR.
  • If the stale translation is harmless until the daily run, delete the key from the generated locales so they fall back to English and the workflow re-translates it. Do not do this when the localized text is load-bearing (e.g. search keywords users type in their own language).

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

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

acceptance

FreeSummary

Use this skill to verify a delivery by exercising the real product through a suitable surface such as a CLI, web app, desktop app, or iOS Simulator. It helps create or find a verification plan, capture evidence, and publish an acceptance report.

  • Verifying a completed product change
  • Collecting screenshots or other evidence
  • Creating a verification plan and report
lobehub/lobehub83.5KUpdated Oct 26, 2026

Use this skill to add an AI model provider to LobeHub across runtime integration, model cards, settings, branding, documentation, and acceptance checks. It also covers provider documentation updates and distinguishes new providers from models added to an existing provider.

  • Integrating a new AI model provider into LobeHub
  • Updating setup or usage documentation for a provider
  • Checking whether a model needs a new provider integration
lobehub/lobehub83.5KUpdated Oct 26, 2026

add-setting-env

FreeSummary

Use this skill to add a server-side environment variable that sets a default for a user setting. It walks through validation, server configuration and store merging, plus updating the example environment file and self-hosting documentation.

  • Adding an environment variable for a setting default
  • Wiring a new setting domain into server config
  • Documenting a new variable for self-hosting
lobehub/lobehub83.5KUpdated Oct 26, 2026

Provides guidance for registering hooks around an agent’s execution steps, tool calls, human approvals, context compression, and sub-agent calls. Hooks can observe events, supply local mock tool results, or use webhooks to allow or deny tool results under configured policies.

  • Observing agent steps and tool errors
  • Mocking tool results during local execution
  • Requiring webhook decisions before or after a tool call
lobehub/lobehub83.5KUpdated Oct 26, 2026

agent-signal

FreeSummary

Build event-driven background workflows for agents by defining sources, interpreting them as signals, and running actions through policies. It also guides asynchronous handoffs, deduplication, scoped execution, completion receipts, and observability.

  • Adding a new event source to an agent workflow
  • Routing interpreted signals to concrete background actions
  • Enqueuing work for asynchronous processing
lobehub/lobehub83.5KUpdated Oct 26, 2026

Use this skill to run end-to-end acceptance checks for bot channels in real desktop chat apps. It drives apps such as Discord, Slack, Telegram, WeChat, Lark, and QQ to send a message, wait for a response, and capture the result.

  • Checking a bot response in a real Discord channel
  • Testing chat behavior through Slack or Telegram
  • Capturing a bot interaction in a native macOS app
lobehub/lobehub83.5KUpdated Oct 26, 2026

See all skills by lobehub

Report a problem with this skill