UNPKG

@intlayer/core

Version:

Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.

33 lines (31 loc) 1.11 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const require_runtime = require('../../_virtual/_rolldown/runtime.cjs'); let _intlayer_types_nodeType = require("@intlayer/types/nodeType"); //#region src/transpiler/plural/plural.ts /** * Function intended to be used to build intlayer dictionaries. * * Allow to pick a content based on a quantity using CLDR pluralization rules * (`Intl.PluralRules`). The selected category depends on the active locale. * * Supported categories: `zero`, `one`, `two`, `few`, `many`, `other`. * `other` is required as the fallback. * * The string content can include a `{{count}}` placeholder, which is * automatically replaced with the provided count. * * Usage: * * ```ts * plural({ * one: '{{count}} вакансия', * few: '{{count}} вакансии', * many: '{{count}} вакансий', * other: '{{count}} вакансий', * }); * ``` */ const plural = (content) => (0, _intlayer_types_nodeType.formatNodeType)(_intlayer_types_nodeType.PLURAL, content); //#endregion exports.plural = plural; //# sourceMappingURL=plural.cjs.map