
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
i18next-intervalplural-postprocessor
Advanced tools
i18next-intervalPlural-postProcessorThis is a i18next postProcessor enabling interval based plurals.
Source can be loaded via npm, bower or downloaded from this repo.
# npm package
$ npm install i18next-intervalplural-postprocessor
# bower
$ bower install i18next-intervalplural-postprocessor
window.i18nextIntervalPluralPostProcessorWiring up:
import i18next from 'i18next';
import intervalPlural from 'i18next-intervalplural-postprocessor';
i18next
.use(intervalPlural)
.init(i18nextOptions);
// given loaded resources
// translation: {
// key1: '{{count}} item',
// key1_plural: '{{count}} items',
// key1_interval: '(1)[one item];(2-7)[a few items];(7-inf)[a lot of items];',
// key2: '{{count}} item',
// key2_plural: '{{count}} items',
// key2_interval: '(1)[one item];(2-7)[a few items];'
// }
i18next.t('key1_interval', { postProcess: 'interval', count: 1 }); // -> one item
i18next.t('key1_interval', { postProcess: 'interval', count: 4 }); // -> a few items
i18next.t('key1_interval', { postProcess: 'interval', count: 100 }); // -> a lot of items
// if a interval is not specified i18next fallbacks to classic plural
i18next.t('key2_interval', { postProcess: 'interval', count: 1 }); // -> one item
i18next.t('key2_interval', { postProcess: 'interval', count: 4 }); // -> a few items
i18next.t('key2_interval', { postProcess: 'interval', count: 100 }); // -> 100 items
import i18next from 'i18next';
import intervalPlural from 'i18next-intervalplural-postprocessor';
intervalPlural.setOptions({
// these are the defaults
intervalSeparator: ';',
intervalRegex: /\((\S*)\).*?\[((.|\n)*)\]/, // pre 3.0 /\((\S*)\).*{((.|\n)*)}/,
intervalSuffix: '_interval'
});
i18next
.use(intervalPlural)
.init(i18nextOptions);
FAQs
postProcessor that allows interval based plurals
We found that i18next-intervalplural-postprocessor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.