
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
@zainulbr/i18n-webpack-plugin
Advanced tools
Rewrite original embed localization into your bundle with support webpack 5
npm
npm i -D @zainulbr/i18n-webpack-plugin
yarn
yarn add -D @zainulbr/i18n-webpack-plugin
This plugin creates bundles with translations baked in. So you can serve the translated bundle to your clients. Example:
console.log(__("Hello World"));
console.log(__("Missing Text"));
var path = require("path");
var I18nPlugin = require("@zainulbr/i18n-webpack-plugin");
var languages = {
"en": null,
"de": require("./de.json")
};
module.exports = Object.keys(languages).map(function(language) {
return {
name: language,
// mode: "development || "production",
entry: "./example",
output: {
path: path.join(__dirname, "dist"),
filename: language + ".output.js"
},
plugins: [
new I18nPlugin(
languages[language]
)
]
};
});
{
"Hello World": "Hallo Welt"
}
current example. original example from un maintenance repo
plugins: [
...
new I18nPlugin(languageConfig, optionsObj)
],
optionsObj.functionName
: the default value is __
, you can change it to other function name.optionsObj.failOnMissing
: the default value is false
, which will show a warning message, if the mapping text cannot be found. If set to true
, the message will be an error message.optionsObj.hideMessage
: the default value is false
, which will show the warning/error message. If set to true
, the message will be hidden.optionsObj.nested
: the default value is false
. If set to true
, the keys in languageConfig
can be nested. This option is interpreted only if languageConfig
isn't a function.
Juho Vepsäläinen |
Joshua Wiens |
Kees Kluskens |
Sean Larkin |
FAQs
Rewrite original embed localization into your bundle with support webpack 5
We found that @zainulbr/i18n-webpack-plugin 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.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.