Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
new-i18n is a simple and easy to use internationalization library.
See CHANGELOG.md
npm install new-i18n
localization/en.json
:
{
"hello_world": "Hello World"
}
localization/pt.json
:
{
"hello_world": "Olá Mundo"
}
index.js
:
const { default: I18n } = require('new-i18n');
const i18n = new I18n(__dirname, ['en','pt'], 'en');
console.log('English:', i18n.translate('en', 'hello_world'));
console.log('Portuguese:', i18n.translate('pt', 'hello_world'));
console.log(i18n.translate('en', 'hi', { name: '...' }));
console.log(i18n.translate('pt', 'hi', { name: '...' }));
i18n.update('en', { hi: 'Hello my name is {{name}}!' });
i18n.update('pt', { hi: 'Olá meu nome é {{name}}!' });
console.log(i18n.translate('en', 'hi', { name: '...' }));
console.log(i18n.translate('pt', 'hi', { name: '...' }));
console.log(`I18n languages: ${i18n.languages}`)
{
"hi": "Hi {{name}}!"
}
i18n.translate('en', 'hi', { name: '...' }); // 'Hi ...!'
i18n.update('en', { hi: 'Hello my name is {{name}}!' });
i18n.translate('en', 'hi', { name: '...' }); // 'Hello my name is ...!'
localization/en.json
:
{
"nested": {
"hello_world": "Hello World"
}
}
localization/pt.json
:
{
"nested": {
"hello_world": "Olá Mundo"
}
}
index.js
:
i18n.translate('en', 'nested.hello_world'); // 'Hello World'
i18n.translate('pt', 'nested.hello_world'); // 'Olá Mundo'
i18n.languages; // ['en', 'pt']
FAQs
new-i18n is a simple and easy to use internationalization library.
The npm package new-i18n receives a total of 16 weekly downloads. As such, new-i18n popularity was classified as not popular.
We found that new-i18n 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.