webpack-easyi18n 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack-easyi18n",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Go from gettext catalog (.po files) to embeded localization in your Webpack bundles",
5
5
  "engines": {
6
6
  "node": ">=4.3.0 <5.0.0 || >=5.10"
package/src/index.js CHANGED
@@ -167,10 +167,14 @@ class EasyI18nPlugin {
167
167
  }
168
168
  } else {
169
169
  // .po files use \n notation for line breaks
170
- const translationKey = nuggetSyntaxRemoved.replace(/\r\n/g, '\n');
170
+ const translationKeyRaw = nuggetSyntaxRemoved.replace(/\r\n/g, '\n');
171
+ const translationKey = unescapeJsLike(translationKeyRaw);
171
172
 
172
173
  // find this nugget in the locale's array of translations
173
174
  replacement = translationLookup[translationKey];
175
+ if (typeof (replacement) === "undefined") {
176
+ replacement = translationLookup[translationKeyRaw];
177
+ }
174
178
  if (typeof (replacement) === "undefined" || replacement === "") {
175
179
  if (this.options.warnOnMissingTranslations) {
176
180
  compilation.warnings.push(