NuxtN
Nuxtβ€’2y agoβ€’
32 replies
Polak

i18n fallback issues

Heya people. I've recently moved away from NextJS over to Vue and I'm trying to setup the most important things and one of them is i18n. It works so smoothly compared to next and I love it so far. One thing I am not happy with though is the fallbackLocale feature on the i18n package. The documentation says I should do it in this way but the editor says it is wrong. Any ideas?

i18n: {
        lazy: true,
        langDir: "locales",
        strategy: "prefix_and_default",
        defaultLocale: "en",
        fallbackLocale: ['en', 'fr'],
        locales: [
            {
                code: "en",
                iso: "en-US",
                name: "English",
                file: "en-US.json"
            },
            {
                code: "da",
                iso: "da-DK",
                name: "Dansk",
                file: "da-DK.json"
            }
        ]
    }


Documentation says I should it like this:
fallbackLocale: 'en',


But I get the error:
Object literal may only specify known properties, and 'fallbackLocale' does not exist in type 'Partial<ModuleOptions>'.

^ On line with "fallbackLocale"

Any suggestions? πŸ˜„
Was this page helpful?