\n\n\n```\n\n \n \n\nTo use plural content in Svelte components, retrieve it via the `useIntlayer` hook and call it with a count. The store is accessed with `$`. Here's an example:\n\n```svelte fileName=\"**/*.svelte\"\n\n\n
\n

{$content.totalOpenings(count)}

\n
\n```\n\n
\n \n\nTo use plural content in Preact components, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"preact\";\nimport { useIntlayer } from \"preact-intlayer\";\n\nconst OpeningsComponent: FC<{ count: number }> = ({ count }) => {\n const { totalOpenings } = useIntlayer(\"total_openings\");\n\n return (\n
\n

{totalOpenings(count)}

\n
\n );\n};\n\nexport default OpeningsComponent;\n```\n\n
\n \n\nTo use plural content in SolidJS components, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { Component } from \"solid-js\";\nimport { useIntlayer } from \"solid-intlayer\";\n\nconst OpeningsComponent: Component<{ count: number }> = (props) => {\n const { totalOpenings } = useIntlayer(\"total_openings\");\n\n return (\n
\n

{totalOpenings(props.count)}

\n
\n );\n};\n\nexport default OpeningsComponent;\n```\n\n
\n \n\nTo use plural content in Angular components, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```typescript fileName=\"app.component.ts\" codeFormat=\"typescript\"\nimport { Component, Input } from \"@angular/core\";\nimport { useIntlayer } from \"angular-intlayer\";\n\n@Component({\n selector: \"app-openings\",\n template: `\n
\n

{{ content().totalOpenings(count) }}

\n
\n `,\n})\nexport class OpeningsComponent {\n @Input() count!: number;\n\n content = useIntlayer(\"total_openings\");\n}\n```\n\n
\n \n\nTo use plural content with `vanilla-intlayer`, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```typescript fileName=\"**/*.ts\" codeFormat={[\"typescript\", \"esm\"]}\nimport { installIntlayer, useIntlayer } from \"vanilla-intlayer\";\n\ninstallIntlayer();\n\nconst content = useIntlayer(\"total_openings\").onChange((newContent) => {\n document.getElementById(\"openings\")!.textContent =\n newContent.totalOpenings(5);\n});\n\n// Initial render\ndocument.getElementById(\"openings\")!.textContent = content.totalOpenings(5);\n```\n\n \n\n## Wann man `plural` vs `enu` verwendet\n\n\n \n\nTo use plural content inside a React component, retrieve it via the `useIntlayer` hook and call it with a count. The active locale and the count are combined to pick the matching CLDR category.\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"react\";\nimport { useIntlayer } from \"react-intlayer\";\n\nconst OpeningsComponent: FC<{ count: number }> = ({ count }) => {\n const { totalOpenings } = useIntlayer(\"total_openings\");\n\n return (\n
\n

{totalOpenings(count)}

\n
\n );\n};\n\nexport default OpeningsComponent;\n```\n\n
\n \n\nTo use plural content in Next.js Client Components, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\n\"use client\";\n\nimport type { FC } from \"react\";\nimport { useIntlayer } from \"next-intlayer\";\n\nconst OpeningsComponent: FC<{ count: number }> = ({ count }) => {\n const { totalOpenings } = useIntlayer(\"total_openings\");\n\n return (\n
\n

{totalOpenings(count)}

\n
\n );\n};\n\nexport default OpeningsComponent;\n```\n\n
\n \n\nTo use plural content in Vue components, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```vue fileName=\"**/*.vue\"\n\n\n\n```\n\n \n \n\nTo use plural content in Svelte components, retrieve it via the `useIntlayer` hook and call it with a count. The store is accessed with `$`. Here's an example:\n\n```svelte fileName=\"**/*.svelte\"\n\n\n
\n

{$content.totalOpenings(count)}

