Routing a QR code by language: one visitor, one language

A multilingual menu from one printed code sounds simple. Here is the mistake that gives a French speaker the German menu, and how language routing should work.

By The QRtoMany team3 min read

A restaurant in Geneva prints one code on every table. French speakers should get the French menu, German speakers the German one, Spanish speakers the Spanish one, and everyone else English. It sounds like the simplest routing there is. It hides a mistake that is easy to make and hard to spot.

Language is not country

The first temptation is to route by country: Switzerland gets French. But country says where the network is, not what the person reads. A German-speaking tourist in Geneva, a French expat in Zurich and an English-speaking visitor anywhere all break a country rule. On a code on a restaurant table, that is a lot of the people who scan it.

Language comes from somewhere better. Every browser sends an Accept-Language header: the languages its user reads, in order of preference, taken from the phone's settings. A Swiss browser set up in French typically sends:

fr-CH, fr;q=0.9, de;q=0.7

In words: Swiss French first, then any French, then some German.

The mistake: matching any language on the list

Rules are checked from the top, and the first one that matches wins. Now imagine a German rule placed above the French one, and a language condition that asks "does this browser accept German?"

The French-first browser above does accept German, at q=0.7. So the German rule matches, it is first, and a French speaker gets the German menu. Nothing warns you. The rules look right, and the scans count as matched. This happened in an early version of our own routing, before launch.

The problem is that "accepts German" ignores the order the person put their languages in, and that order is the whole point of the header.

The fix: each scan is one language

Before any rule runs, we decide which one language the scan is, and every language rule tests that one language:

the visitor's highest-ranked language that one of your rules serves, or, if none of your rules serves any of their languages, their first language.

Rule order no longer changes the answer for language. The French-first Swiss browser is French whether the German rule sits above the French one or below it. Try the Swiss scans here:

A menu in the scanner's language

A table code that opens the menu in French, German, Spanish or English, matching the browser's highest-ranked language among the four. A scan counts as one language: the browser's highest-ranked one that a rule serves — which is why English has a rule of its own here, not just the fallback.

Rules are checked from the top. The first enabled rule that matches the scan decides where it goes, and a scan no rule matches goes to the fallback. Pick a scan or set your own, and the rule that decides it is highlighted.

  • Switzerland (CH)

Leave empty to simulate a scan whose country is unknown (a VPN, or an address that can’t be placed).

The region the scan comes from, in the country above — the code a real scan reports alongside its name. Best-effort for real scans. Leave blank to simulate as unknown.

In order of preference, the way a browser sends them — or paste a real Accept-Language header. Leave blank to simulate as unknown.

The instant of the simulated scan.

Used by rules set to "scanner's local time". Leave it blank for a scan from a location we can't place: like a real one, it's read in UTC.

More scan details — in-app browser, OS version, city, location, scan number, returning visitor, referrer

Browsers differ in what they report — see what a real scan from this one tells the edge below.

The version the device really runs. Leave blank for a current one — every phone reports some version.

A real scan reports the continent along with the country, so it's taken from the country unless you pick one.

As a scan reports it — usually the English name (Munich, not München); case and accents don’t matter. Leave blank for unknown.

For distance rules. A real scan is placed near its city's centre, and only roughly. Leave blank to simulate as unknown.

For distance rules. A real scan is placed near its city's centre, and only roughly. Leave blank to simulate as unknown.

Which of the code's counted scans this is — 1 is its first. Only scans that reach a destination count: not bots, and not scans that stop at a password or age prompt or a warning page. A scan limit of 100 serves scans 1 to 100. Real scans are counted approximately: when many people scan at the same moment some can get the same number, so a busy code may serve some past a limit or an "at most" rule. Leave it blank to simulate a scan made while the counter couldn't be read, which no scan-number rule matches.

No enabled rule here reads this, so this choice changes nothing — and a real scan of a code with these rules sets no returning-visitor cookie. Add a returning-visitor rule and scans are remembered from the moment it is published.

Leave blank to simulate this as unknown.

No version entered, so this tests a current iOS 26 — enter one to test another.

What a real scan from this device tells the edge: iOS 26.

The User-Agent this device's browser sends, which the edge reads: Mozilla/5.0 (iPhone; CPU iPhone OS 18_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1

Resolves to https://example.com/menu/fr, via "French".

Language rules see this visitor as fr-ch — the first language in their list that one of your rules names, or their first language if no rule names any of them.

  1. FrenchMatched

    language is fr — simulated value: fr-ch

    → https://example.com/menu/fr

  2. GermanNot reached

    → https://example.com/menu/de

  3. SpanishNot reached

    → https://example.com/menu/es

  4. EnglishNot reached

    → https://example.com/menu/en

Your changes stay in this tab and are gone when you leave. On your own codes, routing rules come with Pro and above, and A/B splits and rotations with Business and above.

Both Swiss browsers accept French and German. Each gets the menu in the language it ranks first.

Why "that one of your rules serves", rather than simply the visitor's first language? Because of the most common multilingual scan there is: a Japanese tourist whose phone sends ja, en;q=0.9, in a Paris restaurant with French and English menus. There is no Japanese menu, and English is the next best thing, so they get the English menu, not whatever the fallback happens to be.

One trade-off to know about

The fallback destination has no language as far as the routing knows. So consider a code with a French rule only, and an English menu as the fallback. A visitor whose browser sends en, fr;q=0.5 listed French, and French is the only language your rules name, so they get the French menu, even though English was their first choice.

The fix is simple: give the fallback's language a rule of its own. Add an English rule pointing to the English menu, and the English-first visitor gets English again. The rule builder reminds you of this when you create a language rule.

Practical advice

  • Route language by language, not by country. Use country for currency, shipping or legal differences.
  • Name every language you serve, including the one your fallback is written in.
  • Use the language alone (fr) unless you really have different pages for regional variants. fr matches every French; fr-CA matches only Canadian French.
  • Test with real browser headers. The scan simulator in the dashboard accepts a header exactly as a browser sends it and resolves it with the same code as live scans.

About the author

The QRtoMany team

We build QRtoMany, a dynamic QR code service designed around one fact: a printed code can't be recalled. These posts are written from what we have built, and the numbers in them come from the product itself.

Try the routing on your own codes

Create a free account to get started, then request Pro to route your own codes — or make a static code with no account at all.

All posts
Routing a QR code by language: one visitor, one language · QRtoMany