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

{$content.numberOfCar(6)}

\n
\n```\n\n
\n \n\nTo use enumeration in Preact components, retrieve it via the `useIntlayer` hook. Here's an example:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"preact\";\nimport { useIntlayer } from \"preact-intlayer\";\n\nconst CarComponent: FC = () => {\n const { numberOfCar } = useIntlayer(\"car_count\");\n\n return (\n
\n

{numberOfCar(6)}

\n
\n );\n};\n\nexport default CarComponent;\n```\n\n
\n \n\nTo use enumeration in SolidJS components, retrieve it via the `useIntlayer` hook. 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 CarComponent: Component = () => {\n const { numberOfCar } = useIntlayer(\"car_count\");\n\n return (\n
\n

{numberOfCar(6)}

\n
\n );\n};\n\nexport default CarComponent;\n```\n\n
\n \n\nTo use enumeration in Angular components, retrieve it via the `useIntlayer` hook. Here's an example:\n\n```typescript fileName=\"app.component.ts\" codeFormat=\"typescript\"\nimport { Component } from \"@angular/core\";\nimport { useIntlayer } from \"angular-intlayer\";\n\n@Component({\n selector: \"app-car\",\n template: `\n
\n

{{ content().numberOfCar(6) }}

\n
\n `,\n})\nexport class CarComponent {\n content = useIntlayer(\"car_count\");\n}\n```\n\n
\n \n\nTo use enumeration with `vanilla-intlayer`, retrieve it via the `useIntlayer` hook. Here's an example:\n\n```typescript fileName=\"**/*.ts\" codeFormat={[\"typescript\", \"esm\"]}\nimport { installIntlayer, useIntlayer } from \"vanilla-intlayer\";\n\ninstallIntlayer();\n\nconst content = useIntlayer(\"car_count\").onChange((newContent) => {\n document.getElementById(\"cars\")!.textContent = newContent.numberOfCar(6);\n});\n\n// Initial render\ndocument.getElementById(\"cars\")!.textContent = content.numberOfCar(6);\n```\n\n \n\n## Настройка перечисления\n\nЧтобы настроить перечисление в вашем проекте Intlayer, необходимо создать модуль содержимого, включающий определения перечислений. Вот пример простого перечисления для количества автомобилей:\n\n```typescript fileName=\"**/*.content.ts\" contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\nimport { enu, type Dictionary } from \"intlayer\";\n\nconst carEnumeration = {\n key: \"car_count\",\n content: {\n numberOfCar: enu({\n \"<-1\": \"Меньше чем минус один автомобиль\",\n \"-1\": \"Минус один автомобиль\",\n \"0\": \"Нет автомобилей\",\n \"1\": \"Один автомобиль\",\n \">5\": \"Несколько автомобилей\",\n \">19\": \"Много автомобилей\",\n \"fallback\": \"Запасное значение\", // Необязательно\n }),\n },\n} satisfies Dictionary;\n\nexport default carEnumeration;\n```\n\n```json fileName=\"**/*.content.json\" contentDeclarationFormat=\"json\"\n{\n \"$schema\": \"https://intlayer.org/schema.json\",\n \"key\": \"car_count\",\n \"content\": {\n \"numberOfCar\": {\n \"nodeType\": \"enumeration\",\n \"enumeration\": {\n \"<-1\": \"Меньше чем минус один автомобиль\",\n \"-1\": \"Минус один автомобиль\",\n \"0\": \"Нет автомобилей\",\n \"1\": \"Один автомобиль\",\n \">5\": \"Несколько автомобилей\",\n \">19\": \"Много автомобилей\",\n \"fallback\": \"Запасное значение\" // Необязательно\n }\n }\n }\n}\n```\n\nВ этом примере `enu` сопоставляет различные условия с конкретным содержимым. При использовании в React-компоненте Intlayer может автоматически выбирать соответствующее содержимое на основе переданной переменной.\n\n> Порядок объявления важен в перечислениях Intlayer. Первое подходящее объявление будет выбрано. Если применяются несколько условий, убедитесь, что они расположены в правильном порядке, чтобы избежать непредвиденного поведения.\n\n> Если запасное значение не объявлено, функция вернёт `undefined`, если ни один ключ не совпадает.\n\n## Использование перечислений с React Intlayer\n\n\n \n\nTo use enumeration in a React component, you can leverage the `useIntlayer` hook from the `react-intlayer` package. This hook retrieves the correct content based on the specified ID. Here's an example of how to use it:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"react\";\nimport { useIntlayer } from \"react-intlayer\";\n\nconst CarComponent: FC = () => {\n const { numberOfCar } = useIntlayer(\"car_count\");\n\n return (\n
\n

