← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~vthompson/ubuntu-weather-app/reboot-translate-owm into lp:ubuntu-weather-app/reboot

 

Victor Thompson has proposed merging lp:~vthompson/ubuntu-weather-app/reboot-translate-owm into lp:ubuntu-weather-app/reboot.

Commit message:
* Get the condition text to be translated from the OWM API.

Requested reviews:
  Ubuntu Weather Developers (ubuntu-weather-dev)
Related bugs:
  Bug #1487793 in Ubuntu Weather App: "The "condition" text for OWM is not being translated"
  https://bugs.launchpad.net/ubuntu-weather-app/+bug/1487793

For more details, see:
https://code.launchpad.net/~vthompson/ubuntu-weather-app/reboot-translate-owm/+merge/268837

* Get the condition text to be translated from the OWM API.
-- 
Your team Ubuntu Weather Developers is requested to review the proposed merge of lp:~vthompson/ubuntu-weather-app/reboot-translate-owm into lp:ubuntu-weather-app/reboot.
=== modified file 'app/data/WeatherApi.js'
--- app/data/WeatherApi.js	2015-06-26 21:51:28 +0000
+++ app/data/WeatherApi.js	2015-08-22 23:19:02 +0000
@@ -233,7 +233,7 @@
             windDeg: data.wind.deg,
             windDir: calcWindDir(data.wind.deg),
             icon: _icon_map[data.weather[0].icon],
-            condition: data.weather[0].main
+            condition: data.weather[0].description
         };
         if(data.id !== undefined) {
             result["service"] = _serviceName;
@@ -263,7 +263,7 @@
             pressure: data.pressure,
             humidity: data.humidity,
             icon: _icon_map[data.weather[0].icon],
-            condition: data.weather[0].main,
+            condition: data.weather[0].description,
             windDeg: data.deg,
             windDir: calcWindDir(data.deg),
             hourly: []
@@ -324,14 +324,14 @@
             latLongParams = "&lat="+encodeURIComponent(params.location.coord.lat)
                 + "&lon="+encodeURIComponent(params.location.coord.lon);
         if(params.location.services && params.location.services[_serviceName]) {
-            urls.current = _baseUrl + "weather?units="+params.units+"&id="+params.location.services[_serviceName];
-            urls.daily = _baseUrl + "forecast/daily?id="+params.location.services[_serviceName]+"&cnt=10&units="+params.units
-            urls.forecast = _baseUrl + "forecast?id="+params.location.services[_serviceName]+"&units="+params.units
+            urls.current = _baseUrl + "weather?units="+params.units+"&id="+params.location.services[_serviceName]+"&lang="+Qt.locale().name.split("_")[0];
+            urls.daily = _baseUrl + "forecast/daily?id="+params.location.services[_serviceName]+"&cnt=10&units="+params.units+"&lang="+Qt.locale().name.split("_")[0];
+            urls.forecast = _baseUrl + "forecast?id="+params.location.services[_serviceName]+"&units="+params.units+"&lang="+Qt.locale().name.split("_")[0];
 
         } else if (params.location.coord) {
-            urls.current = _baseUrl + "weather?units="+params.units+latLongParams;
-            urls.daily = _baseUrl+"forecast/daily?cnt=10&units="+params.units+latLongParams;
-            urls.forecast = _baseUrl+"forecast?units="+params.units+latLongParams;
+            urls.current = _baseUrl + "weather?units="+params.units+latLongParams+"&lang="+Qt.locale().name.split("_")[0];
+            urls.daily = _baseUrl+"forecast/daily?cnt=10&units="+params.units+latLongParams+"&lang="+Qt.locale().name.split("_")[0];
+            urls.forecast = _baseUrl+"forecast?units="+params.units+latLongParams+"&lang="+Qt.locale().name.split("_")[0];
         }
         return urls;
     }

=== modified file 'debian/changelog'
--- debian/changelog	2015-08-20 14:53:54 +0000
+++ debian/changelog	2015-08-22 23:19:02 +0000
@@ -21,6 +21,7 @@
   * Create autopilot test which changes the selected location (LP: #1452494)
   * When location detection is off, make sure the correct location can be
     selected (LP: #1482936)
+  * Get the contition text to be translated from the OWM API. (LP: #1487793)
 
   [ Andrew Hayzen ]
   * Add mocked locations for autopilot and add a test using the data


Follow ups