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

💻 Use subdomains to navigate trhough languages #5829

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Conversation

jpelay
Copy link
Member

@jpelay jpelay commented Oct 3, 2024

Makes it possible to set the language through subdomains. In order to do this the following changes were made:

  • Every route in the page was duplicated to include a subdomain argument, otherwise pages wouldn't be accesible without being prefixed with the subdomain.
  • The set up language function was edited to take the subdomain as a parameter

Fixes #5720

How to test

In order to test this locally, we need to set an env variable that has a dot in it. The one I used was hedy.local, this name should be added to the hosts file in your system prefixed with the languages you want to test, for example

127.0.0.1 es.hedy.local hedy.local en.hedy.local

After doing this, before starting the server, you need to set the DOMAIN_NAME env variable export DOMAIN_NAME=hedy.local

After doing this you are set up to test the feature. You can navigate to nl.hedy.local:8080 and see that the language changes, and change it through the language selector. Also log in as a user, and change the preferred language there

@jpelay jpelay marked this pull request as draft October 3, 2024 22:58
@jpelay
Copy link
Member Author

jpelay commented Oct 3, 2024

I'm figuring out how to share sessions between the different subdomains.

@jpelay
Copy link
Member Author

jpelay commented Oct 8, 2024

I'm figuring out how to share sessions between the different subdomains.

Figured it out 😄

@jpelay jpelay marked this pull request as ready for review November 7, 2024 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

💻 change links for translated content
1 participant