\n {\n numberOfCar(0) // Output: No cars\n }\n

\n

\n {\n numberOfCar(6) // Output: Some cars\n }\n

\n

\n {\n numberOfCar(20) // Output: Many cars\n }\n

\n

\n {\n numberOfCar(0.01) // Output: Fallback value\n }\n

\n
\n );\n};\n```\n\n
\n \n\nTo use enumeration in Next.js Client Components, retrieve it via the `useIntlayer` hook. 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 CarComponent: FC = () => {\n const { numberOfCar } = useIntlayer(\"car_count\");\n\n return (\n
\n

{numberOfCar(6)}

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

{$content.numberOfCar(6)}

\n
\n```\n\n
\n \n\nTo use enumeration in Preact components, retrieve it via the `useIntlayer` hook. Here's an example:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"preact\";\nimport { useIntlayer } from \"preact-intlayer\";\n\nconst CarComponent: FC = () => {\n const { numberOfCar } = useIntlayer(\"car_count\");\n\n return (\n
\n

{numberOfCar(6)}

\n
\n );\n};\n\nexport default CarComponent;\n```\n\n
\n \n\nTo use enumeration in SolidJS components, retrieve it via the `useIntlayer` hook. 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 CarComponent: Component = () => {\n const { numberOfCar } = useIntlayer(\"car_count\");\n\n return (\n
\n

{numberOfCar(6)}

\n
\n );\n};\n\nexport default CarComponent;\n```\n\n
\n \n\nTo use enumeration in Angular components, retrieve it via the `useIntlayer` hook. Here's an example:\n\n```typescript fileName=\"app.component.ts\" codeFormat=\"typescript\"\nimport { Component } from \"@angular/core\";\nimport { useIntlayer } from \"angular-intlayer\";\n\n@Component({\n selector: \"app-car\",\n template: `\n
\n

{{ content().numberOfCar(6) }}

\n
\n `,\n})\nexport class CarComponent {\n content = useIntlayer(\"car_count\");\n}\n```\n\n
\n \n\nTo use enumeration with `vanilla-intlayer`, retrieve it via the `useIntlayer` hook. Here's an example:\n\n```typescript fileName=\"**/*.ts\" codeFormat={[\"typescript\", \"esm\"]}\nimport { installIntlayer, useIntlayer } from \"vanilla-intlayer\";\n\ninstallIntlayer();\n\nconst content = useIntlayer(\"car_count\").onChange((newContent) => {\n document.getElementById(\"cars\")!.textContent = newContent.numberOfCar(6);\n});\n\n// Initial render\ndocument.getElementById(\"cars\")!.textContent = content.numberOfCar(6);\n```\n\n \n
\n\n## Дополнительные ресурсы\n\nДля получения более подробной информации о настройке и использовании обратитесь к следующим ресурсам:\n\n- [Документация Intlayer CLI](/ru/doc/concept/cli)\n- [Документация React Intlayer](/ru/doc/environment/create-react-app)\n- [Документация Next Intlayer](/ru/doc/environment/nextjs/15)\n\nЭти ресурсы предоставляют дополнительную информацию о настройке и использовании Intlayer в различных средах и с разными фреймворками.\n\n### Using Ordinal Enumeration\n\n\n \n\nTo use this in a React component, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"react\";\nimport { useIntlayer } from \"react-intlayer\";\n\nconst RankingComponent: FC<{ count: number }> = ({ count }) => {\n const { ordinal } = useIntlayer(\"ranking_component\");\n\n // Get the last digit to determine the correct suffix\n const lastDigit = Math.abs(count) % 10;\n\n return (\n
\n

\n {\n ordinal(lastDigit)({ count }) // e.g., \"5th place\" for count=5\n }\n

\n
\n );\n};\n```\n\n
\n \n\nTo use this in Next.js Client Components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\n\"use client\";\n\nimport type { FC } from \"react\";\nimport { useIntlayer } from \"next-intlayer\";\n\nconst RankingComponent: FC<{ count: number }> = ({ count }) => {\n const { ordinal } = useIntlayer(\"ranking_component\");\n const lastDigit = Math.abs(count) % 10;\n\n return (\n
\n

{ordinal(lastDigit)({ count })}

\n
\n );\n};\n\nexport default RankingComponent;\n```\n\n
\n \n\nTo use this in Vue components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```vue fileName=\"**/*.vue\"\n\n\n\n```\n\n \n \n\nTo use this in Svelte components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```svelte fileName=\"**/*.svelte\"\n\n\n
\n

{$content.ordinal(lastDigit)({ count })}

\n
\n```\n\n
\n \n\nTo use this in Preact components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"preact\";\nimport { useIntlayer } from \"preact-intlayer\";\n\nconst RankingComponent: FC<{ count: number }> = ({ count }) => {\n const { ordinal } = useIntlayer(\"ranking_component\");\n const lastDigit = Math.abs(count) % 10;\n\n return (\n
\n

