fer's brain dump

How to address your user

April 14, 2021 // , ,
Filed under dev

When one does some dev job, for public facing systems or user installable apps, some design choices will allow later to replace languages relatively easily. i18n, as a single language/country domain problem, is largely solved by many frameworks and libraries. Some issues arise from localization, l10n, where you can have the same language, but certain things will change according to their country, like currency ($ vs €) or date format (d/m/y vs m/d/y), or the size of the paper you want to print in.

But I’m not gonna talk about that. What isn’t usually addressed is how to address your user.

Every user has their own situation and preferences, but for the sake of the argument let’s focus on me, mostly because I’m the case I’m the most familiar with.

I’m Spanish, living in France, speaking English, Spanish, French on a daily basis. I can get around in Russian, and I listen and read it daily as it’s the native language of my wife. I’m comfortable with Portuguese, and it’s an easy language to learn if you know Spanish; it feels like cheating. Then I can read languages like Galician, Catalan or Italian with relative ease, but can’t really communicate in them.

Personally, for user interfaces I just prefer English. It just works, it’s the most tested, and it’s rarely problematic. Using a different language, settings might become configuración or ajustes depending on the mood of the developer/translator, so navigating interfaces can be relatively painful if there’s no agreed standard on terminology.

When I’m reading content, if it’s any of the languages mentioned, I’d rather have the original, or a manually translated and equally complete version, rather than an automatically translated version or some inferior version. That usually means that I jump around multiple Wikipedia versions depending on the topic of the article. Science article? I usually stick to English. Obscure French comic artist from the 80s? French, duh.

Obviously no app shows this kind of granularity (I want interface in English and content in the original language when language in X,Y,Z), so my Firefox language preferences look like this.

Does anyone else use these language preferences?

Multilingual users can be fingerprinted very easily thanks to THIS little TRICK.

And it sort of works, sometimes.

Now, all that is how I go out to find information. How does a service or app address me, though? Some services might have a fair share of info about me, and they get to use it to address me.

fer.xyz’s method to choose the language to address your user with

  1. Use what the user explicitly told you.
    • Important: let your user explicitly tell you!
  2. If the user said nothing, use the available locale info, including, but not limited to:
    • LC_* variables in UNIX
    • Browser language preferences (the most widespread yet widely ignored browser feature)
    • OS/browser language
    • Active/available keyboard layouts
  3. Special treatment for addresses or landmarks
    • This goes largely on a case by case basis but, as a general rule:
      • If the user can read the local script, don’t translate nor transliterate.
      • If the user can’t read the local script, then you might translate or transliterate.
    • Examples:
      • 天安门 should become Tiananmen Square (or their language of choice) if nothing about the user points to them being able to read Han characters.
      • Under no circumstances should Rue de la République turn into Republic Street, or worse Улица Репюблк, since virtually all speakers of English and Russian are familiar with the Latin script.
      • Майдан Незалежності can be transliterated into Maidan Nezalezhnosti if the user doesn’t speak any language with a Cyrillic script, or translated to Independence Square if the user speak English.
  4. If no locale hint is available, then, and only then, you start using these options. If multiple options from below are available, take all into account.
    • Credit card number
      • It just tells where your user has a bank account. I’ve had French confirmation emails on bookings where the only French thing was my credit card. Wild take, but an informed take nonetheless. You can check how this works in Binlist.
    • Citizenship
      • Some airlines choose to address me in Spanish since I’m Spanish. Good guess, as most Spaniards speak Spanish, but it doesn’t work for countries with multiple languages, like Switzerland and Belgium. Sometimes it’s even more complicated: in Ukraine Russian isn’t official but it’s used as first language by a sizeable number of the population.
    • Phone number
      • It just tells where your user has a phone number. Can be more precise for landlines than mobile info as there are geographic hints, but still not really usable on its own.
    • Address
      • It just tells where your user lives. For a few years I couldn’t read more than basic French while living in France.
    • IP address
      • This is easily the most widely abused. Happens all the time that websites, even not based in France, show me content in French just because my IP is French, despite everything in point 2 hinting at just using English, plus 1 (yes, in places like Aliexpress you can choose a language, and the website will remember you, but not the language you picked and revert to French).
    • Origin/destination
      • Some airlines have done this and I can’t understand why. Just because I fly within Germany it doesn’t mean I speak German. Terrible approach. Last resort heuristic.

So yes, given a French citizen, with French address, who books a flight within France from a French IP and has a French contact number, it might be reasonable to assume they speak French, but as you lose more and more of those heuristics, your chances of getting it wrong just increase: do yourself a favor and trust what the user tells you, either directly or not.

Museum of donts

This section will be updated as I find donts

Google Maps + Street View

This is the main example of different devs having different opinions on the subject.

Maps show what I (and most people) would expect: the local address in the local language. At the same time, when accessing Street View, for some reason the Russian translation takes over (probably because of its presence in browser language preferences). If I speak French and Russian, please don’t transliterate French to Russian.

Iberia

This airline is pretty wild about this subject. When I connect, it automatically redirects me to https://www.iberia.com/fr/ because I’m in France.

Despite remembering my last search of Nice to Madrid, it didn’t remember my language choice, which was Spanish.

If I live in France, it only allows me to select French and Spanish. Both of them I understand, but it’s weird that there’s no English.

Actually English is there for countries whose main language is English, or when their main language isn’t available (Hebrew, in this case). That’s a terrible language experience. There are people in France who only feel comfortable in English.

Anyway, let’s have a look at the settings in my account:

No particular language setting other than the emails they send me. They don’t let me pick English on the website but it’s alright for emails. Consistency is lacking. Let’s have a look at their e-mails.

This is an excerpt. Before July 2019, it was just English, but from then on, it’s just randomly switching between English and French; no action on my part. Another case of different devs having different opinions.

Firefox

My work computer is a Windows 10, originally in French, but I installed all language packs and keyboards layouts to have it in English. Firefox Developer Edition seems very confused about it.

Creole Firefox

The véritable Firefox menu

This isn’t exactly new.

Creole Firefox (ii)

Developer tools aren’t spared

The common solution is to use the installer of the language you want to use, which is a PITA since the Mozilla webpage constantly tries to redirect you to your IPs country’s official language, and then again, what’s the purpose of language packs then?