You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.
this may be a basic problem/limitation from Webpack, but perhaps someone has an idea.
If i18n is called with a string concatenation Webpack throws an reference error.
let foo = 'foo';
__('bar.'+foo);
ReferenceError: __ is not defined
I checked the i18n-webpack-plugin code and figured out the the problem is this.evaluateExpression(expr.arguments[0]) which is not working if there's string concatenation. My knowledge about webpack plugins is limited, perhaps someone has an idea?
The use for this string concatenation is in combination with the html-webpack-plugin.
For each site I define a template variable with the name of the site and use it to get the translation for the header title.
Hi, the current version works only with the string literals as an argument as you found earlier and skips other combinations (binary expressions and e.t.c.). Thats why the function call __() remains untouched which results in exception.
I did a small modification in #58 which provides possibility to use string concatenation (BinaryExpressions) and templated strings (TemplateLiteral) with variables also. But it requires some time for review and to land into the master.
Hello,
this may be a basic problem/limitation from Webpack, but perhaps someone has an idea.
If i18n is called with a string concatenation Webpack throws an reference error.
I checked the i18n-webpack-plugin code and figured out the the problem is
this.evaluateExpression(expr.arguments[0])
which is not working if there's string concatenation. My knowledge about webpack plugins is limited, perhaps someone has an idea?The use for this string concatenation is in combination with the html-webpack-plugin.
For each site I define a template variable with the name of the site and use it to get the translation for the header title.
Yeah, es6 template would be better. But as in #6 described it's not working.
The text was updated successfully, but these errors were encountered: