A Russian visitor saw English in every shop: how a store should choose language and currency

· Basklee
How a shop should choose language and currency for each visitor, in four steps.


The problem #

One of our shops sells in Russian, English and Spanish. A visitor from Moscow with a Russian browser opened it and got English, in every template. The shop had a Russian version. Nobody offered it to them.

The cause was common and dull. When nothing else was set, the shop opened in its first language in the list. For many shops that was English.

The usual fixes cause new problems:

We build Basklee, a platform for online stores, and its storefronts run on Nuxt, Next.js and SvelteKit. We wanted one rule for all of them.

Idea 1. Four steps, always in this order #

Each visit picks the language like this:

  1. A language in the link (?locale=es) wins over everything. A search result or a shared link to the Spanish page shows Spanish.
  2. The visitor's own choice. If they used the language switcher, that choice is kept for a year.
  3. The browser's languages, in the visitor's own order of preference.
  4. The shop's main language, only when none of the above matches.

Matching is forgiving: ru-RU finds ru, and en finds en-GB if the shop only has British English.

The catch: a link with a language shows that language, but it doesn't overwrite a saved choice. The next visit without the parameter goes back to what the visitor picked.

Idea 2. Only a click saves a choice #

Opening a page in Spanish through a link does not make Spanish the visitor's language. Only a click on the switcher does that. This is what stops a single shared link from quietly changing someone's shop forever.

Idea 3. Currency follows the same rule #

Each language has a usual currency, but a visitor who picked a currency keeps it. That works only while the shop still allows that currency, so if the owner turns it off, the visitor falls back to the language's own currency. Language and currency are saved together, in two small cookies. The privacy page and the cookie notice name both of them.

Idea 4. The first screen is already right #

The choice is made on the server, from the link, the saved cookies and the browser's language header. So the first page a visitor sees is already in the right language and currency. The page doesn't flash English and then switch, and prices don't jump after the page loads.

That matters for search too. A search engine's crawler has no cookies and usually no browser language, so it gets either the language named in the link or the shop's main language. And the shop's sitemap lists every page in every language, with links between the language versions, so search engines can show each version to the right people.

What we checked #

The same rule went into every storefront kit and every template. On a live shop:

What to expect, honestly #

The browser language is a guess. Many people run their browser in English. We check that first when someone says "it opens in English".

A saved choice lasts a year on that device, and a new device starts over.

No IP detection. That is on purpose: language isn't the same as country.

How do your shops pick a language for a first-time visitor: by browser, by IP, or with a pop-up that asks?