I've try everything to find a way to get the language setting of iPhone via a native Unity3D function. however, I found two ways, those are:
1) use guiText.text = Application.systemLanguage.ToString();
But I always get 'Unknown' in Chinese language.
2) use NSUserDefaults and PlayerPrefs.
B开发者_运维知识库ut it's not a Unity3D native function, I'll have to do some extra work when I want to develop my Android version.
So, anyone can please show me: Is there a PERFECT way to do that? Thank you very much!
I don't know what unity is, but would NSLocale or CFLocale help you? NSLocale is objective-c based and thus a bit easier to use:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSLocale_Class/Reference/Reference.html
CFLocale is c-based, so its a bit more tricky, but offers more functionality:
http://developer.apple.com/library/mac/#documentation/CoreFoundation/Reference/CFLocaleRef/Reference/reference.html
If you are looking for the current language code you should be able to grab the current locale and inspect that.
精彩评论