
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
message-format-loader
Advanced tools
Write default messages inline. Transpile translations with webpack.
Write default messages inline. Transpile translations with webpack.
a webpack loader for message-format
$ npm install message-format-loader --save-dev
in your webpack.config.js
These are the same as options that are passed to format.setup()
See message-format-inline for more information
module.exports = [ "en", "pt" ].map(function(locale) {
entry: "path/to/entry.js",
output: {
path: "path/to/output/",
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.js$/,
loader: "message-format"
}
]
},
messageFormat: {
functionName: 'format', // identifier of function to inline
locale: locale, // default locale
translate: function(pattern, locales) {
// from call format(pattern, args, locales)
// if no locales were passed to format, locales will be the default locale (specified above)
return require('path/to/translations/' + locale + '.json')[pattern];
},
translations: { // or rather than a translate function, lookup from an object
pt: { ... },
de: { ... }
},
keyType: 'underscored_crc32'
}
});
in your js file:
var format = require('message-format-inline')
format('Welcome {name}!', { name:'Bob' })
This software is free to use under the MIT license. See the LICENSE-MIT file for license text and copyright information.
FAQs
Write default messages inline. Transpile translations with webpack.
The npm package message-format-loader receives a total of 5 weekly downloads. As such, message-format-loader popularity was classified as not popular.
We found that message-format-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 CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.