nuxt-modules / i18n

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

refactor: pass generated options through `runtimeConfig` #2828

Closed BobbieGoede closed 8 months ago

BobbieGoede commented 8 months ago

πŸ”— Linked issue

❓ Type of change

πŸ“š Description

Replaces #2734

I would still like to improve the type in ModulePublicRuntimeConfig so users know which values cannot be configured using runtimeConfig, for example those used during route generation, should I mark these @internal using JSDocs?

By using runtimeConfig to pass the generated options we can reduce the complexity of our generated options templates (#build/i18n.options.mjs and #internal/i18n/options.mjs) and will make it easier for us to add runtimeConfig support for options used exclusively during runtime (detectBrowserLanguage for example).

I had to add configLocales to the runtime config as locales was already used for runtime domain support, we should probably merge these configurations for v9.

πŸ“ Checklist

kazupon commented 8 months ago

I would still like to improve the type in ModulePublicRuntimeConfig so users know which values cannot be configured using runtimeConfig, for example those used during route generation, should I mark these @internal using JSDocs?

Yes! We should mark as @internal and summary note for developer.