
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
i18n-ini-loader
Advanced tools
Webpack I18n loader based on .ini files.
npm install i18n-ini-loader
Input:
messages.ini
[hello]
en=Hello, ${name}!
de=Hallo, ${name}!
[niceDay]
en=Have a nice day.
de=Hab einen schönen Tag.
Config:
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.ini$/,
use: [
{
loader: 'i18n-ini-loader',
options: {
language: 'de',
failOnMissingTranslation: true
}
}
]
}
]
}
}
// Note: Since the output of the `i18n-ini-loader` uses ES6 template strings
// and arrow functions (see below), you may want to chain the `babel-loader`
// for ES5 support.
// Check out the `/example` directory for a simple example config.
Output:
module.exports = {
hello: (name) => `Hallo, ${name}!`,
niceDay: 'Hab einen schönen Tag.'
}
Usage:
Welcome.jsx
import { hello, niceDay } from './messages.ini'
export default function Welcome({ name }) {
return (
<div>
<h1>{hello(name)}</h1>
<span>{niceDay}</span>
</div>
)
}
// <div>
// <h1>Hallo, Mark!</h1>
// <span>Hab einen schönen Tag.</span>
// </div>
language
: the language key used for translation (default: en
)failOnMissingTranslation
: whether an Error
should be thrown if missing translations are found (default: true
); if false
, missing translations will be handled gracefully by returning an empty String
(''
)WTFPL – Do What the F*ck You Want to Public License.
Made with :heart: by @MarkTiedemann.
FAQs
Webpack I18n loader based on .ini files.
We found that i18n-ini-loader 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
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.