\n\n \n ```\n\n \n \n ```svelte fileName=\"ProductCopy.svelte\" contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\n \n\n {#if $content}\n

{$content.description}

\n {/if}\n ```\n\n
\n \n ```tsx fileName=\"ProductCopy.tsx\" contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\n import { useIntlayer } from \"preact-intlayer\";\n\n export const ProductCopy = ({\n productId,\n userId,\n }: {\n productId: string;\n userId: string;\n }) => {\n const content = useIntlayer(\"product-copy\", { id: productId, userId });\n // يضمن TypeScript توفير كل من `id` و `userId`.\n\n if (!content) return null;\n\n return

{content.description}

;\n };\n ```\n\n
\n \n ```tsx fileName=\"ProductCopy.tsx\" contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\n import { useIntlayer } from \"solid-intlayer\";\n\n export const ProductCopy = (props: {\n productId: string;\n userId: string;\n }) => {\n const content = useIntlayer(\"product-copy\", { id: props.productId, userId: props.userId });\n // يضمن TypeScript توفير كل من `id` و `userId`.\n\n return (\n <>\n {content() &&

{content().description}

}\n \n );\n };\n ```\n\n
\n \n ```typescript fileName=\"product-copy.component.ts\" contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\n import { Component, Input, OnInit } from \"@angular/core\";\n import { useIntlayer } from \"angular-intlayer\";\n\n @Component({\n selector: \"app-product-copy\",\n template: `\n @if (content()) {\n

{{ content().description }}

\n }\n `,\n })\n export class ProductCopyComponent implements OnInit {\n @Input() productId!: string;\n @Input() userId!: string;\n\n content: any;\n\n ngOnInit() {\n this.content = useIntlayer(\"product-copy\", { id: this.productId, userId: this.userId });\n }\n }\n ```\n\n
\n \n ```javascript fileName=\"product-copy.js\"\n import { useIntlayer } from \"vanilla-intlayer\";\n\n const content = useIntlayer(\"product-copy\", {\n id: \"prod_abcd\",\n userId: \"user_123\"\n });\n\n if (content) {\n document.body.innerHTML = `

${content.description}

