question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locale visibly switches on redirecting with statically generated pages

See original GitHub issue

Version

nuxt-i18n: 6.15.1 nuxt: 2.14.0

Nuxt configuration

mode:

  • universal

Nuxt-i18n configuration

i18n: {
    locales: ['fr', 'en'],
    defaultLocale: 'fr',
    detectBrowserLanguage: {
      useCookie: false,
      onlyOnRoot: true
    },
    vueI18n: {
      fallbackLocale: 'en',
    }
  }

Reproduction Link

I tried to reproduce the bug on codesandbox (here) but it does only appear on my local and production environment (https://ç.dev). Note: if you want to see the bug on my production environment, set your Browser language to anything other than French.

Steps to reproduce

Install a default Static Nuxt site + the module with above configuration.

What is Expected?

The redirect to the english version of the site should be triggered before the french version of the site loads.

What is actually happening?

The french version of the site load for a brief moment, then it is switched to the english version. This cause content to “jump” quickly when the domain loads. Visit my production website to see the bug.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:23

github_iconTop GitHub Comments

3reactions
daishizenSenseicommented, Jan 28, 2021

Hello, did somebody find a solution for that issue? It’s a huge cost of TTI, which mean cost of customers 😃.

0reactions
rchlcommented, Apr 13, 2021

Since there is no way to fix that, I’ll close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Locale visibly switches on redirecting with statically generated ...
Reproduction Link. I tried to reproduce the bug on codesandbox (here) but it does only appear on my local and production environment Note: ......
Read more >
Static HTML Export with i18n compatibility in Next.js - DEV ...
Create a [locale] folder inside your pages directory. a) Move all your pages files to that folder (not _app.js or _document.js etc..).
Read more >
The complete guide to internationalization in Next.js
Learn how to make your Next.js app international with smooth translation features in this advanced, step-by-step tutorial.
Read more >
Dynamic Rendering | Google Search Central | Documentation
Implement dynamic rendering ... Dynamic rendering is a workaround and not a long-term solution for problems with JavaScript-generated content in search engines.
Read more >
Next.js server side redirection overrides the locale
Client side redirecting with router.push or router.replace is working fine and returning the correct urls. To my understanding I can't get the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found