Cookies vs Language Detection (Browser vs Location) vs None of the two on multilingual websites

I have a dilemma with the following scenarios:

Dilemma No. 1

Cookies:

It is good for users who access the website from their personal computer (there is no need to choose the preferred language again), but what happens if someone selects a language on a public PC (for example, a library), then he doesn’t sense, because someone else may appear with the preferences of another language.

Dilemma number 2

Language Detection:

If the webpage detects a language from a location. What happens to foreigners living in this country? (Is it possible that foreigners living in the country use a browser that is configured in its language?).

(I already have a menu for choosing a language, but I think that “automation” is good.)

What could be the best solution?

+4
source share
4 answers

My preferences:

  • if the user is registered and has language preferences, use this language
  • locating a language using the Accept-Language 2.5 HTTP header (location)
  • fallback language (for example: en_US or more adapted to your target audience)

I'm not sure that locating a language by location is a really good idea, at the moment most locations for sharing devices are a mobile device, which can mean that the user is traveling. There is a foreigner, as you said. And in my case, I am French, living in France and still prefer the browser en_US.

+2
source

Language matching is a good choice when a new user visits a website for the first time.

But I would also make the language selection as simple and transparent as possible by putting the language identifier in a URL, for example /en/… With this URL, the selected language is transparent to the user and can be changed if necessary. Along with this specific language URL, I would also provide a language-independent URL without a language identifier.

0
source

What is wrong with both? Use cookies to determine your first language choice. Have a subtle version (possibly with graphics, for example, a flag) presented to change the option for browser locations / language if the wrong one is selected.

0
source

if we have the following ingredients:

  • cookies
  • ip location
  • language definition
  • language selection screen
  • available languages ​​for the site

then I (living in a 3-language country with very 4th English) would like my language to serve as follows:

  • if cookie with lang: show cookieLang
  • If there is no cookie:

    • IPloc = result IP address
    • detLang = language matching result
    • if (matching (e.g. IPloc = BE and detLang = FR) and available language), then set a cookie and show Lang detected
    • else (for example, there is no match for IPloc = IT and detLang = NL), then display the language selection screen, make a user selection, set lang to cookie and show the language of choice.

many sites here (belgium) simply show a language selection screen, and this is considered unacceptable for errors and a simple solution.

an alternative would be to register 2 (or more) URLs, for example. mybank.be, mijnbank.be and monbanque.be, all pointing to the same site. depending on the URL chosen by the user, the correct language is automatically selected.

0
source

Source: https://habr.com/ru/post/1302661/


All Articles