
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
i18next-countable-postprocessor
Advanced tools
i18next-countable-postProcessorThis is i18next plugin enabling advanced translations, required by some languages.
# npm package
$ npm install i18next-countable-postprocessor
# bower
$ bower install magyadev/i18next-countable-postprocessor
window.i18nextCountablePostProcessorimport i18next from 'i18next';
import countable from 'i18next-countable-postprocessor';
i18next
.use(countable)
.init({ /* your i18next configuration */ });
Create additional rule keys in translation resource for language that requires more that one plural form. Example is Polish language, there are 2 forms for plural version, and the rules are:
{
"records_found_0": "Nie znaleziono rekordów",
"records_found_1": "Znaleziono 1 rekord",
// (1) rule for count numbers ending with "2"
"records_found_*2": "Znaleziono {{count}} rekordy",
// (2) rule for count numbers ending with "3"
"records_found_*3": "Znaleziono {{count}} rekordy",
// (3) rule for count numbers ending with "4"
"records_found_*4": "Znaleziono {{count}} rekordy",
// (4) exception from rule (1) for count numbers ending with "12"
"records_found_*12": "Znaleziono {{count}} rekordów",
// (5) exception from rule (2) for count numbers ending with "13"
"records_found_*13": "Znaleziono {{count}} rekordów",
// (6) exception from rule (3) for count numbers ending with "14"
"records_found_*14": "Znaleziono {{count}} rekordów",
// additionally at least one of following fallback rules for other numbers should be defined
"records_found_plural": "Znaleziono {{count}} rekordów", // higher priority fallback translation, only for numbers > 2
"records_found": "Znaleziono {{count}} rekordów", // lower priority fallback translation, but will handle 0 and 1 if no specific rule for those numbers is provided
}
t functionimport i18next from "i18next";
const translation = i18next.t('records_found', { postProcess: 'countable', count: 5 });
react-i18nextimport { useTranslation } from "react-i18next";
const { t } = useTranslation();
const translation = t('records_found', { postProcess: 'countable', count: 5 });
import i18next from 'i18next';
import countable from 'i18next-countable-postprocessor';
countable.setOptions({
variantSeparator: "-",
countVariableName: "number"
});
i18next
.use(countable)
.init({ /* your i18next configuration */ });
variantSeparator - separator between resource key and number rule suffix. Define "-" for example to replace pattern "key_*1" with "key-*1"
countVariableName - postProcessor will "active" only if count variable is provided as option for "t" function, but it doesn't need to be named "count". Define other string, e.g. "number" to resorve translation like "Znaleziono {{number}} rekordy" from example above.
This project's structure is based on great intervalPlural processor library.
FAQs
postProcessor for applying advanced count dependent rules
We found that i18next-countable-postprocessor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.