nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.75k stars 483 forks source link

feat: `locales` generated type narrowing #2722

Closed BobbieGoede closed 10 months ago

BobbieGoede commented 10 months ago

🔗 Linked issue

❓ Type of change

📚 Description

This PR is built on top of #2714, I have it marked WIP/draft until that PR has been merged/reviewed.

Resolves #2628

Now that vue-i18n-routing has been fully integrated we have more control over the types, this PR changes the augmented vue-i18n types based on the generated options of a project. This way the locales type will be correctly inferred based on whether it was configured as string[] or LocaleObject[] in the configuration file (or that of extended layers).

📝 Checklist