Hi, our game is in English but the problem is we will get player facebook name to show in the game. Player facebook name can have different language. How can you detect and show the text properly according language? Do I need to have different font for each language? And what if the name contain different language in itself? How can you show it properly in one text label? Do I need to use only one font which support multi-language in this case? Which font do you recommend to use for multi-language (free or commercial)? Also, can Unity use system font in iOS? I’ve read that Helvetica font in iOS support multi-language but I don’t know how to access it from Unity.
I will approach the problem differently. Instead of trying to detect the language of the Facebook user’s name, I will just ask iOS which language is the operating system currently using.
To do this:
object[] preferredLanguages = NSLocale.PreferredLanguages();
string currentLang = preferredLanguages[0] as string;
// currentLang is the two-letter code representing the language
// that the user is using
// For a list of languages: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
EDIT: of course, you will have to use our plugin to access that API. :-p
You can check Application.systemLanguage to get the current operating system language.
But I think this doesn’t solve the label display problem. I am curious too if somebody knows more about this.
DOH, how embarrassing, I’ve been so focused on exposing APIs that I didn’t bother to check Unity’s APIs first. :-p
In Unity4, there is dynamic font support for mobile now, check out this video, starting at 1:45: Unity Blog
But what if the user’s name on Facebook is in some language other than English, but on iOS, the opted language is English? In such a case, how would I successfully display the name in Chinese in the game? I would be requiring the user’s language to be passed from Facebook. How can that be done? Anybody?
Anyone found a solution for this?