i18n loader for webpack
Usage
./colors.json
"red": "red""green": "green""blue": "blue"
./de-de.colors.json
"red": "rot""green": "gr�n"
call it
// assuming our locale is "de-de-berlin"var locale = ;// wait for ready, this is only required once for all locales in a web app// because all locales of the same language are merged into one chuck;
options
You should tell the loader about all your locales, if you want to load them once and than want to use them synchronous.
"i18n":"locales":"de""de-de""fr"// "bundleTogether": false// this can disable the bundling of locales
alternative calls
; // chooses the correct file by locale,// but it do not merge the objects; // concatinate all fitting locales; // merges the resulting objects// ./file.js is excuted while compiling==
Don't forget to polyfill require
if you want to use it in node.
See webpack
documentation.
License
MIT (http://www.opensource.org/licenses/mit-license.php)