Skip to content

Option i18n for redirection #369

Open
@IgorKha

Description

@IgorKha

Good afternoon everyone! I am using a multilingual module (@nuxtjs/i18n and I use prefix_and_default strategy) and I have encountered the problem of multiple routes repeating in the config for each language

Here is an example of nuxt.config.ts configuration for supabase

supabase: {
    url: process.env.SUPABASE_URL,
    key: process.env.SUPABASE_KEY,
    redirect: true,
    redirectOptions: {
      login: 'login',
      callback: 'confirm',
      include: ['/bg/app(/.*)?', '/fr/app(/.*)?', '/app(/.*)?'],
      exclude: ['/login'],
      cookieRedirect: true
    },
}

Here is an example of nuxt.config.ts configuration i18n

i18n: {
    vueI18n: './i18n.config.ts',
    types: 'composition',
    strategy: 'prefix_and_default',
    defaultLocale: 'en',
    lazy: true,
    langDir: 'locales',
    locales: [
      {
        code: 'en',
        iso: 'en-US',
        name: 'English',
        nameEn: 'English',
        file: 'en-US.ts'
      },
      {
        code: 'bg',
        iso: 'bg-BG',
        name: 'Български',
        nameEn: 'Bulgarian',
        file: 'bg-BG.ts'
      },
      {
        code: 'ru',
        iso: 'ru-RU',
        name: 'Русский',
        nameEn: 'Russian',
        file: 'ru-RU.ts'
      },
      {
        code: 'fr',
        iso: 'fr-FR',
        name: 'Français',
        nameEn: 'French',
        file: 'fr-FR.ts'
      }
    ],
    detectBrowserLanguage: {
      useCookie: true,
      cookieKey: 'i18n_redirected',
      redirectOn: 'root'
    }
  }

Is it possible to add an option in the supabase setup that would avoid this problem?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions