Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have my own thoughts how "ideal" multilingual web application or web site should behave. Can you think of better solution? What are the pros and cons of them? What are cons of the solution I am presenting bellow? Any comments?

My "ideal" solution:

  • application should read browser language (from Accept Language header)
  • user should be able to override his/her default language in options (logged-on users will see the web site in this language no matter of current browser settings; useful when one is travelling for example)
  • on top of this, when lang attribute is specified in URL (see example bellow), user will see the page in language specified by this attribute (both accept language and user settings would be overridden; this could be useful for book-marking, sharing, RSS feeds selection, web crawlers).

Example URL: http://www.example.com/index.html?lang=ex

share|improve this question
    
That looks good to me, I have to say. I'll be interested to see if anyone has anything to add. –  glenatron Oct 27 '10 at 12:00
add comment

2 Answers

One definite Pro from your approach is that it takes into account users traveling to international locations. I have recently moved to an Arabic speaking country and can't tell you how frustrated I get everyday with the numerous web applications that provide me with the Arabic version of the site, because they use my IP to find my location and present the site in that locations language.

share|improve this answer
add comment

Your approach looks pretty good. I'd add only one more thing: say that the browser language (from the accept language header) is X, but when you try to determine the user's actual location (via IP or geolocation API), you get some place that uses language Y. In that case, I'd probably default to the browser language X (just as you were initially planning) but find a place in the UI to ask the user if they'd rather switch to language Y. If they say no, remember this (via cookie, session, or store with their account) and don't ask again. This same approach also works well if you add support for new languages that weren't supported before.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.