i18n-webpack-plugin
i18n-webpack-plugin copied to clipboard
Support fallback language when using tokens
We have some fairly long strings on our site, so we were going to opt for using tokens like this __("my_string_key"), the json like this:
// en.json
{
"my_string_key": "English String"
}
// de.json
{
"my_string_key": "Deutsche Zeichenfolge"
}
However, I was wondering if its still possible to have the this plugin set up a default.
Currently if you use languages = {en: null, de} this works by assuming that the english strings are in the code, and it falls back to using that. We would be looking for a way to specify what language to display if the german strings are missing.
Thanks.
@sorahn have you managed to find the answer?
@102 Not in webpack. We ended up using http://i18next.com/ which gave us full control over how we get updates, and which languages are baked in and what order of fallbacks they go through