Closed riddla closed 7 months ago
Honestly the behaviour of installModule
is a bit confusing to me, from what I can tell it's not possible to support multiple modules using installModule
to install @nuxtjs/i18n
.
I will look into supporting it while keeping layers working at the same time, until then I recommend using a layer instead as a workaround.
This issue is similar/related to #2802
Hi, I just noticed I'm also running into this issue, and was trying to make a workaround, but without much success.
Could you expand a bit on the layers temporary solution you've mentioned please?
Chees!
I have the same problem :/. Module is installed but without any config. Other modules config works fine to me.
await installModule('@nuxtjs/i18n', {
trailingSlash: true,
strategy: 'prefix',
locales: [
{ code: 'en-gb', iso: 'en-GB', apiCode: 'en', dayjsCode: 'en-gb', name: 'English (United Kingdom)' },
{ code: 'en-us', iso: 'en-US', apiCode: 'en', dayjsCode: 'en', name: 'English (United States)' },
{ code: 'en-ca', iso: 'en-CA', apiCode: 'en', dayjsCode: 'en-ca', name: 'English (Canada)' },
{ code: 'nl', iso: 'nl', apiCode: 'nl', dayjsCode: 'nl', name: 'Nederlands' },
],
defaultLocale: 'en-gb',
detectBrowserLanguage: {
useCookie: true,
redirectOn: 'root',
},
vueI18n: './config/vue-i18n.ts',
});
For example useI18n().localeProperties
is only { code: 'en-gb' }
instead of { code: 'en-gb', iso: 'en-GB', apiCode: 'en', dayjsCode: 'en-gb', name: 'English (United Kingdom)' }
. Only config in nuxt.config.ts
make module works correctly.
Issue is closed, but for me problem still exist :/
@szulcus Can you provide a reproduction using the latest release?
Environment
Darwin
v20.10.0
3.9.1
3.10.0
2.8.1
yarn@1.22.19
-
-
-
-
Reproduction
https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-y1vnuv
Describe the bug
We are trying to install
@nuxtjs/i18n
from a custom module via Nuxt KitsinstallModule
method. So far @nuxtjs/i18n is not picking up the config file configured via thevueI18n
option. You can see the emptyVueI18nConfigPaths
array in the reproduction.Additional context
No response
Logs