i18n icon indicating copy to clipboard operation
i18n copied to clipboard

change available languages at runtime

Open cany748 opened this issue 1 year ago • 14 comments

Describe the feature

there are times when i18n options need to be changed at runtime. now there is no way to do this, or I did not find how to do it. i see this one as Nuxt hook before initialization Vue I18n.

specifically, I need the functionality of limiting available languages based on information from useRequestHeaders

Additional information

  • [X] Would you be willing to help implement this feature?
  • [ ] Could this feature be implemented as a module?

Final checks

cany748 avatar Aug 02 '23 10:08 cany748

Thank you for your feedback. I backed from short vacation.

would you like to get more information from you about the use case with more detail and some codes. we would not be able to understand your issue...

kazupon avatar Aug 10 '23 07:08 kazupon

I want to have a nuxt hook named "i18n:config" that will allow me to extend and change the configuration of a module. just like on vite

cany748 avatar Aug 11 '23 05:08 cany748

Hey guys , i have the same problem and i want set locales from my CMS with API request ..

yazdanqm avatar Oct 18 '23 07:10 yazdanqm

Since the module relies on the build step to generate configs and routes it may not be possible to extend/add locales at runtime.. (at least right now).

Limiting/disabling configured locales should be possible already using a middleware I think, could you provide some examples of what the usage of this feature would look like?

BobbieGoede avatar Oct 18 '23 09:10 BobbieGoede

Since the module relies on the build step to generate configs and routes it may not be possible to extend/add locales at runtime.. (at least right now).

Limiting/disabling configured locales should be possible already using a middleware I think, could you provide some examples of what the usage of this feature would look like?

yes , we have a shop builder with some templates, we created some plugins for our users that one of them is multi language plugin. so users can turns the plugin on or off or they can select their default locale from the panel. i want to make default locale or i18n object dynamic. i think this is a useful feature

yazdanqm avatar Oct 18 '23 09:10 yazdanqm

Yep, we have a very similar use case to @yazdanqm as well. This one would be nice to have, otherwise we need to do cross-checking in multiple places between our available locales and the complete set of locales defined in our nuxtI18n config

gbyesiltas avatar Oct 18 '23 10:10 gbyesiltas

Lazy-load translations

nuxt-project/ ├── lang/ │ ├── en-US.json │ ├── [code].ts ├── nuxt.config.ts

Thy3634 avatar Nov 10 '23 09:11 Thy3634