Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Node.js package providing i18n with variable interpolation & conjugation of words with respect to quantifiers, supporting all languages' conjugation rules.
A node.js package providing i18n with variable interpolation & conjugation of words with respect to quantifiers, supporting all languages' conjugation rules.
You can read the full documentation with examples there.
The key function is trans(key, interpolationParams = {})
There are two specifiers available for you to use:
:variableName
- simply replaces all such fields with the corresponding values supplied as Object properties in the second argument of trans
call:[quantityVarName, { zero: 'values', one: 'value', other: 'values' } ]
-import { Locales, LocaleHelper } from "i18n-plus";
// these will be the keys used in the dictionary to identify texts
const localeKeys = {
home: { welcome: "home.welcome" }
};
// this is the actual dictionary
const localeValues = {
[Locales.en]: {
[localeKeys.home.welcome]:
"Welcome, :user! You have :[messages, { zero: 'messages', one: 'message', other: 'messages' }]"
}
};
let localeHelper = new LocaleHelper(localeKeys, localeValues);
// here, you can do whatever you want with the translated & interpolated text, e.g. send it with an HTTP response, render it as a React or HTML component, log it to the console, etc.
let welcomeMessage = localeHelper.trans(localeKeys.home.welcome, {
user: "Elon Musk",
messages: 5
});
You can run all tests using npm run test
This project uses jsdoc
to compile documentation to HTML files to docs
directory. You can run the process with npm run genDocs
.
FAQs
Node.js package providing i18n with variable interpolation & conjugation of words with respect to quantifiers, supporting all languages' conjugation rules.
The npm package i18n-plus receives a total of 17 weekly downloads. As such, i18n-plus popularity was classified as not popular.
We found that i18n-plus 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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.