cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Cadman (JIRA)" <>
Subject [jira] [Created] (CB-8966) globalization.getPreferredLanguage returns inconsistent structures
Date Wed, 06 May 2015 07:32:59 GMT
Neil Cadman created CB-8966:

             Summary: globalization.getPreferredLanguage returns inconsistent structures
                 Key: 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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message