[ https://issues.apache.org/jira/browse/CB-8258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15106673#comment-15106673 ]
Sergey Grebnov commented on CB-8258: ------------------------------------ The above looks reasonable, but I would like someone with better domain knowledge to review proposed change as well. > iOS getPreferredLanguage should be from the list of available localizations > for the app > --------------------------------------------------------------------------------------- > > Key: CB-8258 > URL: https://issues.apache.org/jira/browse/CB-8258 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Globalization > Environment: iOS > Reporter: Suresh Chandrasekharan > Labels: ios, triaged > > In CDVGlobalization.m, the following line is used to get the > preferredLanguage from getPreferredLanguage > NSString* language = [[NSLocale preferredLanguages] objectAtIndex:0]; > The issue with this is, for an application, if the system preferred language > is not available in Application Resource bundle,all framework messages will > appear in the system preferred language and all app specific strings will > appear in a fallback language like en_US. > A second scenario is, like for a language like Portuguese, if only > viewControllerBundle_pt.xlf is existing as application resource but the > system language selected is pt_BR, with the current code, the fallback > resource bundle viewControllerBundle_pt.xlf won't be activated and > application will appear in en_US > Using the following, instead we can get a preferred language from the list of > available localizations for the an application, which is independent of the > preferredLanguage for the system. > NSString *language = [[[NSBundle mainBundle] preferredLocalizations] > objectAtIndex:0]; -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org