Ways to have a multilingual website without changing domains? [closed]

Such example would be www.meetup.com
if you scroll all the way down to the footer, you can see a drop down box for languages.
When a language is selected, the website content switches languages to the one the user selects.

What method is this. As the website does not switch to a subdomain such as test.com –> en.test.com.

Please be elaborate in your answers, as this may help others in need to find out.

like always, thank you

Answer

meetup.com does a reload of the page after the selection is made and stores the MEETUP_LANGUAGE as a session cookie.

MEETUP_LANGUAGE = language=es&country=

There is no special method for this. Their code probably reads this cookie and loads the corresponding localized content.

Some other ways to determine the language for the user would be to get the language preference from the browser or HTTP request header. Or determine the locale of the client ip address.

Leave a Reply

Your email address will not be published. Required fields are marked *