Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
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 = {
welcome: (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.
The npm package i18n-ini-loader receives a total of 0 weekly downloads. As such, i18n-ini-loader popularity was classified as not popular.
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.