nocobase-app-plugin-i18n

Adds and translates user-facing text in NocoBase applications and plugins using locale files and namespaces.

9|3|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/nocobase/nocobase3 --skill nocobase-app-plugin-i18n-nocobase
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nocobase-app-plugin-i18n
Source: https://github.com/nocobase/nocobase3/tree/main/packages/plugins/app-plugin-i18n/skills/nocobase-app-plugin-i18n
Command: npx skills add https://github.com/nocobase/nocobase3 --skill nocobase-app-plugin-i18n-nocobase

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Putting user-facing text behind translation keys in a NocoBase application involves several decisions that are easy to get wrong: which package owns the string, which namespace applies, how to translate labels registered before a language is known, and how to reword a plugin's copy without editing the plugin. This Skill encodes those rules so text is placed correctly the first time and survives a language switch. ## Core Features & Use Cases - Adding translated strings: Place keys in the correct package's client/locales/ files, render them with useTranslation from @nocobase/i18n/client, and keep every locale file in sync so typecheck catches missing keys. - Namespace and language management: Decide when a component must name its package namespace, use the APP_NS sentinel to reach application wording, and add a new language across client and server locale loaders. - Plugin text overrides and early-registered labels: Reword a plugin's copy from the application's locale file via overrides, and pass i18nNs with a key for refine resources registered before any locale resolves. - Use Case: You add a 'Save' action to a workflow plugin page. The Skill guides you to add the key to the plugin's en-US.ts, translate it in other locales, render it with t('actions.save'), and verify with pnpm typecheck and pnpm i18n:check. ## Quick Start Ask the assistant to add a new translated label to a NocoBase plugin page and register it in every locale file.

Frequently Asked Questions about nocobase-app-plugin-i18n

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a translated string to a NocoBase plugin?▼

Add the key to the plugin's client/locales/en-US.ts, add the translation to every other locale file, and render it with useTranslation from @nocobase/i18n/client. Missing keys fall back rather than break, and typecheck reports them.

When do I need to specify a namespace in useTranslation?▼

Specify a namespace only when a component renders outside its own package's routes, or when deliberately reaching for the application's wording via the APP_NS sentinel. Components in their own package's routes translate with no namespace.

How do I add a new language to a NocoBase application?▼

Copy en-US.ts to the new locale, annotate it with the exported type, translate the values, and register the loader in locales/index.ts. Add it to both client and server locale lists in every package that ships locales.

How do I change a plugin's wording without editing the plugin?▼

Add an overrides entry keyed by the plugin's package name in the application's locale file. Overrides apply after every namespace registers, so the application always wins and plugin upgrades do not erase the change.

Why does my translated text not change when I switch language?▼

A string that does not change is still a literal somewhere, or the label was registered without i18nNs so it renders as-is. Run pnpm i18n:check and confirm the key exists in every locale file.

Why does t() render the key instead of text in a focused test?▼

A component rendered on its own in a test has no i18n runtime mounted, so t('a.b') renders as its key. Pass a defaultValue such as t('a.b', { defaultValue: 'Save' }) to keep output readable.