
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
A library to translate i18n key and value.
npm install tb-i18n --save-dev
To get the current language of i18n. The Default language of i18n is 'en'.
let lang = i18n.getLanguage()
console.log(lang)
The result of log is 'en'.
To change language of i18n.
i18n.setLanguage('zh')
To get the locales of specified language
let locales = i18n.getLocales('zh')
To extend i18n locales of specified language
i18n.setLocales('en', {
'key1': 'My name is suyu34.',
'key2': 'I come from %s.'
})
let value = i18n.get('key1')
The result of value is 'My name is suyu34.'. So it is how i18n works.
To get default value of any key.
i18n.setLocales('en', {
'key1': 'My name is suyu34.',
'key2': 'I come from %s.',
'key3': 'My name is %1 and come from %2.',
'key4': 'My name is %s and come from %s.',
})
// transition: My name is suyu34.
// result: My name is suyu34.
let value1 = i18n.get('key1')
// transition: I come from %s.
// result: I come from CQ.
let value2 = i18n.get('key2', 'CQ')
// transition: My name is %1 and come from %2.
// result: My name is suyu34 and come from CQ.
let value3 = i18n.get('key3', 'suyu34', 'CQ')
// transition: My name is %s and come from %s.
// result: My name is suyu34 and come from CQ.
let value4 = i18n.get('key4', 'suyu34', 'CQ')
The values of key1, key2 and key3 are dynamic. They must have input values when get.So there has two ways to replace value:
To get transition of specified language. Like i18n.get but it accept a specified language.
i18n.setLocales('zh', {
'key1': '我是suyu34。',
'key2': '我来自%s。',
'key3': '我是%1,来自%2。',
'key4': '我是%s,来自%s。',
})
// transition: 我是suyu34。
// result: 我是suyu34。
let value1 = i18n.point('key1', 'zh')
// transition: 我来自%s。
// result: 我来自CQ。
let value2 = i18n.point('key2', 'zh', 'CQ')
// transition: 我是%1,来自%2。
// result: 我是suyu34,来自CQ。
let value3 = i18n.get('key3', 'zh', 'suyu34', 'CQ')
// transition: 我是%s,来自%s。
// result: 我是suyu34,来自CQ。
let value4 = i18n.get('key4', 'zh', 'suyu34', 'CQ')
MIT
FAQs
I18n for teambition web.
We found that tb-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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.