شعار Dust I18n

Dust I18n

مؤسسةشائع
dust-tt
dust-i18n

اجعل سلاسل واجهة المستخدم في front وsparkle قابلة للترجمة باستخدام Lingui. استخدم ذلك عند إضافة نصوص مرئية للمستخدم أو تعديلها في شيفرة React ضمن `front/components` أو `front/hooks` أو `front/lib`، أو في مكوّنات `sparkle/src`، وعند تغليف السلاسل الحالية بغرض ترجمتها، أو مراجعة تغييرات نصوص واجهة المستخدم.

Add to TypingMind

نظرة عامة

الناشرdust-tt
المستودعdust
اسم المهارةdust-i18n
النجوم
1.5K
التفريعات
370
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

  • مفتوحة المصدر

    نشرها dust-tt على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Dust I18n في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/dust-tt/dust/tree/main/.claude/skills/dust-i18n
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dust-tt/dust.git /tmp/dust
mkdir -p .claude/skills
cp -r /tmp/dust/.claude/skills/dust-i18n .claude/skills/dust-i18n
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Dust I18n في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Dust I18n تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Dust I18n بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Translatable UI strings (Lingui)

The product UI is localised with Lingui. The English text is the message: there are no hand-written ids. The supported locales are SUPPORTED_LOCALES in front/types/locale.ts. Each source directory using Lingui has its own catalog per CATALOG_LOCALES entry, at front/locales/{locale}/<directory relative to front>/messages.po, holding the messages of the files directly in that directory (en-GB uses the en-US messages with British date and number formatting). Code imports front/locales/{locale}.catalog, which compiles to all of the locale's catalogs merged together.

A file that already uses Lingui MUST keep every user-visible string translated. New UI code SHOULD be written translated. After changing strings, follow Workflow and translate with the dust-translate skill in the same PR.

Which macro

Where the text isUseImport
JSX children<Trans>Save changes</Trans>import { Trans } from "@lingui/react/macro"
String props, toasts, aria-label, placeholderconst { t } = useLingui(); then t`Search agents` import { useLingui } from "@lingui/react/macro"
Module-level constants (labels maps, option lists)msg`Admin` at module level, t(LABELS[role]) at renderimport { msg } from "@lingui/core/macro"
Countst`${count} ${plural(count, { one: "agent", other: "agents" })}` or <Plural>@lingui/core/macro / @lingui/react/macro
Zod schema messagesgetXSchema(t) factory, see Zod schemasimport { msg } from "@lingui/core/macro"
Short ambiguous wordst({ message: "Open", context: "verb, button label" })

Rules:

  • One message per sentence. Inline markup stays inside one <Trans>: <Trans>Invite <strong>{name}</strong> to the <Link to={url}>workspace</Link>.</Trans>.
  • Interpolate with placeholders, never concatenate: t`Delete ${name}?` not "Delete " + name + "?".
  • Placeholders must be simple identifiers (${name}, not ${user.name}), so translators see a meaningful name: hoist expressions into a const first.
  • No pluralize(), (s) suffixes or ternaries between English words: use plural/select.
  • t from useLingui() only works inside components and hooks. Module-level code uses msg.
  • Translate descriptors with t(descriptor), not i18n._(descriptor): i18n keeps the same reference when the locale changes, so memos depending on it would not recompute.
  • Write English in sentence case. Do not apply CSS uppercase/capitalize to translated text.
  • Format dates and numbers with the active locale (i18n.locale), never a hardcoded "en-US".

Zod schemas

A schema with translated messages is a plain factory taking t. Write messages as t(msg`...`) (the t`...` shorthand only works inside components and hooks), and memoize at the call site so the schema is rebuilt only when the locale changes:

ts
export function getXFormSchema(t: (descriptor: MessageDescriptor) => string) {
  return z.object({ name: z.string().min(1, t(msg`Name is required.`)) });
}
export type XFormValues = z.infer<ReturnType<typeof getXFormSchema>>;

// In the component:
const { t } = useLingui();
const schema = useMemo(() => getXFormSchema(t), [t]);

Compose factories by passing t down (getParentSchema(t) calls getChildSchema(t)). Do not wrap a schema in a useXSchema() hook, and do not pass pre-translated message objects. Tests call the factory directly with (descriptor) => i18n._(descriptor).

