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

Translations flicker #169

Open
CommanderRedYT opened this issue Mar 15, 2023 · 6 comments
Open

Translations flicker #169

CommanderRedYT opened this issue Mar 15, 2023 · 6 comments

Comments

@CommanderRedYT
Copy link

On browser page load (initial load before next-clientside-loading takes over or pressing F5), the translation-keys will appear for a short time until translation files are loaded.

I am using the basic public/locales/<lang>/foo.json structure and no NextJS routing (no /de-DE/bla)

@vladislavdev58
Copy link

Hello @CommanderRedYT. Were you able to fix the problem?

@CommanderRedYT
Copy link
Author

Hello @CommanderRedYT. Were you able to fix the problem?

Nope, eventually swapped to next-i18next only

@vladislavdev58
Copy link

vladislavdev58 commented Apr 9, 2023

@CommanderRedYT
Pass the received language to fallbackLng
...(await loadTranslations({ ...ni18nConfig, fallbackLng: language }, language, ['translation']))

And use i18next-browser-languagedetector

@ayushxshukla
Copy link

ayushxshukla commented Feb 5, 2024

@CommanderRedYT Pass the received language to fallbackLng ...(await loadTranslations({ ...ni18nConfig, fallbackLng: language }, language, ['translation']))

And use i18next-browser-languagedetector

@vladislavdev58 Could you explain, where do we need to make these changes exactly, and how they impact the flickering. Thank you so much for giving me hope that the flickering can be solved :)

@Pudge1996
Copy link

Same problems

@abdallhsamy
Copy link

a temporarily solution is to move content to a separated component

import HomepageComponent from "@/components/HomepageComponent";

export default function  Homepage() {
  return (
      <HomepageComponent />
  );
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants