问题
We are updating an old .net 1.1 website to 2.0. The site currently supports Chinese (Traditional) & Chinese (Simplified)
I'm getting a run time error when trying to detect the language & culture using the codes: zh-CHS (simified) & zh-CHT (traditional):
Please select a specific culture, such as zh-CN, zh-HK, zh-TW, zh-MO, zh-SG.
From: System.Globalization.CultureInfo.CreateSpecificCulture(String name)
It appears these are outdated language/culture codes. Does anyone have any insights as to how I might map these languages to specific countries / cultures that are supported?
回答1:
I'd take a look here:
http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.parent(VS.80).aspx
Specifically,
/*
This code produces the following output.
SPECIFIC CULTURE PARENT CULTURE
0x0404 zh-TW Chinese (Taiwan) 0x7C04 zh-CHT Chinese (Traditional)
0x0804 zh-CN Chinese (People's Republic of China) 0x0004 zh-CHS Chinese (Simplified)
0x0C04 zh-HK Chinese (Hong Kong S.A.R.) 0x7C04 zh-CHT Chinese (Traditional)
0x1004 zh-SG Chinese (Singapore) 0x0004 zh-CHS Chinese (Simplified)
0x1404 zh-MO Chinese (Macau S.A.R.) 0x7C04 zh-CHT Chinese (Traditional)
*/
and:
The list of cultures in the Windows API is slightly different from the list of cultures in the .NET Framework. For example, the neutral culture zh-CHT "Chinese (Traditional)" with culture identifier 0x7C04 is not available in the Windows API. If interoperability with Windows is required (for example, through the p/invoke mechanism), use a specific culture that is defined in the operating system. This will ensure consistency with the equivalent Windows locale, which is identified with the same LCID.
I would stick with zh-CN for the Simplified and probably just pick one of the others for Traditional - maybe most of your Traditional users are from Taiwan?
回答2:
Simplified: CN (Mainland China), SG(Singapore). Traditional: TW (Taiwan), MO (Macau), HK (Hong Kong).
来源:https://stackoverflow.com/questions/732109/chinese-language-codes