Cannot import default instance of I18n
See original GitHub issueThe documentation states :
lingui-i18n still exports the default instance of I18n class, this remains unchanged:
import i18n from 'lingui-i18n'
But if I try to import it in my tests I get the warning:
"export 'default' (imported as 'i18n') was not found in 'lingui-i18n'
Same if I try to import the instance in the application itself.
Importing setupI18n
works as expected.
import { setupI18n } from 'lingui-i18n';
const i18n = setupI18n();
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to import i18n in Vue file - Stack Overflow
If you'd like use vue-i18n, in your main.js you should import vue-i18n library first and create an i18n variable like this:
Read more >i18n-js - npm
First, you need to instantiate I18n with the translations' object, the main class of this library. import { I18n } from "i18n-js"; ...
Read more >How to properly internationalize a React application using ...
pass the i18n instance to react-i18next. .use(initReactI18next) ... );export default Footer;// imported in our App.js and used like this // <Footer t={t} />....
Read more >Translation | Django documentation
Defaults to None , which means that all available translations from all INSTALLED_APPS are provided in the JavaScript output. Example with default values:...
Read more >A Guide to React Localization with i18next | Phrase
To finish our setup, we just need to import our initialized i18next instance into our index.js file. This ensures that the file is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing, unfortunately this is common caveat when mixing named and default exports.
I’ve added named
i18n
export and recommend use it to avoid confusion. Default export will be removed in 2.0.I was thinking about dropping this default export completely, so we get rid of one global object, but that’s another topic. I’ll check if there’s nothing we can do about mixing default and named exports.