\n
\n```\n\n
\n \n\nTo use plural content in Preact components, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"preact\";\nimport { useIntlayer } from \"preact-intlayer\";\n\nconst OpeningsComponent: FC<{ count: number }> = ({ count }) => {\n const { totalOpenings } = useIntlayer(\"total_openings\");\n\n return (\n
\n

{totalOpenings(count)}

\n
\n );\n};\n\nexport default OpeningsComponent;\n```\n\n
\n \n\nTo use plural content in SolidJS components, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { Component } from \"solid-js\";\nimport { useIntlayer } from \"solid-intlayer\";\n\nconst OpeningsComponent: Component<{ count: number }> = (props) => {\n const { totalOpenings } = useIntlayer(\"total_openings\");\n\n return (\n
\n

{totalOpenings(props.count)}

\n
\n );\n};\n\nexport default OpeningsComponent;\n```\n\n
\n \n\nTo use plural content in Angular components, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```typescript fileName=\"app.component.ts\" codeFormat=\"typescript\"\nimport { Component, Input } from \"@angular/core\";\nimport { useIntlayer } from \"angular-intlayer\";\n\n@Component({\n selector: \"app-openings\",\n template: `\n
\n

{{ content().totalOpenings(count) }}

\n
\n `,\n})\nexport class OpeningsComponent {\n @Input() count!: number;\n\n content = useIntlayer(\"total_openings\");\n}\n```\n\n
\n \n\nTo use plural content with `vanilla-intlayer`, retrieve it via the `useIntlayer` hook and call it with a count. Here's an example:\n\n```typescript fileName=\"**/*.ts\" codeFormat={[\"typescript\", \"esm\"]}\nimport { installIntlayer, useIntlayer } from \"vanilla-intlayer\";\n\ninstallIntlayer();\n\nconst content = useIntlayer(\"total_openings\").onChange((newContent) => {\n document.getElementById(\"openings\")!.textContent =\n newContent.totalOpenings(5);\n});\n\n// Initial render\ndocument.getElementById(\"openings\")!.textContent = content.totalOpenings(5);\n```\n\n \n
\n\n## Pluralinhalt einrichten\n\nUm Pluralinhalt in Ihrem Intlayer-Projekt einzurichten, erstellen Sie ein Inhaltsmodul, das den `plural`-Helfer verwendet. Die Kategorie `other` ist erforderlich und wird als Fallback verwendet, wenn ein Gebietsschema keine spezifischere Kategorie definiert.\n\n```typescript fileName=\"**/*.content.ts\" contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\nimport { plural, t, type Dictionary } from \"intlayer\";\n\nconst openingsContent = {\n key: \"total_openings\",\n content: {\n totalOpenings: t({\n en: plural({\n one: \"{{count}} opening\",\n other: \"{{count}} openings\",\n }),\n de: plural({\n one: \"{{count}} Stelle\",\n other: \"{{count}} Stellen\",\n }),\n }),\n },\n} satisfies Dictionary;\n\nexport default openingsContent;\n```\n\n```json fileName=\"**/*.content.json\" contentDeclarationFormat=\"json\"\n{\n \"$schema\": \"https://intlayer.org/schema.json\",\n \"key\": \"total_openings\",\n \"content\": {\n \"totalOpenings\": {\n \"nodeType\": \"translation\",\n \"translation\": {\n \"en\": {\n \"nodeType\": \"plural\",\n \"plural\": {\n \"one\": \"{{count}} opening\",\n \"other\": \"{{count}} openings\"\n }\n },\n \"de\": {\n \"nodeType\": \"plural\",\n \"plural\": {\n \"one\": \"{{count}} Stelle\",\n \"other\": \"{{count}} Stellen\"\n }\n }\n }\n }\n }\n}\n```\n\n> Die unterstützten Kategorien sind `zero`, `one`, `two`, `few`, `many`, `other`. Sie müssen nur die Kategorien deklarieren, die Ihre Zielsprache verwendet – Intlayer fällt auf `other` zurück, wenn keine spezifische Kategorie passt.\n>\n> Der Platzhalter `{{count}}` wird automatisch durch die Anzahl ersetzt, die Sie zur Laufzeit übergeben. Sie können auch andere Platzhalter einschließen (siehe [Benutzerdefinierte Platzhalter](#custom-placeholders) unten).\n\n## Pluralinhalt mit React Intlayer verwenden\n\nUm Pluralinhalt in einer React-Komponente zu verwenden, rufen Sie ihn über den Hook `useIntlayer` ab und rufen Sie ihn mit einer Anzahl auf. Das aktive Gebietsschema und die Anzahl werden kombiniert, um die passende CLDR-Kategorie auszuwählen.\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"react\";\nimport { useIntlayer } from \"react-intlayer\";\n\nconst OpeningsComponent: FC<{ count: number }> = ({ count }) => {\n const { totalOpenings } = useIntlayer(\"total_openings\");\n\n return (\n
\n {/* Auf Englisch: */}\n {/* count=0 → \"0 openings\" (other) */}\n {/* count=1 → \"1 opening\" (one) */}\n {/* count=2 → \"2 openings\" (other) */}\n {/* count=21 → \"21 openings\" (other) */}\n

