\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## Quando usar `plural` vs `enu`\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
{{ totalOpenings(count) }}
\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## Configurando Conteúdo Plural\n\nPara configurar o conteúdo plural no seu projeto Intlayer, crie um módulo de conteúdo que use o auxiliar `plural`. A categoria `other` é obrigatória e é usada como fallback quando uma localidade não define uma categoria mais específica.\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 pt: plural({\n one: \"{{count}} vaga\",\n other: \"{{count}} vagas\",\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 \"pt\": {\n \"nodeType\": \"plural\",\n \"plural\": {\n \"one\": \"{{count}} vaga\",\n \"other\": \"{{count}} vagas\"\n }\n }\n }\n }\n }\n}\n```\n\n> As categorias suportadas são `zero`, `one`, `two`, `few`, `many`, `other`. Você só precisa declarar as categorias que seu idioma de destino usa, o Intlayer volta para `other` quando nenhuma categoria específica corresponde.\n>\n> O marcador `{{count}}` é substituído automaticamente pela contagem que você passa em tempo de execução. Você também pode incluir outros marcadores (veja [Marcadores personalizados](#custom-placeholders) abaixo).\n\n## Usando Conteúdo Plural com React Intlayer\n\nPara usar conteúdo plural dentro de um componente React, recupere-o através do hook `useIntlayer` e chame-o com uma contagem. A localidade ativa e a contagem são combinadas para escolher a categoria CLDR correspondente.\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 );\n};\n\nexport default OpeningsComponent;\n```\n\nVocê pode chamar a função retornada de duas maneiras equivalentes:\n\n```tsx\ntotalOpenings(21); // atalho: apenas contagem\ntotalOpenings({ count: 21 }); // forma explícita\n```\n\n## Marcadores personalizados\n\nStrings plurais podem incluir marcadores diferentes de `{{count}}`. Passe-os na forma de objeto junto com `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}}, você tem {{count}} nova mensagem\",\n other: \"{{name}}, você tem {{count}} novas mensagens\",\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, você tem 1 nova mensagem\"\n\nsummary({ count: 7, name: \"Alice\" });\n// → \"Alice, você tem 7 novas mensagens\"\n```\n\n## Categorias CLDR em um relance\n\nDiferentes idiomas usam diferentes subconjuntos das categorias CLDR. Alguns casos comuns:\n\n| Idioma | Categorias usadas |\n| ---------------- | -------------------------------------------- |\n| Inglês (`en`) | `one`, `other` |\n| Francês (`fr`) | `one`, `many`, `other` |\n| Russo (`ru`) | `one`, `few`, `many`, `other` |\n| Polonês (`pl`) | `one`, `few`, `many`, `other` |\n| Árabe (`ar`) | `zero`, `one`, `two`, `few`, `many`, `other` |\n| Japonês / Chinês | apenas `other` |\n\nVocê não precisa memorizar isso, declare as categorias para as quais você tem traduções, e o Intlayer voltará para `other` quando necessário.\n\n## Limitação\n\nEm comparação com outros nós, o `plural` ainda não pode ser aninhado com nós filhos.\n\nExemplo:\n\nVálido:\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\nInválido:\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## Recursos Adicionais\n\nPara informações mais detalhadas sobre configuração e uso, consulte os seguintes recursos:\n\n- [Documentação de Enumeração](/pt/doc/concept/content/enumeration)\n- [Documentação de Inserção](/pt/doc/concept/content/insertion)\n- [Documentação da CLI do Intlayer](/pt/doc/concept/cli)\n- [Documentação do React Intlayer](/pt/doc/environment/create-react-app)\n- [Documentação do Next Intlayer](/pt/doc/environment/nextjs/15)\n\nEstes recursos oferecem mais insights sobre a configuração e o uso do Intlayer em vários ambientes e frameworks.\n","description":"Descubra como declarar e usar conteúdo plural sensível à localidade (baseado em CLDR) em seu site multilíngue. Siga as etapas nesta documentação on-line para configurar seu projeto em poucos minutos.","url":"https://intlayer.org/pt/doc/concept/content/plural","datePublished":"2026-05-04","dateModified":"2026-05-04","version":"8.8.0","keywords":"Plural, Pluralização, CLDR, Internacionalização, Documentação, Intlayer, Next.js, JavaScript, React","license":"https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE","audience":{"@type":"Audience","audienceType":"Desenvolvedores, Gerentes de Conteúdo"}}
Copiar o Markdown do documento para a área de transferência
Conteúdo Plural / Plural no Intlayer
Como o Plural Funciona
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
Copiar código
Copiar o código para a área de transferência
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;
To use plural content in Next.js Client Components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
**/*.tsx
Copiar código
Copiar o código para a área de transferência
"use client";
import type { FC } from "react";
import { useIntlayer } from "next-intlayer";
const OpeningsComponent: FC<{ count: number }> = ({ count }) => {
const { totalOpenings } = useIntlayer("total_openings");
return (
<div>
<p>{totalOpenings(count)}</p>
</div>
);
};
export default OpeningsComponent;
To use plural content in Vue components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
**/*.vue
Copiar código
Copiar o código para a área de transferência
<script setup lang="ts">import { useIntlayer } from "vue-intlayer";defineProps<{ count: number }>();const { totalOpenings } = useIntlayer("total_openings");</script><template><div> <p>{{ totalOpenings(count) }}</p></div></template>
To 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:
**/*.svelte
Copiar código
Copiar o código para a área de transferência
<script lang="ts">import { useIntlayer } from "svelte-intlayer";export let count: number;const content = useIntlayer("total_openings");</script><div><p>{$content.totalOpenings(count)}</p></div>
To use plural content in Preact components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
**/*.tsx
Copiar código
Copiar o código para a área de transferência
import type { FC } from "preact";
import { useIntlayer } from "preact-intlayer";
const OpeningsComponent: FC<{ count: number }> = ({ count }) => {
const { totalOpenings } = useIntlayer("total_openings");
return (
<div>
<p>{totalOpenings(count)}</p>
</div>
);
};
export default OpeningsComponent;
To use plural content in SolidJS components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
**/*.tsx
Copiar código
Copiar o código para a área de transferência
import type { Component } from "solid-js";
import { useIntlayer } from "solid-intlayer";
const OpeningsComponent: Component<{ count: number }> = (props) => {
const { totalOpenings } = useIntlayer("total_openings");
return (
<div>
<p>{totalOpenings(props.count)}</p>
</div>
);
};
export default OpeningsComponent;
To use plural content in Angular components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
app.component.ts
Copiar código
Copiar o código para a área de transferência
import { Component, Input } from "@angular/core";import { useIntlayer } from "angular-intlayer";@Component({selector: "app-openings",template: ` <div> <p>{{ content().totalOpenings(count) }}</p> </div>`,})export class OpeningsComponent {@Input() count!: number;content = useIntlayer("total_openings");}
To use plural content with vanilla-intlayer, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
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
Copiar código
Copiar o código para a área de transferência
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;
To use plural content in Next.js Client Components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
**/*.tsx
Copiar código
Copiar o código para a área de transferência
"use client";
import type { FC } from "react";
import { useIntlayer } from "next-intlayer";
const OpeningsComponent: FC<{ count: number }> = ({ count }) => {
const { totalOpenings } = useIntlayer("total_openings");
return (
<div>
<p>{totalOpenings(count)}</p>
</div>
);
};
export default OpeningsComponent;
To use plural content in Vue components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
**/*.vue
Copiar código
Copiar o código para a área de transferência
<script setup lang="ts">import { useIntlayer } from "vue-intlayer";defineProps<{ count: number }>();const { totalOpenings } = useIntlayer("total_openings");</script><template><div> <p>{{ totalOpenings(count) }}</p></div></template>
To 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:
**/*.svelte
Copiar código
Copiar o código para a área de transferência
<script lang="ts">import { useIntlayer } from "svelte-intlayer";export let count: number;const content = useIntlayer("total_openings");</script><div><p>{$content.totalOpenings(count)}</p></div>
To use plural content in Preact components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
**/*.tsx
Copiar código
Copiar o código para a área de transferência
import type { FC } from "preact";
import { useIntlayer } from "preact-intlayer";
const OpeningsComponent: FC<{ count: number }> = ({ count }) => {
const { totalOpenings } = useIntlayer("total_openings");
return (
<div>
<p>{totalOpenings(count)}</p>
</div>
);
};
export default OpeningsComponent;
To use plural content in SolidJS components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
**/*.tsx
Copiar código
Copiar o código para a área de transferência
import type { Component } from "solid-js";
import { useIntlayer } from "solid-intlayer";
const OpeningsComponent: Component<{ count: number }> = (props) => {
const { totalOpenings } = useIntlayer("total_openings");
return (
<div>
<p>{totalOpenings(props.count)}</p>
</div>
);
};
export default OpeningsComponent;
To use plural content in Angular components, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
app.component.ts
Copiar código
Copiar o código para a área de transferência
import { Component, Input } from "@angular/core";import { useIntlayer } from "angular-intlayer";@Component({selector: "app-openings",template: ` <div> <p>{{ content().totalOpenings(count) }}</p> </div>`,})export class OpeningsComponent {@Input() count!: number;content = useIntlayer("total_openings");}
To use plural content with vanilla-intlayer, retrieve it via the useIntlayer hook and call it with a count. Here's an example:
Para configurar o conteúdo plural no seu projeto Intlayer, crie um módulo de conteúdo que use o auxiliar plural. A categoria other é obrigatória e é usada como fallback quando uma localidade não define uma categoria mais específica.
As categorias suportadas são zero, one, two, few, many, other. Você só precisa declarar as categorias que seu idioma de destino usa, o Intlayer volta para other quando nenhuma categoria específica corresponde.
O marcador {{count}} é substituído automaticamente pela contagem que você passa em tempo de execução. Você também pode incluir outros marcadores (veja Marcadores personalizados abaixo).
Usando Conteúdo Plural com React Intlayer
Para usar conteúdo plural dentro de um componente React, recupere-o através do hook useIntlayer e chame-o com uma contagem. A localidade ativa e a contagem são combinadas para escolher a categoria CLDR correspondente.