{ordinal(lastDigit)({ count })}

\n
\n );\n};\n\nexport default RankingComponent;\n```\n\n
\n \n\nTo use this in SolidJS components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { Component } from \"solid-js\";\nimport { useIntlayer } from \"solid-intlayer\";\n\nconst RankingComponent: Component<{ count: number }> = (props) => {\n const { ordinal } = useIntlayer(\"ranking_component\");\n\n return (\n
\n

{ordinal(Math.abs(props.count) % 10)({ count: props.count })}

\n
\n );\n};\n\nexport default RankingComponent;\n```\n\n
\n \n\nTo use this in Angular components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\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-ranking\",\n template: `\n
\n

{{ content().ordinal(lastDigit())({ count }) }}

\n
\n `,\n})\nexport class RankingComponent {\n @Input() count!: number;\n\n content = useIntlayer(\"ranking_component\");\n\n lastDigit() {\n return Math.abs(this.count) % 10;\n }\n}\n```\n\n
\n \n\nTo use this with `vanilla-intlayer`, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```typescript fileName=\"**/*.ts\" codeFormat={[\"typescript\", \"esm\"]}\nimport { installIntlayer, useIntlayer } from \"vanilla-intlayer\";\n\ninstallIntlayer();\n\nconst content = useIntlayer(\"ranking_component\");\nconst lastDigit = Math.abs(5) % 10;\n\ndocument.getElementById(\"ranking\")!.textContent = content.ordinal(lastDigit)({\n count: 5,\n});\n```\n\n \n
\n\n## Combining Enumeration with Insert for Ordinal Numbers\n\nA common use case is displaying ordinal numbers (1st, 2nd, 3rd, etc.). You can combine `enu` with `insert` to create dynamic ordinal content:\n\n```typescript fileName=\"**/*.content.ts\" contentDeclarationFormat={[\"typescript\", \"esm\", \"commonjs\"]}\nimport { enu, insert, type Dictionary } from \"intlayer\";\n\nconst rankingContent = {\n key: \"ranking_component\",\n content: {\n ordinal: enu({\n 1: insert(\"{{count}}st place\"),\n 2: insert(\"{{count}}nd place\"),\n 3: insert(\"{{count}}rd place\"),\n fallback: insert(\"{{count}}th place\"),\n }),\n },\n} satisfies Dictionary;\n\nexport default rankingContent;\n```\n\n```json fileName=\"**/*.content.json\" contentDeclarationFormat=\"json\"\n{\n \"$schema\": \"https://intlayer.org/schema.json\",\n \"key\": \"ranking_component\",\n \"content\": {\n \"ordinal\": {\n \"nodeType\": \"enumeration\",\n \"enumeration\": {\n \"1\": {\n \"nodeType\": \"insertion\",\n \"insertion\": \"{{count}}st place\"\n },\n \"2\": {\n \"nodeType\": \"insertion\",\n \"insertion\": \"{{count}}nd place\"\n },\n \"3\": {\n \"nodeType\": \"insertion\",\n \"insertion\": \"{{count}}rd place\"\n },\n \"fallback\": {\n \"nodeType\": \"insertion\",\n \"insertion\": \"{{count}}th place\"\n }\n }\n }\n }\n}\n```\n\n### Using Ordinal Enumeration\n\n\n \n\nTo use this in a React component, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"react\";\nimport { useIntlayer } from \"react-intlayer\";\n\nconst RankingComponent: FC<{ count: number }> = ({ count }) => {\n const { ordinal } = useIntlayer(\"ranking_component\");\n\n // Get the last digit to determine the correct suffix\n const lastDigit = Math.abs(count) % 10;\n\n return (\n
\n

