Skip to content

Auto-redirect to localized versions#2975

Closed
OphirBleicher wants to merge 0 commit into
jdm-contrib:masterfrom
OphirBleicher:redirect-localized
Closed

Auto-redirect to localized versions#2975
OphirBleicher wants to merge 0 commit into
jdm-contrib:masterfrom
OphirBleicher:redirect-localized

Conversation

@OphirBleicher

Copy link
Copy Markdown
Contributor

Hi!
This PR fixes issue #496 to auto-redirect the users to the localized version of the site, by their browser settings.

Summary

  • Added a new en.html page. The root of the site serves the English translation, and to make the redirection work cleanly, the en.html page serves the exact same English translation.
  • Added a script file called redirect.js. The file ensures that every user who comes to the root page only will be redirected to the localized page (users whose their language is English will be redirected to en.html). The root page still shows English for SEO.
  • If the user's language is not supported by the site, the site doesn't redirect and the user stays on the root page (which is in English).
  • When adding a new language to the site, the contributors now must add it to _includes/header.html on line 35 either. Updated CONTRIBUTING.md to inform the contributors.
  • Added an "auto" option on the language dropdown so users who are already in a localized version of the site can choose to auto-redirect them without changing the URL to the root page.
  • It's important to say that if the users are already in localized pages, they won't be redirected.

Testing

Everything was tested locally using Jekyll as described in README.md.

Thank you,
Ophir Bleicher.

@OphirBleicher OphirBleicher deleted the redirect-localized branch June 25, 2026 04:42
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

Successfully merging this pull request may close these issues.

1 participant