Skip to content

Commit

Permalink
locales.conf: add some country numbers [#1579]
Browse files Browse the repository at this point in the history
@bk could you please check/add more of those?
  • Loading branch information
stsp committed Jan 16, 2022
1 parent 2a97d38 commit eebc4f2
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions etc/locales.conf
@@ -1,34 +1,34 @@
{
/* add your mappings below and send a patch */
"locales": [
{ "lang": "en_US", "codepage": "cp437" },
{ "lang": "cs_CZ", "codepage": "cp852" },
{ "lang": "en_US", "codepage": "cp437", "country": 1 },
{ "lang": "cs_CZ", "codepage": "cp852", "country": 42 },
{ "lang": "af_ZA", "codepage": "cp858" },
{ "lang": "ca_ES", "codepage": "cp858" },
{ "lang": "da_DK", "codepage": "cp858" },
{ "lang": "ca_ES", "codepage": "cp858", "country": 34 },
{ "lang": "da_DK", "codepage": "cp858", "country": 45 },
{ "lang": "de_AT", "codepage": "cp858" },
{ "lang": "de_CH", "codepage": "cp858" },
{ "lang": "de_DE", "codepage": "cp858" },
{ "lang": "de_CH", "codepage": "cp858", "country": 41 },
{ "lang": "de_DE", "codepage": "cp858", "country": 49 },
{ "lang": "de_LI", "codepage": "cp858" },
{ "lang": "de_LU", "codepage": "cp858" },
{ "lang": "en_AU", "codepage": "cp858" },
{ "lang": "en_AU", "codepage": "cp858", "country": 61 },
{ "lang": "en_BZ", "codepage": "cp858" },
{ "lang": "en_CA", "codepage": "cp858" },
{ "lang": "en_GB", "codepage": "cp858" },
{ "lang": "en_CA", "codepage": "cp858", "country": 1 },
{ "lang": "en_GB", "codepage": "cp858", "country": 44 },
{ "lang": "en_IE", "codepage": "cp858" },
{ "lang": "en_JM", "codepage": "cp858" },
{ "lang": "en_NZ", "codepage": "cp858" },
{ "lang": "en_PH", "codepage": "cp858" },
{ "lang": "en_TT", "codepage": "cp858" },
{ "lang": "en_ZA", "codepage": "cp858" },
{ "lang": "es_AR", "codepage": "cp858" },
{ "lang": "es_AR", "codepage": "cp858", "country": 54 },
{ "lang": "es_BO", "codepage": "cp858" },
{ "lang": "es_CL", "codepage": "cp858" },
{ "lang": "es_CO", "codepage": "cp858" },
{ "lang": "es_CR", "codepage": "cp858" },
{ "lang": "es_DO", "codepage": "cp858" },
{ "lang": "es_EC", "codepage": "cp858" },
{ "lang": "es_ES", "codepage": "cp858" },
{ "lang": "es_ES", "codepage": "cp858", "country": 34 },
{ "lang": "es_GT", "codepage": "cp858" },
{ "lang": "es_HN", "codepage": "cp858" },
{ "lang": "es_MX", "codepage": "cp858" },
Expand All @@ -41,33 +41,33 @@
{ "lang": "es_UY", "codepage": "cp858" },
{ "lang": "es_VE", "codepage": "cp858" },
{ "lang": "eu_ES", "codepage": "cp858" },
{ "lang": "fi_FI", "codepage": "cp858" },
{ "lang": "fi_FI", "codepage": "cp858", "country": 358 },
{ "lang": "fo_DK", "codepage": "cp858" },
{ "lang": "fo_FO", "codepage": "cp858" },
{ "lang": "fr_BE", "codepage": "cp858" },
{ "lang": "fr_CA", "codepage": "cp858" },
{ "lang": "fr_CH", "codepage": "cp858" },
{ "lang": "fr_FR", "codepage": "cp858" },
{ "lang": "fr_BE", "codepage": "cp858", "country": 32 },
{ "lang": "fr_CA", "codepage": "cp858", "country": 2 },
{ "lang": "fr_CH", "codepage": "cp858", "country": 41 },
{ "lang": "fr_FR", "codepage": "cp858", "country": 33 },
{ "lang": "fr_LU", "codepage": "cp858" },
{ "lang": "id_ID", "codepage": "cp858" },
{ "lang": "is_IS", "codepage": "cp858" },
{ "lang": "it_CH", "codepage": "cp858" },
{ "lang": "it_IT", "codepage": "cp858" },
{ "lang": "it_CH", "codepage": "cp858", "country": 41 },
{ "lang": "it_IT", "codepage": "cp858", "country": 39 },
{ "lang": "ms_BN", "codepage": "cp858" },
{ "lang": "ms_MY", "codepage": "cp858" },
{ "lang": "nb_NO", "codepage": "cp858" },
{ "lang": "nl_BE", "codepage": "cp858" },
{ "lang": "nl_NL", "codepage": "cp858" },
{ "lang": "nl_BE", "codepage": "cp858", "country": 32 },
{ "lang": "nl_NL", "codepage": "cp858", "country": 31 },
{ "lang": "nn_NO", "codepage": "cp858" },
{ "lang": "no_NO", "codepage": "cp858" },
{ "lang": "pt_BR", "codepage": "cp858" },
{ "lang": "pt_PT", "codepage": "cp858" },
{ "lang": "no_NO", "codepage": "cp858", "country": 47 },
{ "lang": "pt_BR", "codepage": "cp858", "country": 55 },
{ "lang": "pt_PT", "codepage": "cp858", "country": 351 },
{ "lang": "sv_FI", "codepage": "cp858" },
{ "lang": "sv_SE", "codepage": "cp858" },
{ "lang": "sv_SE", "codepage": "cp858", "country": 46 },
{ "lang": "sw_CD", "codepage": "cp858" },
{ "lang": "sw_KE", "codepage": "cp858" },
{ "lang": "sw_TZ", "codepage": "cp858" },
{ "lang": "sw_UG", "codepage": "cp858" },
{ "lang": "ru_RU", "codepage": "cp866" },
{ "lang": "ru_RU", "codepage": "cp866", "country": 7 },
]
}

5 comments on commit eebc4f2

@bk
Copy link
Contributor

@bk bk commented on eebc4f2 Jan 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's your source for the country numbers? I found this list for MS DOS 6.22: http://alvarestech.com/temp/DriveKey/dos/country.txt. According to that e.g. en_CA (Canadian English) should be 4 and fr_CA (Canadian French) should be 2 (instead of the 1 and 2, respectively, in this commit).
Generally, the numbers are telephone country calling codes, so in most cases the blanks can be easily filled out by looking at the second ("YY") part of the "xx_YY" lang value. So is_IS is 354, de_AT is 43, etc. The only slight problem with this schema arises when a country has more than one official language (like Canada).

@stsp
Copy link
Member Author

@stsp stsp commented on eebc4f2 Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to that e.g. en_CA (Canadian English) should be 4 and fr_CA (Canadian French) should be 2 (instead of the 1 and 2, respectively, in this commit).

You state fr_CA as "should be 2" and "is 2", so I wonder
what is the problem with it.

en_CA indeed should be 4, its just that this table:
https://github.com/dosemu2/fdpp/blob/master/kernel/config.c#L2851
doesn't have 4. We nevertheless should of
course use the right values.

@andrewbird you recently wanted to embed
country.sys to fdpp (before we found the one
already there). Would you like to look at merging
the table of full country.sys to ours?

@stsp
Copy link
Member Author

@stsp stsp commented on eebc4f2 Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the second ("YY") part of the "xx_YY" lang value. So is_IS is 354, de_AT is 43, etc.

How do you propose to match the YY
value to the line of the table you've found (thanks!)?

@bk
Copy link
Contributor

@bk bk commented on eebc4f2 Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the second ("YY") part of the "xx_YY" lang value. So is_IS is 354, de_AT is 43, etc.

How do you propose to match the YY value to the line of the table you've found (thanks!)?

You're right, it's not possible directly. One would have to find the two-letter code by searching for the country name in a good list of country ISO codes such as this one on Wikipedia. For the countries listed in the MSDOS 6.22 file, this yields:

  • Albania = AL
  • Argentina = AR
  • Australia = AU
  • Austria = AT
  • Belgium = BE
  • Bosnia/Herzegovina = BA
  • Brazil = BR
  • Bulgaria = BG
  • Canada = CA (already discussed)
  • Chile = CL
  • Colombia = CO
  • Croatia = HR
  • Czech Republic = CZ
  • Denmark = DK
  • Ecuador = EC
  • Finland = FI
  • France = FR
  • Germany = DE
  • Greece = GR
  • Hong Kong = HK
  • Hungary = HU
  • Iceland = IS
  • India = IN
  • Ireland = IE
  • Israel = IL
  • Italy = IT
  • Japan = JP
  • Korea (i.e. South Korea) = KR
  • Macedonia (i.e. North Macedonia) = MK
  • Malaysia = MY
  • Mexico = MX
  • Netherlands = NL
  • New Zealand = NZ
  • Norway = NO
  • People's Republic of China = CN
  • Poland = PL
  • Portugal = PT
  • Romania = RO
  • Russia = RU
  • Serbia = RS (Montenegro = ME)
  • Singapore = SG
  • Slovakia = SK
  • Slovenia = SI
  • South Africa = ZA
  • Spain = ES
  • Sweden = SE
  • Switzerland = CH
  • Taiwan = TW
  • Turkey = TR
  • United Kingdom = GB
  • United States = US
  • Venezuela = VE

There are some additional entries in country.txt which cannot be directly mapped using the above method:

  • "Area South" (Arabic countries). The "country code" given for this in country.txt, 785, does not exist as an international phone prefix. It may have been chosen because both Tunisia and the UAE have a numeric ISO country code starting with 78.
  • International English. A vague concept which has no relation to the country part of the locale. The en_* locales not covered by the above may be assigned here, i.e. en_BZ (Belize), en_JM (Jamaica), en_PH (Philippines), en_TT (Trinidad and Tobago).
  • Latin America: several countries, some of which are in the above list. The additional ones appearing in locales.conf and matching es_* are BO=Bolivia, BZ=Belize, CR=Costa Rica, DO=Dominican Republic, GT=Guatemala, HN=Honduras, NI=Nicaragua, PA=Panama, PE=Peru, PR=Puerto Rico, PY=Paraguay, SV=El Salvador, and UY=Uruguay.
  • Yugoslavia, of course, does not exist any more.

The remaining country codes used in locales.conf may be grouped into

  1. Swahili locales with the following country parts: CD=Congo, KE=Kenya, TZ=Tanzania, UG=Uganda.
  2. European micronations: FO=Faroe Islands, LI=Liechtenstein, LU=Luxembourg.
  3. Indonesia (ID). Incredibly, one of the most populous countries in the world is entirely missing from country.txt.

@stsp
Copy link
Member Author

@stsp stsp commented on eebc4f2 Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I added more country codes now.

Please sign in to comment.