Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Using default locale throws 'Missing localization' warnings #80

Open
cjayyy opened this issue Apr 8, 2019 · 0 comments
Open

Using default locale throws 'Missing localization' warnings #80

cjayyy opened this issue Apr 8, 2019 · 0 comments

Comments

@cjayyy
Copy link

cjayyy commented Apr 8, 2019

Bug report

What is the current behavior?
If null is passed as localization argument while creating new I18nPlugin instance, warning about missing localizations occurs.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Clone official example.
  2. Initialize npm project with dependencies.
  3. Define npm script: "build": "webpack"
  4. Run npm run build

Build succeeds but throws following warning:

WARNING in ./example.js
Missing localization: Missing Text

webpack.config.js:

const languages = {
  en: null,
  de: require("./de.json")
};

module.exports = Object.keys(languages).map(function(language) {  
  return {
    ...
    plugins: [
      new I18nPlugin(languages[language]) // in case 'language' is 'en' we get 'null'
    ]
    ...
});

What is the expected behavior?
If passing null is recommended way how not to translate default language, plugin should behave differently than if try to get missing translation.

Other relevant information:
webpack version: 4.29.6
Node.js version: v11.12.0
Operating System: macOS Mojave 10.14.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants