Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fallbackLocale to nuxt.config options #2753

Open
2 of 4 tasks
warflash opened this issue Feb 3, 2024 · 2 comments
Open
2 of 4 tasks

Add fallbackLocale to nuxt.config options #2753

warflash opened this issue Feb 3, 2024 · 2 comments

Comments

@warflash
Copy link
Contributor

warflash commented Feb 3, 2024

Describe the feature

Figuring out how to set the fallbackLocale seems to be a quite common question and point of confusion (happened to myself just now and checked on the nuxt discord). It feels very natural to want to stick that property into nuxt.config and not create a seperate i18n.config.ts.

I'd like to propose the addition of that setting to the possible settings to the i18n object in nuxt.config. (If this has been asked and denied earlier then I apologize, couldn't find an issue though).
We're dealing with ~10 layer apps that extend off of a shared nuxt layer in a monorepo and adding 10 i18n.config files feels like an suboptimal solution for something that could also be achieved with a single line of code.

Thanks!

Additional information

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

Final checks

@BobbieGoede
Copy link
Collaborator

You're right, the configuration split between vue-i18n options and module specific options have clearly been a point of confusion.

I'm open to suggestions on how to improve/clarify this while taking into account the reasoning behind moving vue-i18n options to a separate file. I think the main issue was that vue-i18n configuration can contain non-serializable values such as functions, which we worked around using code generation.

@silvio-e
Copy link

silvio-e commented Mar 8, 2024

I was also struggling with this and needed quite some time to figure it out. I expected the config to work like it does for many other modules I have worked with. Configuration either in the nuxt.config or in an extra config file. But here it happens in two places.

Before any code changes I suggest to update the documentation and clarify following points:

  1. The difference/relation between nuxt/i18n & vue/i18n. If one hasn't worked with them it is confusing.
  2. Highlight what is nuxt/i18n config and what is vue/i18n config

I think this would help already very much.

@BobbieGoede BobbieGoede removed the v8 label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants