You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2016/01/19 21:01:39 UTC

[jira] [Comment Edited] (CB-8258) iOS getPreferredLanguage should be from the list of available localizations for the app

    [ https://issues.apache.org/jira/browse/CB-8258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15107320#comment-15107320 ] 

Shazron Abdullah edited comment on CB-8258 at 1/19/16 8:00 PM:
---------------------------------------------------------------

Also the preferredLanguages behaviour has changed in iOS 9: https://developer.apple.com/library/ios/technotes/tn2418/_index.html

I'm not a globalization expert, but I think that tech note is essentially telling us to use the bundle methods instead (what Suresh is suggesting).




was (Author: shazron):
Also the preferredLanguages behaviour has changed in iOS 9: https://developer.apple.com/library/ios/technotes/tn2418/_index.html

I'm not a globalization expert, but I think that tech note is essentially telling us to use the bundle methods instead (what the Suresh is suggesting).



> 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-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org