BeeSection BeeSection

How it works inside - why the site opens in Ukrainian even when the browser is set to Russian

The order of language selection on the site and the booking pages - the person's choice, then the region, then the browser language. Why the region ranks above the browser and how we learn it.

BeeSection · · 3 min read
Read in another language: Русский Українська

A visitor from Kyiv with a Russian-language system opens beesection.com. Which language should they see? The answer is less obvious than it seems, and ours has changed.

The order

The language of the first load is determined in this order, the same for the site, the CRM and the booking pages:

Language selection order

  1. The person's explicit choice. Switch the language in the header and it is remembered in a cookie for a year; no default overrides it.
  2. A visitor from Ukraine gets Ukrainian. Regardless of the browser language.
  3. Otherwise the browser language, if it is one of the supported ones: Ukrainian, Russian, English.
  4. Otherwise the default, Ukrainian.

The second step ranks above the third not for ideological reasons. The law on the state language requires that the web presence of a business serving consumers in Ukraine loads in the Ukrainian version by default. There used to be no second step, and a visitor from Kyiv with a Russian system got the Russian version on first load.

How we know the region

All traffic goes through Cloudflare, which adds a header with the visitor's country to every request. We read it on the server. The values "unknown" and "Tor" do not count as a country: then the third step applies.

In the app that loads in the browser it is too late to ask the server before the first render, so there the region is determined by the device's time zone: the "Kyiv" zone means Ukraine.

The address carries the language too

On the site the language is in the address: /uk/…, /ru/…, /en/…. An address without a language opens by the rules above, and an address with a language opens exactly that language and remembers the choice. So a link you forward to a colleague opens for them in the same language as for you.

For search engines each language version is a separate page linking to the other two, so Google shows a Ukrainian user the Ukrainian version rather than a random one.

Why not just the browser language

The browser language is the device's interface language, and it often does not match the language a person wants to read in. A phone bought with a Russian interface and never reconfigured is in half the country's pockets. The region is more reliable in that sense: a person in Ukraine almost always reads Ukrainian, and if not, they switch once and we remember.

Tags: #Security
Was this article helpful?

Related articles

Comments

No comments yet. Ask your question — we answer within a day.

Leave a comment

Your email is not published. We use it only to answer you.