\n {\n ordinal(lastDigit)({ count }) // e.g., \"5th place\" for count=5\n }\n

\n
\n );\n};\n```\n\n
\n \n\nTo use this in Next.js Client Components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\n\"use client\";\n\nimport type { FC } from \"react\";\nimport { useIntlayer } from \"next-intlayer\";\n\nconst RankingComponent: FC<{ count: number }> = ({ count }) => {\n const { ordinal } = useIntlayer(\"ranking_component\");\n const lastDigit = Math.abs(count) % 10;\n\n return (\n
\n

{ordinal(lastDigit)({ count })}

\n
\n );\n};\n\nexport default RankingComponent;\n```\n\n
\n \n\nTo use this in Vue components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```vue fileName=\"**/*.vue\"\n\n\n\n```\n\n \n \n\nTo use this in Svelte components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```svelte fileName=\"**/*.svelte\"\n\n\n
\n

{$content.ordinal(lastDigit)({ count })}

\n
\n```\n\n
\n \n\nTo use this in Preact components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { FC } from \"preact\";\nimport { useIntlayer } from \"preact-intlayer\";\n\nconst RankingComponent: FC<{ count: number }> = ({ count }) => {\n const { ordinal } = useIntlayer(\"ranking_component\");\n const lastDigit = Math.abs(count) % 10;\n\n return (\n
\n

{ordinal(lastDigit)({ count })}

\n
\n );\n};\n\nexport default RankingComponent;\n```\n\n
\n \n\nTo use this in SolidJS components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```tsx fileName=\"**/*.tsx\" codeFormat={[\"typescript\", \"esm\"]}\nimport type { Component } from \"solid-js\";\nimport { useIntlayer } from \"solid-intlayer\";\n\nconst RankingComponent: Component<{ count: number }> = (props) => {\n const { ordinal } = useIntlayer(\"ranking_component\");\n\n return (\n
\n

{ordinal(Math.abs(props.count) % 10)({ count: props.count })}

\n
\n );\n};\n\nexport default RankingComponent;\n```\n\n
\n \n\nTo use this in Angular components, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\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-ranking\",\n template: `\n
\n

{{ content().ordinal(lastDigit())({ count }) }}

