cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhigg...@apache.org
Subject [1/2] git commit: CB-6490 [BlackBerry10] Use hyphen instead of underscore in getLocaleName().
Date Mon, 15 Sep 2014 13:25:43 GMT
Repository: cordova-plugin-globalization
Updated Branches:
  refs/heads/master aa66116f8 -> e79b14863


CB-6490 [BlackBerry10] Use hyphen instead of underscore in getLocaleName().


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/commit/e79b1486
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/tree/e79b1486
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/diff/e79b1486

Branch: refs/heads/master
Commit: e79b1486346f1d1a9dc7f5a4d3ea587d8ec8737f
Parents: c4e3eda
Author: Lianghui Chen <liachen@blackberry.com>
Authored: Fri Sep 12 14:38:24 2014 -0400
Committer: Bryan Higgins <bhiggins@blackberry.com>
Committed: Mon Sep 15 09:24:55 2014 -0400

----------------------------------------------------------------------
 .../native/device/libGlobalization.so           | Bin 275007 -> 275007 bytes
 .../native/simulator/libGlobalization.so        | Bin 1395627 -> 1397163 bytes
 .../native/src/globalization_ndk.cpp            |  12 +++++++++---
 3 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/e79b1486/src/blackberry10/native/device/libGlobalization.so
----------------------------------------------------------------------
diff --git a/src/blackberry10/native/device/libGlobalization.so b/src/blackberry10/native/device/libGlobalization.so
index 3329b36..b0eb328 100755
Binary files a/src/blackberry10/native/device/libGlobalization.so and b/src/blackberry10/native/device/libGlobalization.so
differ

http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/e79b1486/src/blackberry10/native/simulator/libGlobalization.so
----------------------------------------------------------------------
diff --git a/src/blackberry10/native/simulator/libGlobalization.so b/src/blackberry10/native/simulator/libGlobalization.so
index 745135b..054778e 100755
Binary files a/src/blackberry10/native/simulator/libGlobalization.so and b/src/blackberry10/native/simulator/libGlobalization.so
differ

http://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization/blob/e79b1486/src/blackberry10/native/src/globalization_ndk.cpp
----------------------------------------------------------------------
diff --git a/src/blackberry10/native/src/globalization_ndk.cpp b/src/blackberry10/native/src/globalization_ndk.cpp
index 8cb4703..2bddfeb 100644
--- a/src/blackberry10/native/src/globalization_ndk.cpp
+++ b/src/blackberry10/native/src/globalization_ndk.cpp
@@ -225,8 +225,14 @@ std::string GlobalizationNDK::getLocaleName()
 {
     const Locale& loc = Locale::getDefault();
     const char* name = loc.getName();
-    if (name)
-        return resultInJson(name);
+    if (name) {
+        std::string sname(name);
+        size_t pos = sname.find_first_of("_");
+        if (pos != std::string::npos)
+            sname.replace(pos, 1, "-");
+
+        return resultInJson(sname);
+    }
 
     const char* lang = loc.getLanguage();
     if (!lang)
@@ -236,7 +242,7 @@ std::string GlobalizationNDK::getLocaleName()
     if (!country)
         return resultInJson(lang);
 
-    return resultInJson(std::string(lang) + "_" + country);
+    return resultInJson(std::string(lang) + "-" + country);
 }
 
 static bool handleDateOptions(const Json::Value& options, DateFormat::EStyle& dateStyle,
DateFormat::EStyle& timeStyle, std::string& error)


Mime
View raw message