In some locales, a person's full name is written out with last name (family name, surname) then first name (personal name, given name), instead of the more common first name then last name order.Is there any API in Android which can take care of this name ordering for my app depending on the locale of the phone.
In order to localize the strings used in your application , make a new folder under res with name of values-local where local would be the replaced with the region. Once that folder is made, copy the strings. xmlfrom default folder to the folder you have created. And change its contents.
You'll find this screen either in the System Settings app: Languages, or System Settings: System: Languages and input. The Language preference screen should contain one entry called “English (Europe)”. Click Add language and add a fallback language.
App localization is the process of changing and refining an app in order to appeal to a geographically specific target market. You want to make sure that your app is as appealing and easy to use outside your headquarters' country as it is within.
I'm afraid, there's no API for that. I've been looking fot it for a while and all that i know is what @Shervin shared.
Currently:
You can try to manage that all yourself, by getting title, name, second name and last name from user. In english it's easy to order it correctly and concatenate it with space. Unfortunately - not every language use spaces.
Research:
CLDR is project providing any locale-specific data (for example in ICU), but order of name and family name is not there.
Possible solution:
Most of solutions out there can be summed up to:
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
So you must choose if you need to ask your user separately for first name and last name (should be usefull in sorting), but even then - you need to know how they name should be displayed.
Mostly you'll see form that asks users to provide: First name, Last name and Displayed name. Check here (fourth heading) for explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With