nocobase-app-plugin-i18n
यह क्या करती है
यह स्किल NocoBase 3 application या plugin में अनुवादित लेख जोड़ने और बदलने में मार्गदर्शन करती है। यह उन डेवलपर्स के लिए है जिन्हें ऐप एक से ज़्यादा भाषाओं में बात करवाना है।
कब इस्तेमाल करें
- ✓जब आप कोई नया label, button या संदेश जोड़ें जो कई भाषाओं में दिखना चाहिए।
- ✓जब आपको सर्वर की errors या ईमेल प्राप्तकर्ता की भाषा में अनुवाद करने हों।
- ✓जब आप ऐसे package में नई भाषा जोड़ना चाहें जिसमें locale फ़ाइलें पहले से हैं।
Skill का लिंक
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-i18n/skills/nocobase-app-plugin-i18n/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप मेरे NocoBase ऐप का नया Save button और error संदेश पुर्तगाली और स्पेनिश में अनुवाद कर सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI लेख को सही locale फ़ाइल और namespace में एक translation key के पीछे रखता है। फिर वह browser या सर्वर पर translation helpers के ज़रिए लेख दिखाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Goal
Put user-facing text behind a translation key correctly the first time: in the right file, under the right namespace, and in a way that survives a language switch.
Scope
- Wire locale files into a package that has none yet.
- Add a string to an application or a plugin and render it translated, in the browser or on the server.
- Throw an error that callers see in their own language, and translate mail or jobs for their recipient.
- Add a language to a package that already has locale files.
- Reword a plugin's copy from the application, without editing the plugin.
- Translate a menu or breadcrumb title.
Non-Goals
- Do not build a language picker.
useAppLocale()exists;app-template-defaultalready renders one inclient/layouts/components/language-switcher.tsx. - Do not add i18n machinery to an application. The plugin is registered by default, the client runtime is built by
createAppI18nRuntime, and the server's byI18nProvider. - Do not configure the list of languages. It is whatever the application's own
locales/index.tsdeclares; configuration names only the default,i18n.defaultLocale(overridden byAPP_DEFAULT_LOCALE). The@nocobase/app-plugin-i18nREADME covers that,useAppLocale(), the endpoints, anduseSyncServerLocale(), which the template shell already calls to keep the server's language in step with the browser's.
The one rule that decides everything
A namespace is a package name, and the namespace in scope follows the render tree.
An application's pages get the application's namespace; a plugin's pages get that plugin's, because the host wraps each contribution using the packageName it already records. So a component in its own package's routes translates with no namespace at all.
The exception is what most mistakes come from: a component a plugin exports for the application to render is in the application's scope, not its own. It has to name its namespace.
Procedure
Wiring locales into a package for the first time
A package has a client/locales/ and a server/locales/ tree, each with an en-US.ts, the other languages, and an index.ts mapping every language to a dynamic import:
// client/locales/index.ts, and server/locales/index.ts in the same shape
import type { LocaleLoaders } from '@nocobase/i18n';
const locales: LocaleLoaders = {
'en-US': () => import('./en-US.js'),
'zh-CN': () => import('./zh-CN.js'),
};
export default locales;
Import that module and pass it as locales, the same way on both sides:
// client/plugin.ts
import locales from './locales/index.js';
export default defineClientPlugin({
packageName: '@acme/app-plugin-orders',
locales,
routes,
});
// server/plugin.ts
import locales from './locales/index.js';
export default defineServerPlugin({
baseDir,
packageName: '@acme/app-plugin-orders',
locales,
});
Import it statically. Each language is already a separate dynamic import, so a language is loaded only when something needs it; deferring the map as well gains nothing. locales: () => import('./locales/index.js') is still accepted on both sides for code written that way.
Without this step every t() in the package renders its key. An application's own client/runtime.ts and server/runtime.ts pass their locales the same way.
Adding a string
- Find the package that owns the text. Application text goes in
client/locales/; a plugin's text goes in that plugin'sclient/locales/. - Add the key to
en-US.ts. The structure is written once: the type is derived from the value withLocaleResource<typeof enUS>, and other locales are annotated with it, which is what makes a typo a compile error. - Add the translation to every other locale file. A missing key falls back rather than breaking, so this can lag, and
typecheckreports it. - Render it with
useTranslationfrom@nocobase/i18n/client.
import { useTranslation } from '@nocobase/i18n/client';
const { t } = useTranslation();
t('actions.save');
Keys nest and are addressed with dots: t('trigger.types.schedule').
Naming translation keys
Use short semantic keys that describe the purpose of the text and stay valid when its wording changes. Use lower camelCase within each segment and dots for useful feature or context groups, such as files.uploadFailed or demo.pageDescription. A small namespace may use title directly. Do not use complete English sentences as keys or merely convert a sent
अक्सर पूछे जाने वाले सवाल
क्या यह भाषा चुनने का विकल्प जोड़ता है?
नहीं। ऐप template में यह पहले से है, और स्किल दूसरा विकल्प नहीं जोड़ती।
भाषाएँ कहाँ सूचीबद्ध होती हैं?
application की अपनी locales फ़ाइल में।
स्किल किस पर ध्यान देती है?
लेख को सही फ़ाइलों में translation keys के पीछे रखने पर, ताकि भाषा बदलने पर भी वह सही रहे।
जानकारी
लेखक का मूल विवरण
Use when adding or changing user-facing text in a NocoBase application or plugin: writing locale files, wiring a package's locales for the first time, translating a component or a menu title, naming a namespace, translating server responses, errors and outbound mail, or adding a language. Not for building page UI around the text (nocobase-app-development) or scaffolding a new plugin (nocobase-app-plugin-development); those Skills hand translation work here.
repo: nocobase/nocobase
लोकप्रियता
- GitHub स्टार
- 25k
- रैंकिंग में स्थान
- #10099
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
nocobase-app-development
25kयह आपके एजेंट को पूर्ण NocoBase 3 व्यावसायिक एप्लिकेशन के लिए पेज, routes, डेटा, अनुमतियाँ और टेस्ट बनाने में मदद करती है।
shadcn
25kयह आपके एजेंट को वेब प्रोजेक्ट में shadcn/ui कंपोनेंट खोजने, जोड़ने, ठीक करने और स्टाइल करने में मदद करती है, उनके आधिकारिक दस्तावेज़ और registries का उपयोग करके।
nocobase-app-plugin-development
25kयह आपके एजेंट को मौजूदा NocoBase 3 ऐप के भीतर plugins बनाने और उनकी देखभाल करने में मदद करती है, जिसमें server, client, database और registration के हिस्से शामिल हैं।
nocobase-app-upgrade
25kयह आपके एजेंट को NocoBase ऐप को नए template रिलीज़ तक अपग्रेड करने में मदद करती है, template के बदलाव लाते हुए आपका अपना काम बनाए रखते हुए।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।