gpt4 book ai didi

c# - 支持中文繁体和中文简体

转载 作者:行者123 更新时间:2023-11-30 12:10:11 28 4
gpt4 key购买 nike

作为我们产品本地化的一部分,我们需要同时支持繁体中文和简体中文,但我看到这些zh-CNzh-TWzh-hans, zh-hans.我不想在每个文件夹中创建 4 个包含资源文件的文件夹。我希望 zh-CN,zh-hanszh-TW,zh-hant 一样一样。

我用 zh-hanszh-hant 创建了 2 个文件夹,ResourceManager 自动解析 zh-CNzh-hanszh-TWzh-hans。是否有关于 ResourceManager 始终执行此映射的文档,我找不到任何文档。

最佳答案

我在 MSDN 上找到了各种“注释”:

CultureInfo Class

A neutral culture is specified by only the two-letter lowercase language code. For example, "fr" specifies the neutral culture for French, and "de" specifies the neutral culture for German.

There are two culture names that contradict this rule. The cultures Chinese (Simplified), named zh-Hans, and Chinese (Traditional), named zh-Hant, are neutral cultures. The culture names represent the current standard and should be used unless you have a reason for using the older names "zh-CHS" and "zh-CHT".

CultureInfo.CreateSpecificCulture

The example uses the zh-CHS and zh-CHT culture names. However, applications that target Windows Vista and later should use zh-Hans instead of zh-CHS and zh-Hant instead of zh-CHT. zh-Hans and zh-Hant represent the current standard and should be used unless you have a reason for using the older names.

Note also that the results of the example may differ on an installation of Taiwanese Windows, where the input of a Chinese (Traditional) neutral culture (zh, zh-CHT, or zh-Hant) will return zh-TW.

CultureInfo.Parent

The example displays the older zh-CHS and zh-CHT culture names with the 0x0004 and 0x7C04 culture identifiers, respectively. However, your Windows Vista applications should use the zh-Hans name instead of zh-CHS and the zh-Hant name instead of zh-CHT. The zh-Hans and zh-Hant names represent the current standard, and should be used unless you have a reason for using the older names.

关于c# - 支持中文繁体和中文简体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19180248/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com