\n
\n `,\n})\nexport class RankingComponent {\n @Input() count!: number;\n\n content = useIntlayer(\"ranking_component\");\n\n lastDigit() {\n return Math.abs(this.count) % 10;\n }\n}\n```\n\n
\n \n\nTo use this with `vanilla-intlayer`, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:\n\n```typescript fileName=\"**/*.ts\" codeFormat={[\"typescript\", \"esm\"]}\nimport { installIntlayer, useIntlayer } from \"vanilla-intlayer\";\n\ninstallIntlayer();\n\nconst content = useIntlayer(\"ranking_component\");\nconst lastDigit = Math.abs(5) % 10;\n\ndocument.getElementById(\"ranking\")!.textContent = content.ordinal(lastDigit)({\n count: 5,\n});\n```\n\n \n
\n## Additional Resources\n\nFor more detailed information on configuration and usage, refer to the following resources:\n\n- [Intlayer CLI Documentation](/ru/doc/concept/cli)\n- [React Intlayer Documentation](/ru/doc/environment/create-react-app)\n- [Next Intlayer Documentation](/ru/doc/environment/nextjs/15)\n\nThese resources provide further insights into the setup and usage of Intlayer in different environments and with various frameworks.\n","description":"Узнайте, как объявлять и использовать перечисления на вашем многоязычном сайте. Следуйте шагам в этой онлайн-документации, чтобы настроить ваш проект за несколько минут.","url":"https://intlayer.org/ru/doc/concept/content/enumeration","datePublished":"2024-08-11","dateModified":"2025-06-29","version":"5.5.10","keywords":"Перечисление, Интернационализация, Документация, Intlayer, Next.js, JavaScript, React","license":"https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE","audience":{"@type":"Audience","audienceType":"Разработчики, менеджеры контента"}}
    Автор:
    Создание:2024-08-11Последнее обновление:2025-06-29

    Перечисление / Множественное число

    Как работает перечисление

    To use enumeration in a React component, you can leverage the useIntlayer hook from the react-intlayer package. This hook retrieves the correct content based on the specified ID. Here's an example of how to use it:

    **/*.tsx
    import type { FC } from "react";
    import { useIntlayer } from "react-intlayer";
    
    const CarComponent: FC = () => {
    const { numberOfCar } = useIntlayer("car_count");
    
    return (
      <div>
        <p>
          {
            numberOfCar(0) // Output: No cars
          }
        </p>
        <p>
          {
            numberOfCar(6) // Output: Some cars
          }
        </p>
        <p>
          {
            numberOfCar(20) // Output: Many cars
          }
        </p>
        <p>
          {
            numberOfCar(0.01) // Output: Fallback value
          }
        </p>
      </div>
    );
    };

    Настройка перечисления

    Чтобы настроить перечисление в вашем проекте Intlayer, необходимо создать модуль содержимого, включающий определения перечислений. Вот пример простого перечисления для количества автомобилей:

    **/*.content.ts
    import { enu, type Dictionary } from "intlayer";
    
    const carEnumeration = {
      key: "car_count",
      content: {
        numberOfCar: enu({
          "<-1": "Меньше чем минус один автомобиль",
          "-1": "Минус один автомобиль",
          "0": "Нет автомобилей",
          "1": "Один автомобиль",
          ">5": "Несколько автомобилей",
          ">19": "Много автомобилей",
          "fallback": "Запасное значение", // Необязательно
        }),
      },
    } satisfies Dictionary;
    
    export default carEnumeration;

    В этом примере enu сопоставляет различные условия с конкретным содержимым. При использовании в React-компоненте Intlayer может автоматически выбирать соответствующее содержимое на основе переданной переменной.

    Порядок объявления важен в перечислениях Intlayer. Первое подходящее объявление будет выбрано. Если применяются несколько условий, убедитесь, что они расположены в правильном порядке, чтобы избежать непредвиденного поведения.
    Если запасное значение не объявлено, функция вернёт undefined, если ни один ключ не совпадает.

    Использование перечислений с React Intlayer

    To use enumeration in a React component, you can leverage the useIntlayer hook from the react-intlayer package. This hook retrieves the correct content based on the specified ID. Here's an example of how to use it:

    **/*.tsx
    import type { FC } from "react";
    import { useIntlayer } from "react-intlayer";
    
    const CarComponent: FC = () => {
    const { numberOfCar } = useIntlayer("car_count");
    
    return (
      <div>
        <p>
          {
            numberOfCar(0) // Output: No cars
          }
        </p>
        <p>
          {
            numberOfCar(6) // Output: Some cars
          }
        </p>
        <p>
          {
            numberOfCar(20) // Output: Many cars
          }
        </p>
        <p>
          {
            numberOfCar(0.01) // Output: Fallback value
          }
        </p>
      </div>
    );
    };

    Дополнительные ресурсы

    Для получения более подробной информации о настройке и использовании обратитесь к следующим ресурсам:

    Эти ресурсы предоставляют дополнительную информацию о настройке и использовании Intlayer в различных средах и с разными фреймворками.

    Using Ordinal Enumeration

    To use this in a React component, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:

    **/*.tsx
    import type { FC } from "react";
    import { useIntlayer } from "react-intlayer";
    
    const RankingComponent: FC<{ count: number }> = ({ count }) => {
    const { ordinal } = useIntlayer("ranking_component");
    
    // Get the last digit to determine the correct suffix
    const lastDigit = Math.abs(count) % 10;
    
    return (
      <div>
        <p>
          {
            ordinal(lastDigit)({ count }) // e.g., "5th place" for count=5
          }
        </p>
      </div>
    );
    };

    Combining Enumeration with Insert for Ordinal Numbers

    A common use case is displaying ordinal numbers (1st, 2nd, 3rd, etc.). You can combine enu with insert to create dynamic ordinal content:

    **/*.content.ts
    import { enu, insert, type Dictionary } from "intlayer";
    
    const rankingContent = {
      key: "ranking_component",
      content: {
        ordinal: enu({
          1: insert("{{count}}st place"),
          2: insert("{{count}}nd place"),
          3: insert("{{count}}rd place"),
          fallback: insert("{{count}}th place"),
        }),
      },
    } satisfies Dictionary;
    
    export default rankingContent;

    Using Ordinal Enumeration

    To use this in a React component, call the enumeration with the last digit of the number to get the correct suffix, then pass the full count as the insertion value:

    **/*.tsx
    import type { FC } from "react";
    import { useIntlayer } from "react-intlayer";
    
    const RankingComponent: FC<{ count: number }> = ({ count }) => {
    const { ordinal } = useIntlayer("ranking_component");
    
    // Get the last digit to determine the correct suffix
    const lastDigit = Math.abs(count) % 10;
    
    return (
      <div>
        <p>
          {
            ordinal(lastDigit)({ count }) // e.g., "5th place" for count=5
          }
        </p>
      </div>
    );
    };

    Additional Resources

    For more detailed information on configuration and usage, refer to the following resources:

    These resources provide further insights into the setup and usage of Intlayer in different environments and with various frameworks.