Neil Cadman created CB-8966:
-------------------------------

             Summary: globalization.getPreferredLanguage returns inconsistent 
structures
                 Key: CB-8966
                 URL: https://issues.apache.org/jira/browse/CB-8966
             Project: Apache Cordova
          Issue Type: Bug
          Components: iOS, Plugin Globalization
    Affects Versions: 3.5.0
         Environment: ios
            Reporter: Neil Cadman
            Priority: Minor


When using "getPreferredLanguage" the language value returned is a combination 
of the user language and also the users current region.

Affected versions :

org.apache.cordova.globalization 0.3.4 "Globalization"
org.apache.cordova.globalization 1.0.0 "Globalization"

This is a problem when the user sets their language to say, French and has 
their location set up as United states. The result is a language code of fr-US, 
however if you set the language to Chinese, Hong-Kong you get the full language 
code zh-hk

Its the inconsistency which I find a problem, knowing if the language code is a 
full language code "zh-hk" vs a language code region "fr-US"

May be the return objects could be expended to include a little more details. 
for example.

return {
  env : "ios",
  code : 'fr',
  region : 'US'
}

return {
  env : "ios",
  code : 'zh-hk',
  region : 'US'
}







--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to