Multi instance of i18n
See original GitHub issueWhen the module is used in a project and the project has a module which use i18n module too, there are automatically some conflicts because the require
function return Singleton…
It could be fun to add a function to create multiple instances of the module like this fork. https://www.npmjs.com/package/i18n-factory
Why do not integrate this feature in the official package?
Regards,
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to have multiple instances of i18next for component library
How to have multiple instances of i18next for component library · Step 1: create i18next instance · Step 2: I18nextProvider.
Read more >Unable to have multiple i18next instances (React apps) on the ...
I have a page which contains 2 React apps, each having their own i18n.js config file like the one below. The last app...
Read more >i18next-react - how to have 2 instances of i18next in the same ...
I develop a component npm library that use 18next. the consumer of the library, also use 18next. we created instance for each and...
Read more >i18next instance
The instance is an initialized i18next instance. In the following code snippet, ... import i18n from 'i18next'; ... Multiple Translation Files.
Read more >I18n-support-multi-instance NPM | npm.io
Lightweight simple translation module with dynamic json storage. Supports plain vanilla node.js apps and should work with any framework (like express, restify ...
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
I found this issue that offers an alternative: - merge the json files as part of a build process . However, I find this practice sub-optimal for my case since when I have to update the translations I have a build step instead of a simple copy step.
I also have to duplicate / maintain this step inside the repo and maybe as a prodcution binary. There are solutions to this but why do that when a simple copy would work ok - if i18n has support for returning
new
objects instead of the singleton - which should be easy to do IMO.now… feature is released as of 0.12.0 with some extra sugar (shortcut to i18n.configure on creation):
see https://github.com/mashpie/i18n-node/tree/master#as-instance for details