
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
internationalization
Advanced tools
i18n = require('internationalization');
app.use(i18n.middleware({
directory: path.join(__dirname, 'locales'),
fallback: "en",
cookie: "lang" // default is "lang"
}));
directory layout
files under then same directory will be merged(file name does not matter)
locales
├── en
│ ├── foo.ini
│ └── bar.ini
└── zh
└── index.ini
span= _("Hello {username}", {username: username})
span= _("Hello {1}", username)
input(placeholder=_("Password") type="password")
Hello {username} = Guten Tag {username}
Hello {1} = Guten Tag {1}
Password = Passwort
span= _("profile:Hello {username}", {username: username})
[profile]
Hello {username} = Guten Tag {username}
app.use(i18n.javascript({
directory: path.join(__dirname, 'locales'),
}));
include in html
<script src="/i18n.js"></script>
<script>
console.log(i18n.resource);
console.log(i18n.lang);
</script>
more options:
cookie
default lang
path
default /i18n.js
exportAs
default i18n
app.use(i18n.angular({
directory: path.join(__dirname, 'locales'),
module: 'i18n',
service: 'i18n',
filter: 'translate'
}));
include in html
<script src="/path/to/angularjs.js"></script>
<script src="/i18n.js"></script>
using filter
<p>{{'delete warning'| translate:resource.name}}</p>
<button>{{'action:delete' | translate}}</button>
using service
app.directive("", function(i18n)->
return {
link: function(){
console.log(i18n.translate("resource key", {name: "foo"}));
}
};
directory: 'locales'
views: 'views/**.jade'
grunt i18n will scan the view direcotry for _()
and __()
$ grunt i18n de
FAQs
i18n
The npm package internationalization receives a total of 1 weekly downloads. As such, internationalization popularity was classified as not popular.
We found that internationalization 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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.