3
votes

Sometime between Windows 7 and Windows 8, Microsoft changed the localization of NaN in de-DE (aka German (Germany)) from:

n. def.

to

NaN

Background

There are people on Earth who speak a language other than English; and who speak English in a country other than the United States.

As a result, different cultures have different ways to display a value that is "Not a number". For example:

  • English: NaN
  • Arabic: ليس برقم
  • Greek: μη αριθμός
  • Alsatian: Ohne Nummer
  • Basque: EdZ
  • Breton: NkN
  • Catalan: NeuN
  • Chinese: 非数字 (Simplified)
  • Chinese: 非數字 (Traditional)
  • Chinese: 不是一個數字 (Traditional, but in Taiwan)
  • Corsican: Mica numericu
  • Czech: Není číslo
  • Dari: غ ع
  • Dutch: Niet-een-getal
  • Estonian: avaldamatu
  • French: Non Numérique
  • Galician: NeuN
  • German: n. def.
  • Hebrew: לא מספר
  • Hungarian: nem szám
  • Italian: Non un numero reale
  • Japanese: 非数値
  • Lower Sorbian: njedefinowane
  • Luxembourgish: n. num.
  • Mongolian: ᠲᠤᠭᠠᠠ ᠪᠤᠰᠤ
  • Polish: nie jest liczbą
  • Slovak: Nie je číslo
  • Tibetian: ཨང་ཀི་མིན་པ།

And German speakers use n. def.:

  • German (Austria): n. def.
  • German (Germany): n. def.
  • German (Liechtenstein): n. def.
  • German (Luxembourg): n. def.
  • German (Switzerland): n. def.

Note: What are all these variants of German, you're thinking? It's like the variants of English:

  • English (United Kingdom)
  • English (Ireland)
  • English (Australia)
  • English (New Zealand)
  • English (Caribbean)
  • English (Jamaica)
  • English (Trinidad)
  • English (Philippines)
  • English (Canada)
  • English (United States)
  • English (Belize)
  • English (Malaysia)
  • English (India)
  • English (South Africa)
  • English (Singapore)
  • English (Zimbabwe)

Until Windows 8

Sometimes between Windows 7 and Windows Server 2012, Microsoft changed (broke?) the localized string returned by GetLocaleInfo with LOCALE_SNAN for Germany (Germany) aka de-DE:

| Locale                 | Windows 7 | Windows Server 2012 |
|------------------------|-----------|---------------------|
| German (Austria)       | n. def.   | n.def.              |
| German (Germany)       | n. def.   | NaN                 |
| German (Liechtenstein) | n. def.   | n.def.              |
| German (Luxembourg)    | n. def.   | n.def.              |
| German (Switzerland)   | n. def.   | n.def.              |

What do you want us to do about it?

I'm hoping someone can confirm the regression, or perhaps that it's a declared bug.

I'm hoping someone can give a workaround (aside, of course, from detecting the OS version and returning custom values.

Note: GetVersionEx is deprecated and now always lies

I'm hoping that someone on the localization team might see this question and weigh in. Perhaps @MichaelKaplan; who is the single greatest source of localization and globalization information.

Really, i just want someone to say, "Yes, you're right, Microsoft broke it. We are where we are, so let it go."

1
Looks like someone almost filed a bug. Loving the "fix".bzlm
Regarding GetVersionEx(), in this scenario the new version helper API should be satisfactory. If you do have to resort to checking the Windows version, IsWindows8OrGreater() should be all you need.Harry Johnston

1 Answers

4
votes

I don’t think it qualifiers as a bug, because the CLDR data specifies that the localized string is NaN for most languages, including all variants of German. Software vendors increasingly use CLDR data, one way or another, so I think you should try and have the CLDR info for German changed if you think it is wrong.

However, consider the pros and cons. “NaN” is really a technical concept, referring to data (bit pattern) that is expected to be a number but isn’t a valid number. It is true that it may appear in output to end users, but you really need to understand the programming concept involved in order to understand what it means. The odds are that people who understand that know the string “NaN” but might fail to recognize a localized version thereof. I would even say that e.g. to a JavaScript programmer, “n. def.” can be misleading, as it suggests “nicht definiert”, which sounds like undefined, which is quite distinct from NaN.

(I am probably responsible for the Finnish localization in CLDR of this entry. The word “epäluku”, which would correspond to “Unzahl” in German I suppose, sounded good to me. But on second thought, it was probably all too clever. There is really no natural-language concept that corresponds to the concept.)