{totalOpenings(count)}

\n
\n );\n};\n\nexport default OpeningsComponent;\n```\n\nSie können die zurückgegebene Funktion auf zwei äquivalente Arten aufrufen:\n\n```tsx\ntotalOpenings(21); // Kurzform: nur Anzahl\ntotalOpenings({ count: 21 }); // explizite Form\n```\n\n## Benutzerdefinierte Platzhalter\n\nPlural-Zeichenfolgen können andere Platzhalter als `{{count}}` enthalten. Übergeben Sie diese in der Objektform zusammen mit `count`:\n\n```typescript fileName=\"**/*.content.ts\" contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\nimport { plural, type Dictionary } from \"intlayer\";\n\nconst inboxContent = {\n key: \"inbox_summary\",\n content: {\n summary: plural({\n one: \"{{name}}, du hast {{count}} neue Nachricht\",\n other: \"{{name}}, du hast {{count}} neue Nachrichten\",\n }),\n },\n} satisfies Dictionary;\n\nexport default inboxContent;\n```\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nconst { summary } = useIntlayer(\"inbox_summary\");\n\nsummary({ count: 1, name: \"Alice\" });\n// → \"Alice, du hast 1 neue Nachricht\"\n\nsummary({ count: 7, name: \"Alice\" });\n// → \"Alice, du hast 7 neue Nachrichten\"\n```\n\n## CLDR-Kategorien auf einen Blick\n\nVerschiedene Sprachen verwenden unterschiedliche Teilmengen der CLDR-Kategorien. Einige häufige Fälle:\n\n| Sprache | Verwendete Kategorien |\n| ---------------------- | -------------------------------------------- |\n| Englisch (`en`) | `one`, `other` |\n| Französisch (`fr`) | `one`, `many`, `other` |\n| Russisch (`ru`) | `one`, `few`, `many`, `other` |\n| Polnisch (`pl`) | `one`, `few`, `many`, `other` |\n| Arabisch (`ar`) | `zero`, `one`, `two`, `few`, `many`, `other` |\n| Japanisch / Chinesisch | nur `other` |\n\nSie müssen sich das nicht merken – deklarieren Sie die Kategorien, für die Sie Übersetzungen haben, und Intlayer wird bei Bedarf auf `other` zurückgreifen.\n\n## Einschränkung\n\nIm Gegensatz zu anderen Knoten kann der `plural`-Knoten noch nicht mit untergeordneten Knoten verschachtelt werden.\n\nBeispiel:\n\nGültig:\n\n```ts\n totalOpenings: t({\n en: plural({\n one: \"{{count}} opening\",\n other: \"{{count}} openings\",\n }),\n fr: plural({\n one: \"{{count}} offre\",\n other: \"{{count}} offres\",\n }),\n }),\n```\n\nUngültig:\n\n```ts\ntotalOpenings: plural({\n one: t({\n en: \"{{count}} opening\",\n fr: \"{{count}} offre\",\n }),\n other: t({\n en: \"{{count}} openings\",\n fr: \"{{count}} offres\",\n }),\n}),\n```\n\n## Zusätzliche Ressourcen\n\nWeitere detaillierte Informationen zur Konfiguration und Verwendung finden Sie in den folgenden Ressourcen:\n\n- [Dokumentation zur Aufzählung (Enumeration)](/de/doc/concept/content/enumeration)\n- [Dokumentation zur Einfügung (Insertion)](/de/doc/concept/content/insertion)\n- [Intlayer CLI Dokumentation](/de/doc/concept/cli)\n- [React Intlayer Dokumentation](/de/doc/environment/create-react-app)\n- [Next Intlayer Dokumentation](/de/doc/environment/nextjs/15)\n\nDiese Ressourcen bieten weitere Einblicke in die Einrichtung und Verwendung von Intlayer in verschiedenen Umgebungen und Frameworks.\n","description":"Erfahren Sie, wie Sie sprachabhängige Pluralinhalte (CLDR-basiert) in Ihrer mehrsprachigen Website deklarieren und verwenden. Folgen Sie den Schritten in dieser Online-Dokumentation, um Ihr Projekt in wenigen Minuten einzurichten.","url":"https://intlayer.org/de/doc/concept/content/plural","datePublished":"2026-05-04","dateModified":"2026-05-04","version":"8.8.0","keywords":"Plural, Pluralisierung, CLDR, Internationalisierung, Dokumentation, Intlayer, Next.js, JavaScript, React","license":"https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE","audience":{"@type":"Audience","audienceType":"Entwickler, Inhaltsmanager"}}
    Autor:
    Erstellung:2026-05-04Letzte Aktualisierung:2026-05-04

    Pluralinhalt / Plural in Intlayer

    Wie Plural funktioniert

    To use plural content inside a React component, retrieve it via the useIntlayer hook and call it with a count. The active locale and the count are combined to pick the matching CLDR category.

    **/*.tsx
    import type { FC } from "react";
    import { useIntlayer } from "react-intlayer";
    
    const OpeningsComponent: FC<{ count: number }> = ({ count }) => {
    const { totalOpenings } = useIntlayer("total_openings");
    
    return (
      <div>
        <p>{totalOpenings(count)}</p>
      </div>
    );
    };
    
    export default OpeningsComponent;

    Wann man plural vs enu verwendet

    To use plural content inside a React component, retrieve it via the useIntlayer hook and call it with a count. The active locale and the count are combined to pick the matching CLDR category.

    **/*.tsx
    import type { FC } from "react";
    import { useIntlayer } from "react-intlayer";
    
    const OpeningsComponent: FC<{ count: number }> = ({ count }) => {
    const { totalOpenings } = useIntlayer("total_openings");
    
    return (
      <div>
        <p>{totalOpenings(count)}</p>
      </div>
    );
    };
    
    export default OpeningsComponent;

    Pluralinhalt einrichten

    Um Pluralinhalt in Ihrem Intlayer-Projekt einzurichten, erstellen Sie ein Inhaltsmodul, das den plural-Helfer verwendet. Die Kategorie other ist erforderlich und wird als Fallback verwendet, wenn ein Gebietsschema keine spezifischere Kategorie definiert.

    **/*.content.ts
    import { plural, t, type Dictionary } from "intlayer";
    
    const openingsContent = {
      key: "total_openings",
      content: {
        totalOpenings: t({
          en: plural({
            one: "{{count}} opening",
            other: "{{count}} openings",
          }),
          de: plural({
            one: "{{count}} Stelle",
            other: "{{count}} Stellen",
          }),
        }),
      },
    } satisfies Dictionary;
    
    export default openingsContent;

    Die unterstützten Kategorien sind zero, one, two, few, many, other. Sie müssen nur die Kategorien deklarieren, die Ihre Zielsprache verwendet – Intlayer fällt auf other zurück, wenn keine spezifische Kategorie passt.

    Der Platzhalter {{count}} wird automatisch durch die Anzahl ersetzt, die Sie zur Laufzeit übergeben. Sie können auch andere Platzhalter einschließen (siehe Benutzerdefinierte Platzhalter unten).

    Pluralinhalt mit React Intlayer verwenden

    Um Pluralinhalt in einer React-Komponente zu verwenden, rufen Sie ihn über den Hook useIntlayer ab und rufen Sie ihn mit einer Anzahl auf. Das aktive Gebietsschema und die Anzahl werden kombiniert, um die passende CLDR-Kategorie auszuwählen.

    **/*.tsx
    import type { FC } from "react";
    import { useIntlayer } from "react-intlayer";
    
    const OpeningsComponent: FC<{ count: number }> = ({ count }) => {
      const { totalOpenings } = useIntlayer("total_openings");
    
      return (
        <div>
          {/* Auf Englisch:                                  */}
          {/*  count=0  → "0 openings"   (other)           */}
          {/*  count=1  → "1 opening"    (one)             */}
          {/*  count=2  → "2 openings"   (other)           */}
          {/*  count=21 → "21 openings"  (other)           */}
          <p>{totalOpenings(count)}</p>
        </div>
      );
    };
    
    export default OpeningsComponent;

    Sie können die zurückgegebene Funktion auf zwei äquivalente Arten aufrufen:

    tsx
    totalOpenings(21); // Kurzform: nur AnzahltotalOpenings({ count: 21 }); // explizite Form

    Benutzerdefinierte Platzhalter

    Plural-Zeichenfolgen können andere Platzhalter als {{count}} enthalten. Übergeben Sie diese in der Objektform zusammen mit count:

    **/*.content.ts
    import { plural, type Dictionary } from "intlayer";
    
    const inboxContent = {
      key: "inbox_summary",
      content: {
        summary: plural({
          one: "{{name}}, du hast {{count}} neue Nachricht",
          other: "{{name}}, du hast {{count}} neue Nachrichten",
        }),
      },
    } satisfies Dictionary;
    
    export default inboxContent;
    **/*.tsx
    const { summary } = useIntlayer("inbox_summary");
    
    summary({ count: 1, name: "Alice" });
    // → "Alice, du hast 1 neue Nachricht"
    
    summary({ count: 7, name: "Alice" });
    // → "Alice, du hast 7 neue Nachrichten"

    CLDR-Kategorien auf einen Blick

    Verschiedene Sprachen verwenden unterschiedliche Teilmengen der CLDR-Kategorien. Einige häufige Fälle:

    Sprache Verwendete Kategorien
    Englisch (en) one, other
    Französisch (fr) one, many, other
    Russisch (ru) one, few, many, other
    Polnisch (pl) one, few, many, other
    Arabisch (ar) zero, one, two, few, many, other
    Japanisch / Chinesisch nur other

    Sie müssen sich das nicht merken – deklarieren Sie die Kategorien, für die Sie Übersetzungen haben, und Intlayer wird bei Bedarf auf other zurückgreifen.

    Einschränkung

    Im Gegensatz zu anderen Knoten kann der plural-Knoten noch nicht mit untergeordneten Knoten verschachtelt werden.

    Beispiel:

    Gültig:

    ts
        totalOpenings: t({      en: plural({        one: "{{count}} opening",        other: "{{count}} openings",      }),      fr: plural({        one: "{{count}} offre",        other: "{{count}} offres",      }),    }),

    Ungültig:

    ts
    totalOpenings: plural({  one: t({    en: "{{count}} opening",    fr: "{{count}} offre",  }),  other: t({    en: "{{count}} openings",    fr: "{{count}} offres",  }),}),

    Zusätzliche Ressourcen

    Weitere detaillierte Informationen zur Konfiguration und Verwendung finden Sie in den folgenden Ressourcen:

    Diese Ressourcen bieten weitere Einblicke in die Einrichtung und Verwendung von Intlayer in verschiedenen Umgebungen und Frameworks.