Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 26, 2011
@ecyrbe Improved Translation
Added support for weather condition translation
this relies on defined yahoo weather codes
855cf1a
@ecyrbe Update translation
Updated main pot file and french translation
Corrected some misleading french translation
d560f48
Showing with 485 additions and 32 deletions.
  1. +192 −15 po/fr.po
  2. +186 −10 po/gnome-shell-extension-weather.pot
  3. +107 −7 src/extension.js
View
207 po/fr.po
@@ -3,53 +3,230 @@
# Copyright (C) 2011 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Simon Claessens <gagalago@gmail.com>, 2011.
+# ecyrbe <ecyrbe@gmail.com>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: 3.0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-05-26 06:23+0200\n"
-"PO-Revision-Date: 2011-05-24 16:58+0200\n"
-"Last-Translator: Simon Claessens <gagalago@gmail.com>\n"
-"Language-Team: Français <>\n"
+"POT-Creation-Date: 2011-05-26 08:06+0200\n"
+"PO-Revision-Date: 2011-05-26 08:10+0200\n"
+"Last-Translator: ecyrbe <ecyrbe@gmail.com>\n"
+"Language-Team: Français <ecyrbe@gmail.com>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bits\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
-#: extension.js:71
+#: extension.js:72
msgid "..."
msgstr "..."
-#: extension.js:314
+#: extension.js:227
+msgid "Tornado"
+msgstr "Tornade"
+
+#: extension.js:229
+msgid "Tropical storm"
+msgstr "Tempête tropicale"
+
+#: extension.js:231
+msgid "Hurricane"
+msgstr "Ouragan"
+
+#: extension.js:233
+msgid "Severe thunderstorms"
+msgstr "Orage sévère"
+
+#: extension.js:235
+msgid "Thunderstorms"
+msgstr "Orage"
+
+#: extension.js:237
+msgid "Mixed rain and snow"
+msgstr "Neige et pluie"
+
+#: extension.js:239
+msgid "Mixed rain and sleet"
+msgstr "Grêle et pluie"
+
+#: extension.js:241
+msgid "Mixed snow and sleet"
+msgstr "Neige et Grêle"
+
+#: extension.js:243
+msgid "Freezing drizzle"
+msgstr "Pluie verglaçante"
+
+#: extension.js:245
+msgid "Drizzle"
+msgstr "Pluie fine"
+
+#: extension.js:247
+msgid "Freezing rain"
+msgstr "Pluie verglaçante"
+
+#: extension.js:249 extension.js:251
+msgid "Showers"
+msgstr "Averses"
+
+#: extension.js:253
+msgid "Snow flurries"
+msgstr "Neige"
+
+#: extension.js:255
+msgid "Light snow showers"
+msgstr "Neige"
+
+#: extension.js:257
+msgid "Blowing snow"
+msgstr "Neige"
+
+#: extension.js:259
+msgid "Snow"
+msgstr "Neige"
+
+#: extension.js:261
+msgid "Hail"
+msgstr "Grêle"
+
+#: extension.js:263
+msgid "Sleet"
+msgstr "Grêlons"
+
+#: extension.js:265
+msgid "Dust"
+msgstr "Brouillard"
+
+#: extension.js:267
+msgid "Foggy"
+msgstr "Brouillard"
+
+#: extension.js:269
+msgid "Haze"
+msgstr "Brume"
+
+#: extension.js:271
+msgid "Smoky"
+msgstr "Brouillard"
+
+#: extension.js:273
+msgid "Blustery"
+msgstr "Bourrasques de vent"
+
+#: extension.js:275
+msgid "Windy"
+msgstr "Venteux"
+
+#: extension.js:277
+msgid "Cold"
+msgstr "Froid"
+
+#: extension.js:279
+msgid "Cloudy"
+msgstr "Nuageux"
+
+#: extension.js:282
+msgid "Mostly cloudy"
+msgstr "Nuageux"
+
+#: extension.js:285 extension.js:311
+msgid "Partly cloudy"
+msgstr "Éclaicies"
+
+#: extension.js:287
+msgid "Clear"
+msgstr "Beau"
+
+#: extension.js:289
+msgid "Sunny"
+msgstr "Ensoleillé"
+
+#: extension.js:292
+msgid "Fair"
+msgstr "Beau"
+
+#: extension.js:294
+msgid "Mixed rain and hail"
+msgstr "Pluie et Grêle"
+
+#: extension.js:296
+msgid "Hot"
+msgstr "Chaud"
+
+#: extension.js:298
+msgid "Isolated thunderstorms"
+msgstr "Orageux"
+
+#: extension.js:301
+msgid "Scattered thunderstorms"
+msgstr "Orageux"
+
+#: extension.js:303
+msgid "Scattered showers"
+msgstr "Grosses averses"
+
+#: extension.js:305 extension.js:309
+msgid "Heavy snow"
+msgstr "Tempête de neige"
+
+#: extension.js:307
+msgid "Scattered snow showers"
+msgstr "Tempête de neige"
+
+#: extension.js:313
+msgid "Thundershowers"
+msgstr "Orages"
+
+#: extension.js:315
+msgid "Snow showers"
+msgstr "Tempête de neige"
+
+#: extension.js:317
+msgid "Isolated thundershowers"
+msgstr "Orageux"
+
+#: extension.js:320
+msgid "Not available"
+msgstr "Non disponible"
+
+#: extension.js:377
+msgid "Today"
+msgstr "Aujourd'hui"
+
+#: extension.js:377
+msgid "Tomorrow"
+msgstr "Demain"
+
+#: extension.js:414
msgid "Loading current weather ..."
msgstr "Chargement de la météo ..."
-#: extension.js:315
+#: extension.js:415
msgid "Loading future weather ..."
-msgstr "Chargement de la météo future ..."
+msgstr "Chargement des prévisions ..."
-#: extension.js:331
+#: extension.js:431
msgid "Loading ..."
msgstr "Chargement ..."
-#: extension.js:334
+#: extension.js:434
msgid "Please wait"
msgstr "Patientez s'il vous plaît"
-#: extension.js:352
+#: extension.js:452
msgid "Temperature:"
-msgstr "Temperature :"
+msgstr "Température :"
-#: extension.js:354
+#: extension.js:454
msgid "Humidity:"
msgstr "Humidité :"
-#: extension.js:356
+#: extension.js:456
msgid "Pressure:"
msgstr "Pression :"
-#: extension.js:358
+#: extension.js:458
msgid "Wind:"
msgstr "Vent :"
View
196 po/gnome-shell-extension-weather.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-05-26 06:23+0200\n"
+"POT-Creation-Date: 2011-05-26 08:06+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,38 +17,214 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: extension.js:71
+#: extension.js:72
msgid "..."
msgstr ""
-#: extension.js:314
-msgid "Loading current weather ..."
+#: extension.js:227
+msgid "Tornado"
+msgstr ""
+
+#: extension.js:229
+msgid "Tropical storm"
+msgstr ""
+
+#: extension.js:231
+msgid "Hurricane"
+msgstr ""
+
+#: extension.js:233
+msgid "Severe thunderstorms"
+msgstr ""
+
+#: extension.js:235
+msgid "Thunderstorms"
+msgstr ""
+
+#: extension.js:237
+msgid "Mixed rain and snow"
+msgstr ""
+
+#: extension.js:239
+msgid "Mixed rain and sleet"
+msgstr ""
+
+#: extension.js:241
+msgid "Mixed snow and sleet"
+msgstr ""
+
+#: extension.js:243
+msgid "Freezing drizzle"
+msgstr ""
+
+#: extension.js:245
+msgid "Drizzle"
+msgstr ""
+
+#: extension.js:247
+msgid "Freezing rain"
+msgstr ""
+
+#: extension.js:249 extension.js:251
+msgid "Showers"
+msgstr ""
+
+#: extension.js:253
+msgid "Snow flurries"
+msgstr ""
+
+#: extension.js:255
+msgid "Light snow showers"
+msgstr ""
+
+#: extension.js:257
+msgid "Blowing snow"
+msgstr ""
+
+#: extension.js:259
+msgid "Snow"
+msgstr ""
+
+#: extension.js:261
+msgid "Hail"
+msgstr ""
+
+#: extension.js:263
+msgid "Sleet"
+msgstr ""
+
+#: extension.js:265
+msgid "Dust"
+msgstr ""
+
+#: extension.js:267
+msgid "Foggy"
+msgstr ""
+
+#: extension.js:269
+msgid "Haze"
+msgstr ""
+
+#: extension.js:271
+msgid "Smoky"
+msgstr ""
+
+#: extension.js:273
+msgid "Blustery"
+msgstr ""
+
+#: extension.js:275
+msgid "Windy"
+msgstr ""
+
+#: extension.js:277
+msgid "Cold"
+msgstr ""
+
+#: extension.js:279
+msgid "Cloudy"
+msgstr ""
+
+#: extension.js:282
+msgid "Mostly cloudy"
+msgstr ""
+
+#: extension.js:285 extension.js:311
+msgid "Partly cloudy"
+msgstr ""
+
+#: extension.js:287
+msgid "Clear"
+msgstr ""
+
+#: extension.js:289
+msgid "Sunny"
+msgstr ""
+
+#: extension.js:292
+msgid "Fair"
+msgstr ""
+
+#: extension.js:294
+msgid "Mixed rain and hail"
+msgstr ""
+
+#: extension.js:296
+msgid "Hot"
+msgstr ""
+
+#: extension.js:298
+msgid "Isolated thunderstorms"
+msgstr ""
+
+#: extension.js:301
+msgid "Scattered thunderstorms"
+msgstr ""
+
+#: extension.js:303
+msgid "Scattered showers"
+msgstr ""
+
+#: extension.js:305 extension.js:309
+msgid "Heavy snow"
+msgstr ""
+
+#: extension.js:307
+msgid "Scattered snow showers"
+msgstr ""
+
+#: extension.js:313
+msgid "Thundershowers"
msgstr ""
#: extension.js:315
+msgid "Snow showers"
+msgstr ""
+
+#: extension.js:317
+msgid "Isolated thundershowers"
+msgstr ""
+
+#: extension.js:320
+msgid "Not available"
+msgstr ""
+
+#: extension.js:377
+msgid "Today"
+msgstr ""
+
+#: extension.js:377
+msgid "Tomorrow"
+msgstr ""
+
+#: extension.js:414
+msgid "Loading current weather ..."
+msgstr ""
+
+#: extension.js:415
msgid "Loading future weather ..."
msgstr ""
-#: extension.js:331
+#: extension.js:431
msgid "Loading ..."
msgstr ""
-#: extension.js:334
+#: extension.js:434
msgid "Please wait"
msgstr ""
-#: extension.js:352
+#: extension.js:452
msgid "Temperature:"
msgstr ""
-#: extension.js:354
+#: extension.js:454
msgid "Humidity:"
msgstr ""
-#: extension.js:356
+#: extension.js:456
msgid "Pressure:"
msgstr ""
-#: extension.js:358
+#: extension.js:458
msgid "Wind:"
msgstr ""
View
114 src/extension.js
@@ -5,6 +5,7 @@
* - On click, gives a popup with details about the weather
Copyright (C) 2011
+ ecyrbe <ecyrbe+spam@gmail.com>,
Timur Kristof <venemo@msn.com>,
Elad Alfassa <elad@fedoraproject.org>,
Simon Legner <Simon.Legner@gmail.com>
@@ -62,7 +63,7 @@ WeatherMenuButton.prototype = {
// Panel icon
this._weatherIcon = new St.Icon({
icon_type: St.IconType.SYMBOLIC,
- icon_size: Main.panel.button.get_child().height - 4,
+ icon_size: Main.panel.button.get_child().height,
icon_name: 'view-refresh-symbolic',
style_class: 'weather-icon' + (Main.panel.actor.get_direction() == St.TextDirection.RTL ? '-rtl' : '')
});
@@ -196,7 +197,6 @@ WeatherMenuButton.prototype = {
case 37:/* isolated thunderstorms */
return 'weather-storm';
case 38:/* scattered thunderstorms */
- return 'weather-storm';
case 39:/* scattered thunderstorms */
return 'weather-storm';
case 40:/* scattered showers */
@@ -216,11 +216,111 @@ WeatherMenuButton.prototype = {
case 47:/* isolated thundershowers */
return 'weather-storm';
case 3200:/* not available */
- return 'weather-severe-alert';
default:
return 'weather-severe-alert';
}
},
+
+ get_weather_condition: function(code) {
+ switch (parseInt(code, 10)){
+ case 0:/* tornado */
+ return _('Tornado');
+ case 1:/* tropical storm */
+ return _('Tropical storm');
+ case 2:/* hurricane */
+ return _('Hurricane');
+ case 3:/* severe thunderstorms */
+ return _('Severe thunderstorms');
+ case 4:/* thunderstorms */
+ return _('Thunderstorms');
+ case 5:/* mixed rain and snow */
+ return _('Mixed rain and snow');
+ case 6:/* mixed rain and sleet */
+ return _('Mixed rain and sleet');
+ case 7:/* mixed snow and sleet */
+ return _('Mixed snow and sleet');
+ case 8:/* freezing drizzle */
+ return _('Freezing drizzle');
+ case 9:/* drizzle */
+ return _('Drizzle');
+ case 10:/* freezing rain */
+ return _('Freezing rain');
+ case 11:/* showers */
+ return _('Showers');
+ case 12:/* showers */
+ return _('Showers');
+ case 13:/* snow flurries */
+ return _('Snow flurries');
+ case 14:/* light snow showers */
+ return _('Light snow showers');
+ case 15:/* blowing snow */
+ return _('Blowing snow');
+ case 16:/* snow */
+ return _('Snow');
+ case 17:/* hail */
+ return _('Hail');
+ case 18:/* sleet */
+ return _('Sleet');
+ case 19:/* dust */
+ return _('Dust');
+ case 20:/* foggy */
+ return _('Foggy');
+ case 21:/* haze */
+ return _('Haze');
+ case 22:/* smoky */
+ return _('Smoky');
+ case 23:/* blustery */
+ return _('Blustery');
+ case 24:/* windy */
+ return _('Windy');
+ case 25:/* cold */
+ return _('Cold');
+ case 26:/* cloudy */
+ return _('Cloudy');
+ case 27:/* mostly cloudy (night) */
+ case 28:/* mostly cloudy (day) */
+ return _('Mostly cloudy');
+ case 29:/* partly cloudy (night) */
+ case 30:/* partly cloudy (day) */
+ return _('Partly cloudy');
+ case 31:/* clear (night) */
+ return _('Clear');
+ case 32:/* sunny */
+ return _('Sunny');
+ case 33:/* fair (night) */
+ case 34:/* fair (day) */
+ return _('Fair');
+ case 35:/* mixed rain and hail */
+ return _('Mixed rain and hail');
+ case 36:/* hot */
+ return _('Hot');
+ case 37:/* isolated thunderstorms */
+ return _('Isolated thunderstorms');
+ case 38:/* scattered thunderstorms */
+ case 39:/* scattered thunderstorms */
+ return _('Scattered thunderstorms');
+ case 40:/* scattered showers */
+ return _('Scattered showers');
+ case 41:/* heavy snow */
+ return _('Heavy snow');
+ case 42:/* scattered snow showers */
+ return _('Scattered snow showers');
+ case 43:/* heavy snow */
+ return _('Heavy snow');
+ case 44:/* partly cloudy */
+ return _('Partly cloudy');
+ case 45:/* thundershowers */
+ return _('Thundershowers');
+ case 46:/* snow showers */
+ return _('Snow showers');
+ case 47:/* isolated thundershowers */
+ return _('Isolated thundershowers');
+ case 3200:/* not available */
+ default:
+ return _('Not available');
+ }
+ },
+
load_json: function(url) {
var session = new Soup.SessionSync();
@@ -248,7 +348,7 @@ WeatherMenuButton.prototype = {
this.load_json_async(WEATHER_URL, function(weather) {
let location = weather.get_object_member('location').get_string_member('city');
- let comment = weather.get_object_member('condition').get_string_member('text');
+ let comment = this.get_weather_condition(weather.get_object_member('condition').get_string_member('code'));//weather.get_object_member('condition').get_string_member('text');
let temperature = weather.get_object_member('condition').get_double_member('temperature');
let temperature_unit = '\u00b0' + weather.get_object_member('units').get_string_member('temperature');
let humidity = weather.get_object_member('atmosphere').get_string_member('humidity') + ' %';
@@ -274,19 +374,19 @@ WeatherMenuButton.prototype = {
// Refresh forecast
this.load_json_async(FORECAST_URL, function(forecast) {
- date_string = ['Today', 'Tomorrow'];
+ date_string = [_('Today'), _('Tomorrow')];
forecast2 = forecast.get_object_member('query').get_object_member('results').get_array_member('channel').get_elements();
for (let i = 0; i <= 1; i++) {
let forecastUi = this._forecast[i];
let forecastData = forecast2[i].get_object().get_object_member('item').get_object_member('forecast');
let code = forecastData.get_string_member('code');
- let comment = forecastData.get_string_member('text');
+ let comment = this.get_weather_condition(code);//forecastData.get_string_member('text');
let t_low = forecastData.get_string_member('low');
let t_high = forecastData.get_string_member('high');
forecastUi.Day.text = date_string[i] + ' (' + forecastData.get_string_member('day') + ')';
- forecastUi.Temperature.text = t_low + '\u2013' + t_high + ' ' + UNITS.toUpperCase();
+ forecastUi.Temperature.text = t_low + '\u2013' + t_high + ' \u00b0' + UNITS.toUpperCase();
forecastUi.Summary.text = comment;
forecastUi.Icon.icon_name = this.get_weather_icon(code);
}

No commit comments for this range

Something went wrong with that request. Please try again.