`;\n }\n ```\n\n
\n\n\n### مع تحديد لغة صريحة\n\n```tsx\nconst content = useIntlayer(\"product-copy\", {\n id: \"prod_abc\",\n userId: \"user_123\",\n locale: \"fr\",\n});\n```\n\n### حقل meta مفقود — خطأ وقت الترجمة\n\n```ts\n// خطأ في النوع: `userId` مفقود\nconst content = useIntlayer(\"product-copy\", { id: \"prod_abc\" });\n```\n\n## وضع التحميل\n\nعادة ما يتم تحميل السجلات الديناميكية بشكل كسول. قم بتعيين `importMode` في القاموس للتحكم في ذلك:\n\n```ts contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\nconst dictionary = {\n key: \"product-copy\",\n importMode: \"fetch\", // أو \"dynamic\"\n meta: { id: \"prod_abc\", userId: \"user_123\" },\n content: { … },\n} satisfies Dictionary;\n\nexport default dictionary;\n```\n\nانظر [تحسين الحزمة](/ar/doc/concept/bundle-optimization) لمعرفة التفاصيل حول الأوضاع `static` و `dynamic` و `fetch`.\n\n## حالات الاستخدام الشائعة\n\n- نسخة تسويقية لكل منتج تتم إدارتها في نظام إدارة المحتوى (CMS)\n- محتوى خاص بالمستخدم أو خاص بالحساب\n- أي محتوى يتم تعيينه بواسطة معرف تشغيل غير شفاف\n","description":"استخدم حقل meta في ملفات محتوى Intlayer للإعلان عن السجلات التي يديرها نظام إدارة المحتوى (CMS) والتي يتم جلبها في وقت التشغيل بواسطة معرف غير شفاف، مما يتيح محتوى ديناميكيًا قوي النوع بدون تعداد في وقت البناء.","url":"https://intlayer.org/ar/doc/concept/dynamic-records","datePublished":"2026-06-12","dateModified":"2026-06-12","version":"9.0.0","keywords":"السجلات الديناميكية, المحتوى الديناميكي, نظام إدارة المحتوى, محتوى وقت التشغيل, Intlayer, تدويل","license":"https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE","audience":{"@type":"Audience","audienceType":"المطورون ومديرو المحتوى"}}
    المؤلف:
    إنشاء:2026-06-12آخر تحديث:2026-06-12

    السجلات الديناميكية

    السجل الديناميكي (dynamic record) هو ملف محتوى لا يتم تحديد هويته بواسطة فهرس تسلسلي أو متغير مسمى، بل بواسطة مجموعة عشوائية من أزواج المفاتيح والقيم المعلنة في حقل meta. يستخدم Intlayer هذه الحقول كمحدد في وقت التشغيل، مما يتيح معالجة سجلات CMS، أو نسخ محددة للمستخدم، أو أي محتوى لا تُعرف مفاتيحه في وقت البناء.

    الإعلان عن السجلات الديناميكية

    product-copy.abc.content.ts
    import { t, type Dictionary } from "intlayer";
    
    const dictionary = {
      key: "product-copy",
      meta: {
        id: "prod_abc",
        userId: "user_123",
      },
      content: {
        name: t({ en: "Widget Pro", fr: "Widget Pro" }),
        description: t({ en: "The best widget.", fr: "Le meilleur widget." }),
      },
    } satisfies Dictionary;
    
    export default dictionary;
    product-copy.abcd.content.ts
    import { t, type Dictionary } from "intlayer";
    
    const dictionary = {
      key: "product-copy",
      meta: {
        id: "prod_abcd",
        userId: "user_123",
      },
      content: {
        name: t({ en: "Widget Lite", fr: "Widget Lite" }),
        description: t({ en: "A lighter option.", fr: "Une option plus légère." }),
      },
    } satisfies Dictionary;
    
    export default dictionary;

    استهلاك السجلات الديناميكية

    جميع حقول meta مطلوبة في المحدد. يؤدي حذف أي حقل إلى إرجاع null ويعد خطأ في TypeScript.

    ProductCopy.tsx
    import { useIntlayer } from "react-intlayer";
    
    export const ProductCopy = ({
      productId,
      userId,
    }: {
      productId: string;
      userId: string;
    }) => {
      const content = useIntlayer("product-copy", { id: productId, userId });
      // يضمن TypeScript توفير كل من `id` و `userId`.
    
      if (!content) return null;
    
      return <p>{content.description}</p>;
    };

    مع تحديد لغة صريحة

    tsx
    const content = useIntlayer("product-copy", {  id: "prod_abc",  userId: "user_123",  locale: "fr",});

    حقل meta مفقود — خطأ وقت الترجمة

    ts
    // خطأ في النوع: `userId` مفقودconst content = useIntlayer("product-copy", { id: "prod_abc" });

    وضع التحميل

    عادة ما يتم تحميل السجلات الديناميكية بشكل كسول. قم بتعيين importMode في القاموس للتحكم في ذلك:

    ts
    const dictionary = {
      key: "product-copy",
      importMode: "fetch", // أو "dynamic"
      meta: { id: "prod_abc", userId: "user_123" },
      content: { … },
    } satisfies Dictionary;
    
    export default dictionary;

    انظر تحسين الحزمة لمعرفة التفاصيل حول الأوضاع static و dynamic و fetch.

    حالات الاستخدام الشائعة

    • نسخة تسويقية لكل منتج تتم إدارتها في نظام إدارة المحتوى (CMS)
    • محتوى خاص بالمستخدم أو خاص بالحساب
    • أي محتوى يتم تعيينه بواسطة معرف تشغيل غير شفاف