Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
i18n module for Hexo.
$ npm install hexo-i18n --save
var i18n = new require('hexo-i18n')({
languages: ['zh-TW', 'en']
});
i18n.set('en', {
ok: 'OK',
name: 'My name is %1$s %2$s.',
index: {
title: 'Home'
},
video: {
zero: 'No videos',
one: 'A video',
other: '%d videos'
}
});
i18n.set('zh-TW', {
name: '我的名字是 %2$s %1$s。',
index: {
title: '首頁'
},
video: {
zero: '沒有影片',
one: '一部影片',
other: '%d 部影片'
}
});
var __ = i18n.__();
var _p = i18n._p();
__('ok') // OK
__('index.title') // 首頁
__('name', '大呆', '王') // 我的名字是王大呆
_p('video', 0) // 沒有影片
_p('video', 1) // 一部影片
_p('video', 10) // 10 部影片
Creates a new i18n instance.
Option | Description | Default |
---|---|---|
languages | Default languages. It can be an array or a string | default |
Returns a set of localization data. lang
can be an array or a string, or the default language defined in constructor if not set. This method will build the data in order of languages.
Loads localization data.
Unloads localization data.
Lists loaded languages.
Returns a function for localization.
This method is similar to i18n.__
, but it returns pluralized string based on the second parameter. For example:
_p('video', 0) = __('video.zero', 0)
_p('video', 1) = __('video.one', 1)
_p('video', 10) = __('video.other', 10)
MIT
FAQs
i18n module for Hexo.
The npm package hexo-i18n receives a total of 10,755 weekly downloads. As such, hexo-i18n popularity was classified as popular.
We found that hexo-i18n demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.