Question

I need to support Chinese in one of my application on Windows, the problem is that I need to support for Chinese Mandarin and I did not find any locale code for it, can you clarify whether Windows support Mandarin chinese or is there any alternate??

Was it helpful?

Solution

Since the question is tagged C# and .NET 3.5 I'm assuming the following .NET-specifics apply.

There's a hint on this page zh-Hans, zh-Hant and the "old" zh-CHS, zh-CHT

use the IETF standard "zh-Hans", and "zh-Hant" names for Chinese simplified and traditional ... in .Net 2.0/3.x we still recognize zh-CHS & zh-CHT for backwards compatibility ... LCID (0x0004 or 0x7C04)

And from W3 I18N FAQ

"zh-Hant" and "zh-Hans". These language codes do not represent specific languages. "zh-Hant" would indicate Chinese written in Traditional Chinese script. Similarly "zh-Hans" represents Chinese written in Simplified Chinese script. This could refer to Mandarin or many other Chinese languages.

I guess the key point is that Chinese Mandarin that you mentioned is a spoken dialect (for want of a better term), and Chinese (Simplified) is the 'character set' that is used to represent that spoken language 'on paper'. LocaleId 0x0004 according to coobird's link.

Other spoken languages (Cantonese?) are represented by different 'character sets' like Chinese (Traditional). If your application was going to Taiwan or Hong Kong you might use LocaleId 0x7C04.

  • NOTE: I'm not meaning 'character set' in the computerese/ASCII sense above ~ just distinguishing between the spoken and written representations. There's a whole other discussion on character sets/codepages/unicode (although generally .NET seems to cope with that stuff as long as your fonts are sorted out and you stick to UTF-8).

OTHER TIPS

Mandarin Chinese refers to a family of dialects of the spoken Chinese language.

Perhaps you're looking for Simplified Chinese, which is the written Chinese character set used in the People's Republic of China and other countries?

Edit I was able to find the Natural Language Support (NLS) API Reference from Microsoft, which provides the Culture Name used for internationalization, I believe. (I'm not sure how internationalization works in .NET.)

According to the table, there are seven Culture Names/Identifiers available for Chinese. (The Culture Names for Chinese starts with zh.)

Without more information about which specific Chinese language the internationalization should be targeted at, I think it's going to be a little bit difficult to narrow down. (Perhaps someone else has had some experience in this topic?)

It's an uncommon request, but this could make sense for a spoken UI. That doesn't match the "wpf" tag though, forms are visual. You need to understand the problem better, though. coobird advised Simplified Chinese, but Mandarin is also spoken on the island of Taiwan. The written language there is Traditional Chinese.

Localization to both is similarly complex - besides getting your texts translated, you'll need to make sure you don't use bold text (doesn't work on either script) and make sure any linebreaking algroithm works when words are no longer stings of letters seperated by spaces.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top