我的 Android 应用程序应该默认为简体中文还是繁体中文?

发布于 2024-12-05 07:13:27 字数 455 浏览 3 评论 0原文

我正在写一个本地化的Android应用程序;我对如何处理简化和传统中文之间的差异感到困惑。

感谢这个出色的答案我知道我应该将简化的中文放入<代码中> value-zh-rcn 和value-zh-rtw中的传统中文。

但是我应该推测 value-zh中放置,对吗?香港和澳门的人们不应该只得到我的默认字符串。

我的问题是:将传统中文放入value-zh中更好吗?还是我应该让简化的中文默认? (或者我应该只省略values-zh目录?)

I'm writing a localized Android app; I'm confused about how to handle the differences between simplified and traditional Chinese.

Thanks to this excellent answer I know that I should put simplified Chinese in values-zh-rCN and traditional Chinese in values-zh-rTW.

But I should presumably put something in values-zh, right? Folks in Hong Kong and Macao shouldn't just get my default (English) strings.

My question is: is it better to put traditional Chinese in values-zh? Or should I make simplified Chinese the default? (Or should I just omit the values-zh directory?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

迷荒 2024-12-12 07:13:27

繁体中文字符(标准字符)在中文世界中有几个不同的名称。台湾政府正式称繁体字为标准字或正统字(繁体字;简体字)。

中国、马来西亚、新加坡主要使用简体字,目前台湾(中华民国)、香港使用繁体字和澳门,

我认为您不应该省略 values-zh ,将其设置为简体中文或允许用户在您的应用程序中切换语言。

Traditional Chinese characters (Standard characters) are referred to by several different names within the Chinese-speaking world. The government of Taiwan officially calls traditional Chinese characters standard characters or orthodox characters (traditional Chinese; simplified Chinese.

People in China, Malaysia and Singapore mainly use the simplified system, Traditional Chinese characters are currently used in Taiwan (Republic of China), Hong Kong and Macau.

I think that you should not omit that values-zh , put it as simplified Chinese or allow user to switch the language in your apps.

旧城空念 2024-12-12 07:13:27

默认情况下,Android 假定 zh 为繁体,但 Unicode(它设置了语言环境使用标准)对 zh 使用简体。

如果您的应用程序的最低版本是 Android 7.0 (API 24),那么您可以使用新的区域设置分辨率。通过将文件夹定义为 values-b+zh+Hans(标准)和 values-b+zh+Hant(传统),系统将自动使用正确的区域设置,具体取决于选择了哪个区域。如果您需要使用相同变体的区域之间存在区域差异,您仍然可以使用 values-zh-rTW 等。

Android by default assumes zh to be Traditional by default, but Unicode (of which sets the standard for locale usage) uses Simplified for zh.

If your app's minimum version is Android 7.0 (API 24), then you can utilise the new locale resolution. By defining the folders as values-b+zh+Hans (Standard) and values-b+zh+Hant (Traditional), the system will automatically use the correct locale depending on which region was selected. You can still use values-zh-rTW and the like, if you need regional differences between the regions using the same variant.

自此以后,行同陌路 2024-12-12 07:13:27

我的应用程序也有同样的问题,目前仅使用 zh-rCN 和 zh-rTW,这会导致所有其他区域出现问题。不幸的是,基于这个问题(简体中文和繁体中文与区域),没有确定这两者之间最好的实际方法:

values-zh (traditional)
values-zh-rCN (simplified)

或者哈哈

values-zh (simplified)
values-zh-rTW (traditional)

所以我一直在寻找以下替代方案:

在我的应用程序中,我有一个在开始时运行的方法来设置用户定义的语言,如果没有实际定义,我可以检查当前语言/区域并相应地应用补丁,同时仅保留 zh-rCN 和 zh-rTW 文件夹:

zh-rHK => zh-RTW
zh-rSG => zh-rCN
zh-rMO => zh-r?? can be both according to the link above

我使用的方法部分描述如下:更改区域设置:强制活动重新加载资源?

编辑:我现在已经使 value-zh 包含简体并修补了 HK 区域以自动使用繁体。

I have the same issue with my app which currently uses zh-rCN and zh-rTW only which cause issues for all other regions. Unfortunately based on this question (Simplified and Traditional Chinese vs Regions), there's no actual way to determine which is best between those:

values-zh (traditional)
values-zh-rCN (simplified)

Or LOL

values-zh (simplified)
values-zh-rTW (traditional)

So I've been looking at the following alternative:

In my app I have a method that runs at the beginning to set the user-defined language, and if not actually defined I can check the current language/region and apply a patch accordingly while only keeping the zh-rCN and zh-rTW folders:

zh-rHK => zh-RTW
zh-rSG => zh-rCN
zh-rMO => zh-r?? can be both according to the link above

The method I use is partially described here: Changing locale: Force activity to reload resources?

EDIT: I've now made values-zh contain Simplified and patched the HK region to use Traditional automatically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文