如何判断用户喜欢简体字还是繁体字

发布于 2024-10-09 18:54:44 字数 486 浏览 5 评论 0原文

在 Android 应用程序中,是否有一种标准方法来确定用户是否喜欢简化繁体汉字?

我对中文几乎一无所知,但我从维基百科上知道,中国大陆(语言环境 zh_CN)和新加坡使用简体中文,而台湾(语言环境 zh_TW)、香港和澳门使用繁体中文。对于最初的选择来说,区分国家/地区代码可能是可以接受的,但对于喜欢繁体字的中国大陆的人或喜欢简体字的香港人来说,这将是有问题的。是否有此首选项的全局设置?

如果我必须采用特定于应用程序的设置,是否有一种与其他应用程序共享此信息的临时标准方法?

In an Android app, is there a standard way to determine whether a user prefers simplified or traditional Chinese characters?

I know next to nothing about Chinese, but I do know from Wikipedia that simplified Chinese is used in mainland China (locale zh_CN) and Singapore whereas traditional Chinese is used in Taiwan (locale zh_TW), Hong Kong, and Macau. Differentiating on the country code might be acceptable for the initial choice, but it would be problematic for someone in mainland China who prefers traditional characters, or someone in Hong Kong who prefers simplified characters. Is there a global setting for this preference?

If I must resort to an app-specific setting, is there an ad hoc standard way of sharing this information with other apps?

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

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

发布评论

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

评论(1

鹿! 2024-10-16 18:54:44

就像对待任何其他两种语言一样对待它。不要依赖地区。只需遵循用户在默认区域设置中设置的内容即可。

要检查默认区域设置:

Locale myPhoneLocale = Locale.getDefault();

如果您想将 strings.xml 文件翻译为繁体和简体,只需创建一个 value-zh-rCN 文件夹并将简体放入其中,再创建一个 value-zh 文件夹用于繁体。

大多数中文用户都能够阅读简体和繁体。 (有些人可能会因为必须阅读他们不太习惯的内容而感到恼火,但这并不是世界末日。)我个人只将我的应用程序本地化为简体中文,因为中国大陆的 Android 用户最多。

Just treat it as how you'd treat any other two languages. Don't rely on region. Just go with what the user has set in their default locale.

To check for the default locale:

Locale myPhoneLocale = Locale.getDefault();

If you want to translate your strings.xml file for both traditional and simplified, just make a values-zh-rCN folder and throw simplified in there, and another values-zh folder for traditional.

Most Chinese users are able to read both simplified and traditional. (Some might be annoyed at having to read the one they are less used to, but it's not the end of the world.) I personally only localize my apps to simplified Chinese, since mainland China has the most android users.

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