Never translate

  • Text sent to models: front/lib/actions/**, MCP tool and server descriptions, skill and agent definitions, zod .describe().
  • Server code (front-api/**, front/lib/api/**, front/temporal/**): Lingui imports there fail lint (noClientImportsInServer). Servers return error codes; the UI translates them.
  • Poke (front/components/poke/**), logs, analytics event names, keyboard symbols (⌘, ↵), product and brand names on their own (Dust, Slack), user-generated content.

Where translated components can render

Lingui components need an I18nProvider. Every front-spa entry mounts one at its root (e.g. front-spa/src/app/App.tsx); the poke, share, oauth and email entries render in en-US. The browser extension (extension/) mounts one in each platform app and compiles the macros in its webpack build (extension/config/webpack_lingui.ts). It always renders en-US.

In front tests, render and renderHook from @testing-library/react already wrap the tree in an I18nProvider (see front/vite.i18nSetup.ts), around any wrapper the test passes, and the locale is reset to en-US after each test. Do not add an I18nProvider in tests. To assert a translation, activate the locale inside act:

tsx
import { i18n, loadCatalog } from "@app/lib/i18n/i18n";

const messages = await loadCatalog("fr-FR");
act(() => i18n.loadAndActivate({ locale: "fr-FR", messages }));
render(<MyComponent />);

Sparkle components

Sparkle (@dust-tt/sparkle) is translated with the same macros and rules, but has its own Lingui setup, independent of front's (contracts in sparkle/src/CONTRACTS):

  • sparkle/lingui.config.ts resolves the macros to sparkle's own useLingui and Trans (sparkle/src/lib/i18n/), which read sparkle's context, not the consumer's. Outside sparkle/src/lib/i18n/, never import useLingui, Trans, I18nProvider or i18n from @lingui/react or @lingui/core: they would read front's instance, which has no sparkle messages.
  • Sparkle has one catalog per locale, sparkle/src/locales/{locale}/messages.po, and stories (sparkle/src/stories/) are not extracted: do not translate them.
  • For text a consumer may override, make the prop optional with no default and fall back at render: {label ?? t`Load more`}. A destructuring default cannot call t.
  • The locale comes from SparkleI18nProvider. Without it, sparkle renders en-US (marketing, viz, the extension). Front mounts SparkleLocaleProvider (front/components/app/) at every app root that mounts UserLocaleSync, and front tests already wrap in it. Sparkle's locale is a catalog locale (en-GB renders as en-US).
  • SPARKLE_CATALOG_LOCALES (sparkle/src/lib/i18n/locales.ts) must contain every front CATALOG_LOCALES entry: adding a catalog locale to front means adding it to sparkle too.

Slack bot (connectors)

The Slack bot (connectors/src/connectors/slack) has its own catalog in connectors/locales/{locale}/messages.po, extracted by the same lingui.config.ts. Connectors runs under tsx, which cannot compile Lingui macros, so the rules differ from front:

  • Never import @lingui/*/macro. Write i18n._("Answered by *{agentName}*", { agentName }): the English text is the message id, and lingui extract only collects a string literal passed to a callee named i18n._.
  • i18n is the I18n of the recipient, from getSlackI18nForUser (or …ForUserId, …ForTeamUser) in connectors/src/connectors/slack/lib/user_locale.ts, passed down as a parameter. It resolves the locale chosen in Dust, then the Slack locale, then the workspace locale (en-US while the localisation flag is off). Never use the global i18n of @lingui/core: the bot answers users with different locales concurrently.
  • The locales are a copy of front/types/locale.ts in connectors/src/types/locale.ts: edit both (i18n:check fails when they differ).
  • Same never-translate rules as front: text sent to the Dust API or to models (content fragments, message content), logs, agent-authored content.

See connectors/src/connectors/slack/CONTRACTS.

Workflow

  1. Wrap the strings with the macros above.
  2. From the repository root (or sparkle/ for sparkle code), run npm run i18n:extract: it updates every catalog and removes obsolete messages.
  3. Fill the new empty msgstr entries with the dust-translate skill.
  4. Run npm run i18n:check from the same directory (also run in CI): it fails on stale catalogs and missing translations.
  5. Commit the code and the catalogs together.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Dust I18n؟

اجعل سلاسل واجهة المستخدم في front وsparkle قابلة للترجمة باستخدام Lingui. استخدم ذلك عند إضافة نصوص مرئية للمستخدم أو تعديلها في شيفرة React ضمن `front/components` أو `front/hooks` أو `front/lib`، أو في مكوّنات `sparkle/src`، وعند تغليف السلاسل الحالية بغرض ترجمتها، أو مراجعة تغييرات نصوص واجهة المستخدم.

لماذا تستخدم Dust I18n على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Dust I18n عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Dust I18n في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/dust-tt/dust/tree/main/.claude/skills/dust-i18n. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Dust I18n؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Dust I18n؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Dust I18n معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Dust I18n مجانية؟

نعم. نشرها dust-tt على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