我是这里的新手,还是iOS开发的新手,我想从ios中的NSLocale
获取特定国家/地区的语言吗?
我尝试使用此代码,但是它给了我所有语言,但是我想要特定的国家/地区语言
NSArray *test = [NSLocale availableLocaleIdentifiers];
for (int i = 0; i < [test count]; i++) {
NSLocale *locale = [NSLocale localeWithLocaleIdentifier:[test objectAtIndex:i]];
NSString *language = [locale displayNameForKey:NSLocaleIdentifier value:[locale localeIdentifier]];
NSLog(@"Langaugae %@",language);
}
我的意思是我想获得所有印度语言和任何其他乡村语言。
谢谢...
最佳答案
You will have to add localization.string file per language and then add string in key-value pair in that file.
For more detail , you can refer this link.
1.http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014
2.http://smoothlocalize.com/tutorial1.php
3.http://www.ibabbleon.com/iphone_app_localization.html
You can see steps for adding localization file for language in below image screenshot
关于ios - 如何在iOS中从NSLocale获取特定国家/地区的语言?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32521889/