This question might me hilarious obvious but ... I have searched the web and stack overflow but did not find a satisfying answer.
What makes a good start for adding language selection to a web site?
My urls will be
example.com/de/ example.com/en/
to indicate the current language, plus a cookie set after I determined the initial language.
Upon landing on example.com I will check for a (recent) cookie first, then for ACCEPT_LANG then if a specifiy url is given with /en/, /de/.
The language will always be part of the url to allow bookmarking, i.e. I will redirect to example.com/de/ if I have determined that the users intention is to see the site in German.
Now my question: What is the preferred way these days to signal the server the users choice? I am not talking about the visual selection (drop down vs. language list à la wikipedia) nor geolocating vs ACCEPT_LANG but the user signaling the server. I have in mind: (Assuming the user is on English site and wants to switch to German site)
Other possibilities or what is the best technically seen?
My personal favorite is along the lines of solution 3 because it means you have a specific 'Change language' request where you can do specific processing, such as saving the preference in the cookie.
Simply using client-side wizardry to modify the URL doesn't tell the server that user actually wants to switch language. It may simply be that user landed on this language-specific page coming from a Google/Bing/Whatever search, in which case, user didn't actively chose a language, hence the choice should not be stored in the cookie.
(I'm not sure I understand what you mean in solution #2. Can you please clarify?)
BTW, pleaaaaase, no geolocation based language selection. I can recognize presto all sites that do that: They display in Dutch because I'm Belgian and 60% of the belgian population are Dutch speakers. Bad luck for the 40% of us French speakers, eventhough our Accept Language is set to French :-(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With