Add use array for plugins
See original GitHub issueCurrently, users cannot implement plugins because next-i18next
calls .init
on the i18n instance, and plugins via .use
must be called before .init
.
We should add a use
array to the next-i18next
config, so that we can simply do:
config.use.forEach(x => i18n.use(x))
i18n.init() // Somewhere later on
Note that server/client detection will remain a responsibility of the user. Implementation might look like:
const NextI18Next = require('next-i18next').default
const use = []
if (process.browser) {
use.push(someBrowserPlugin)
}
module.exports = new NextI18Next({ use })
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Add use array for plugins · Issue #28 · i18next/next ... - GitHub
Currently, users cannot implement plugins because next-i18next calls .init on the i18n instance, and plugins via .use must be called before .init.
Read more >merging an array to an existing array using add_filter
I have tried this method here Insert new element to array with add_filter but the output is just this Array ( [Hello5] =>...
Read more >Webpack using plugins array - Stack Overflow
Can we use array of plugins ? Yes, but your code is currently producing an array of plugins with another array of plugins...
Read more >How To Use Motion Array's Stretch Plugin for Premiere Pro
Check out our best Premiere downloads: https:// motionarray.com/browse?date_a... And check out our full article on this effect: ...
Read more >How to Install Motion Array Plugins for Premiere Pro
Learn how to install Premiere Pro plugins from Motion Array. The process really simple, so follow along to get up and running in...
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 Free
Top 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
Two liner solution: 14d494f.
We may in the future want to talk about removing the
.use
calls in create-i18next-client, but in my opinion they are a core part of the value added by using this package in the first place.@lucasfeliciano, @mshahov, and @kachkaev - I would appreciate your help testing this solution out. I’m going to release v0.8.0 now.
@lucasfeliciano I’m already working on it, no need for a PR. I’ll handle core features like this myself for the time being.