在 Android 应用程序中针对不同的语言环境本地化人物姓名

Localizing Persons name in Android App for different locales

在某些地区,一个人的全名是先写姓氏(姓氏,姓氏)再写名(人名,教名),而不是更常见的先名后姓 order.Is Android 中有任何 API 可以根据 phone.

的区域设置为我的应用程序处理此名称排序

恐怕没有 API。我一直在寻找它一段时间,我所知道的就是@Shervin 分享的内容。

目前:

您可以尝试通过从用户那里获取头衔、姓名、第二名和姓氏来自行管理。在英语中很容易正确排序并用 space 连接它。不幸的是 - not every language use spaces.

研究:

CLDR 是提供任何 locale-specific 数据的项目(例如在 ICU 中),但姓名和姓氏的顺序 is not there

可能的解决方案:

大多数解决方案可以总结为:

If designing a form or database that will accept names from people with a variety of backgrounds, you should ask yourself whether you really need to have separate fields for given name and family name. Sometimes you may opt for separate fields because you want to be able to use part of the name to address the person directly, or refer to them. For example, when Google+ refers to "Richard's contacts". Or perhaps it's because you want to send them emails with their name at the top. Note that not only may you have problems due to name syntax here, but you also have to account for varying expectations around the world with regards to formality (not everyone is happy for a stranger to call them by their given name). It may be better to ask separately, when setting up a profile for example, how that person would like you to address them.

http://www.w3.org/International/questions/qa-personal-names#fielddesign

所以您必须选择是否需要分别询问您的用户的名字和姓氏(应该有助于排序),但即便如此 - 您需要知道他们的名字应该如何显示。

大多数情况下,您会看到要求用户提供的表格:名字、姓氏和显示名称。检查 here(第四个标题)以获得解释。