Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option i18n for redirection #369

Open
IgorKha opened this issue May 12, 2024 · 0 comments
Open

Option i18n for redirection #369

IgorKha opened this issue May 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@IgorKha
Copy link

IgorKha commented May 12, 2024

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!

@IgorKha IgorKha added the enhancement New feature or request label May 12, 2024
@IgorKha IgorKha changed the title i18n option for redirect Option i18n for redirection May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant