Skip to content

fix: Flash of default language before applying user preference #126

@O2sa

Description

@O2sa

When a user's system or preferred language is not the default (en) (e.g., ar), the page initially renders in English and then re-renders in the expected language. This causes a noticeable flash of incorrect content and potentially hydration mismatches.

Tasks

  • Investigate the initialization logic in the language provider or layout.
  • Implement server-side language detection (via Accept-Language header, cookies, or Next.js middleware) so the initial HTML matches the user's preference.
  • Update the <html> tag's lang and dir attributes to be set correctly on the first server render.

Note

CONTRIBUTIONS ARE WELCOME!
If you want to get this issue assigned to you. Just comment 'assign me'. You will be assigned to the issue instantly via GitHub-actions bot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is neededui

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions