6

I don't think this has ever been asked on StackOverflow. I'm writing a C# program, but this question applies to any programming language under Windows 7.

Since I want to make my program compatible with as many countries as possible (but with limited time at hand), what are the top 10 most common locales to test for? Since I'm using C#, this can be found by using:

CultureInfo.CurrentCulture.ToString()

As far as I know, these correspond with the items under: Control Panel -> Region and Language -> Format

A no-brainer to test for would be "English - (United States)" (which under C# is "en-US"). That's just one though - I'm looking for another 5-10 or so.

The top 10 should also include 'variety'. For example, if they all used the period as the decimal point, that wouldn't be very helpful. I'd also want at least one to use the comma as the decimal point (as Europe, South America, Russia, and others do).

Likewise, I'd want locales which use the '.', '/' and '-' as the date separator.

So my original question is now a bit more complex, but potentially much more useful. I want the most used locales, but with a slight to moderate bias towards variety so that I can generalize testing more easily with a much better guarantee that they will work under untested locales.

Dan W
  • 3,520
  • 7
  • 42
  • 69
  • This is not really a programming question - it is a demographics question. – Oded Mar 14 '12 at 22:14
  • It applies to programming though - as bugs can easily crop up in other countries which appear to work fine locally. Where else would I be able to post this question? – Dan W Mar 14 '12 at 22:32
  • That it applies to programming is immaterial - it applies to marketing and sales too. I don't know where it does belong, but I don't believe it belongs on SO. – Oded Mar 15 '12 at 09:36
  • I tend to see it as the intersection between marketing and programming, especially because of the locale/symbol slant (filtering out locales which are 'similar'). Yes, this question is relevant in say, a Windows marketing forum (?), but it can't do any harm being here as well. I think I was hoping many other programmers already had the same problem, and were able to answer this. – Dan W Mar 15 '12 at 09:58

3 Answers3

18

After an hour's search, the best I could come up with was a few links supplying a 'top 10' based on their own feedback. In an effort to help other users, I've combined the results to produce this probably moderately to wildly inaccurate top 12 list:

C# code  URL pos   Windows region format       Short date   Long time    xyz
en-US    1,1,1     English (United States)     M/D/yyyy     h:mm:ss tt   .,,
zh-CN    2,2,20    Chinese (simplified, PRC)   yyyy/M/d     H:mm:ss      .,,
ru-RU    4,10,5    Russian (Russia)            dd.MM.yyyy   H:mm:ss      , ;
fr-FR    8,5,7     French (France)             dd/MM/yyyy   HH:mm:ss     , ;
es-ES    5,9,10    Spanish (Spain)             dd/MM/yyyy   H:mm:ss      ,.;
en-GB    11,7,2    English (United Kingdom)    dd/MM/yyyy   HH:mm:ss     .,,
de-DE    12,3,3    German (Germany)            dd.MM.yyyy   HH:mm:ss     ,.;
pt-BR    10,6,10   Portuguese (Brazil)         dd/MM/yyyy   HH:mm:ss     ,.;
en-CA    14,8,12   English (Canada)            dd/MM/yyyy   h:mm:ss tt   .,,
es-MX    13,13,13  Spanish (Mexico)            dd/MM/yyyy   hh:mm:ss tt  .,,
it-IT    16,6,-    Italian (Italy)             dd/MM/yyyy   HH:mm:ss     ,.;
ja-JP    15,8,30   Japanese (Japan)            yyyy/MM/dd   H:mm:ss      .,,

x = Decimal symbol. y = Digit grouping symbol. z = List separator. The three numbers in the URL rating represent how far up in each list the locale was.

Sources:

One can use this URL to convert between region and the C# code: http://www.csharp-examples.net/culture-names/

Below is the final filtered list I personally will be checking for. I've removed cultures which are similar or nearly similar to other cultures (mainly in terms of dates, times, and symbols/separators;- if your criteria is something else, I would pay more attention to the above list). I've also added Bengali (India) and Danish (Denmark) which are quite different to the others.

C# code   URL pos  Windows region format       Short date    Long time    xyz
en-US     1,1,1    English (United States)     M/D/yyyy      h:mm:ss tt   .,,
de-DE     12,3,3   German (Germany)            dd.MM.yyyy    HH:mm:ss     ,.;
fr-FR     8,5,7    French (France)             dd/MM/yyyy    HH:mm:ss     , ;
zh-CN     2,2,20   Chinese (simplified, PRC)   yyyy/M/d      H:mm:ss      .,,
es-ES     5,9,10   Spanish (Spain)             dd/MM/yyyy    H:mm:ss      ,.;
ru-RU     4,10,5   Russian (Russia)            dd.MM.yyyy    H:mm:ss      , ;
en-GB     11,7,2   English (United Kingdom)    dd/MM/yyyy    HH:mm:ss     .,,

bn-IN     -,-,-    Bengali (India)             dd-MM-yy      HH.mm.ss     .,,
da-DK     -,-,-    Danish (Denmark)            dd-MM-yyyy    HH:mm:ss     ,.;

x = Decimal symbol. y = Digit grouping symbol. z = List separator

Dan W
  • 3,520
  • 7
  • 42
  • 69
6

One tricky aspect to globalization is handling right-to-left (RTL) languages. So I would include a locale that uses Arabic (or Hebrew) in your list, such as ar-EG "Arabic (Egypt)".

You could also take the pseudo-locale approach and test using the .NET-supported pseudo-locales, which exhibit peculiarities that can expose globalization bugs. There are three of them, "Base" (which is convenient as it produces intelligible text such as "[Шěđлеśđαỳ !!!], 8 ōf [Μäŕςћ !!] ōf 2006"), "Mirrored" and "East Asian-language".

Clafou
  • 15,250
  • 7
  • 58
  • 89
  • Note that to successfully build .NET apps that use pseudo-locales, you may have to configure your system. See http://stackoverflow.com/questions/8577187/getting-visual-studio-to-build-pseudo-language-qps-ploc-satellite-assemblies – Clafou Mar 15 '12 at 10:56
  • Thanks - never knew about pseudo-locales before. – Dan W Mar 15 '12 at 12:49
-3

If we go by the popularity of languages worldwide:

http://www.wolframalpha.com/input/?i=top+10+most+spoken+language

As far as 'variety', this isn't a language forum.

stan
  • 4,885
  • 5
  • 49
  • 72
  • 1
    Thanks, though this doesn't account necessarily for the computer users under that language. Nor does it account for the 'variety' bias that allows me to test for as few locales as possible with better chance they'll generalize across the sphere. Finally, I want Windows locales, not the languages themselves. – Dan W Mar 14 '12 at 22:15