Add translation for days in forecast

Yahoo return abreviated days desc, we parse this to return
a full day desc in the forecast Labels
Translation files were updated according to this changes
yahoo_weather
ecyrbe 14 years ago
parent fa2a7ab41f
commit 5c0e32a848
  1. 138
      po/fr.po
  2. 136
      po/gnome-shell-extension-weather.pot
  3. 20
      src/extension.js

@ -9,8 +9,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 3.0.1\n" "Project-Id-Version: 3.0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-05-26 08:06+0200\n" "POT-Creation-Date: 2011-05-27 01:22+0200\n"
"PO-Revision-Date: 2011-05-26 08:10+0200\n" "PO-Revision-Date: 2011-05-27 01:24+0200\n"
"Last-Translator: ecyrbe <ecyrbe@gmail.com>\n" "Last-Translator: ecyrbe <ecyrbe@gmail.com>\n"
"Language-Team: Français <ecyrbe@gmail.com>\n" "Language-Team: Français <ecyrbe@gmail.com>\n"
"Language: fr\n" "Language: fr\n"
@ -19,214 +19,242 @@ msgstr ""
"Content-Transfer-Encoding: 8bits\n" "Content-Transfer-Encoding: 8bits\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n"
#: extension.js:72 #: extension.js:73
msgid "..." msgid "..."
msgstr "..." msgstr "..."
#: extension.js:227 #: extension.js:228
msgid "Tornado" msgid "Tornado"
msgstr "Tornade" msgstr "Tornade"
#: extension.js:229 #: extension.js:230
msgid "Tropical storm" msgid "Tropical storm"
msgstr "Tempête tropicale" msgstr "Tempête tropicale"
#: extension.js:231 #: extension.js:232
msgid "Hurricane" msgid "Hurricane"
msgstr "Ouragan" msgstr "Ouragan"
#: extension.js:233 #: extension.js:234
msgid "Severe thunderstorms" msgid "Severe thunderstorms"
msgstr "Orage sévère" msgstr "Orage sévère"
#: extension.js:235 #: extension.js:236
msgid "Thunderstorms" msgid "Thunderstorms"
msgstr "Orage" msgstr "Orage"
#: extension.js:237 #: extension.js:238
msgid "Mixed rain and snow" msgid "Mixed rain and snow"
msgstr "Neige et pluie" msgstr "Neige et pluie"
#: extension.js:239 #: extension.js:240
msgid "Mixed rain and sleet" msgid "Mixed rain and sleet"
msgstr "Grêle et pluie" msgstr "Grêle et pluie"
#: extension.js:241 #: extension.js:242
msgid "Mixed snow and sleet" msgid "Mixed snow and sleet"
msgstr "Neige et Grêle" msgstr "Neige et Grêle"
#: extension.js:243 #: extension.js:244
msgid "Freezing drizzle" msgid "Freezing drizzle"
msgstr "Pluie verglaçante" msgstr "Pluie verglaçante"
#: extension.js:245 #: extension.js:246
msgid "Drizzle" msgid "Drizzle"
msgstr "Pluie fine" msgstr "Pluie fine"
#: extension.js:247 #: extension.js:248
msgid "Freezing rain" msgid "Freezing rain"
msgstr "Pluie verglaçante" msgstr "Pluie verglaçante"
#: extension.js:249 extension.js:251 #: extension.js:250 extension.js:252
msgid "Showers" msgid "Showers"
msgstr "Averses" msgstr "Averses"
#: extension.js:253 #: extension.js:254
msgid "Snow flurries" msgid "Snow flurries"
msgstr "Neige" msgstr "Neige"
#: extension.js:255 #: extension.js:256
msgid "Light snow showers" msgid "Light snow showers"
msgstr "Neige" msgstr "Neige"
#: extension.js:257 #: extension.js:258
msgid "Blowing snow" msgid "Blowing snow"
msgstr "Neige" msgstr "Neige"
#: extension.js:259 #: extension.js:260
msgid "Snow" msgid "Snow"
msgstr "Neige" msgstr "Neige"
#: extension.js:261 #: extension.js:262
msgid "Hail" msgid "Hail"
msgstr "Grêle" msgstr "Grêle"
#: extension.js:263 #: extension.js:264
msgid "Sleet" msgid "Sleet"
msgstr "Grêlons" msgstr "Grêlons"
#: extension.js:265 #: extension.js:266
msgid "Dust" msgid "Dust"
msgstr "Brouillard" msgstr "Brouillard"
#: extension.js:267 #: extension.js:268
msgid "Foggy" msgid "Foggy"
msgstr "Brouillard" msgstr "Brouillard"
#: extension.js:269 #: extension.js:270
msgid "Haze" msgid "Haze"
msgstr "Brume" msgstr "Brume"
#: extension.js:271 #: extension.js:272
msgid "Smoky" msgid "Smoky"
msgstr "Brouillard" msgstr "Brouillard"
#: extension.js:273 #: extension.js:274
msgid "Blustery" msgid "Blustery"
msgstr "Bourrasques de vent" msgstr "Bourrasques de vent"
#: extension.js:275 #: extension.js:276
msgid "Windy" msgid "Windy"
msgstr "Venteux" msgstr "Venteux"
#: extension.js:277 #: extension.js:278
msgid "Cold" msgid "Cold"
msgstr "Froid" msgstr "Froid"
#: extension.js:279 #: extension.js:280
msgid "Cloudy" msgid "Cloudy"
msgstr "Nuageux" msgstr "Nuageux"
#: extension.js:282 #: extension.js:283
msgid "Mostly cloudy" msgid "Mostly cloudy"
msgstr "Nuageux" msgstr "Nuageux"
#: extension.js:285 extension.js:311 #: extension.js:286 extension.js:312
msgid "Partly cloudy" msgid "Partly cloudy"
msgstr "Éclaicies" msgstr "Éclaicies"
#: extension.js:287 #: extension.js:288
msgid "Clear" msgid "Clear"
msgstr "Beau" msgstr "Beau"
#: extension.js:289 #: extension.js:290
msgid "Sunny" msgid "Sunny"
msgstr "Ensoleillé" msgstr "Ensoleillé"
#: extension.js:292 #: extension.js:293
msgid "Fair" msgid "Fair"
msgstr "Beau" msgstr "Beau"
#: extension.js:294 #: extension.js:295
msgid "Mixed rain and hail" msgid "Mixed rain and hail"
msgstr "Pluie et Grêle" msgstr "Pluie et Grêle"
#: extension.js:296 #: extension.js:297
msgid "Hot" msgid "Hot"
msgstr "Chaud" msgstr "Chaud"
#: extension.js:298 #: extension.js:299
msgid "Isolated thunderstorms" msgid "Isolated thunderstorms"
msgstr "Orageux" msgstr "Orageux"
#: extension.js:301 #: extension.js:302
msgid "Scattered thunderstorms" msgid "Scattered thunderstorms"
msgstr "Orageux" msgstr "Orageux"
#: extension.js:303 #: extension.js:304
msgid "Scattered showers" msgid "Scattered showers"
msgstr "Grosses averses" msgstr "Grosses averses"
#: extension.js:305 extension.js:309 #: extension.js:306 extension.js:310
msgid "Heavy snow" msgid "Heavy snow"
msgstr "Tempête de neige" msgstr "Tempête de neige"
#: extension.js:307 #: extension.js:308
msgid "Scattered snow showers" msgid "Scattered snow showers"
msgstr "Tempête de neige" msgstr "Tempête de neige"
#: extension.js:313 #: extension.js:314
msgid "Thundershowers" msgid "Thundershowers"
msgstr "Orages" msgstr "Orages"
#: extension.js:315 #: extension.js:316
msgid "Snow showers" msgid "Snow showers"
msgstr "Tempête de neige" msgstr "Tempête de neige"
#: extension.js:317 #: extension.js:318
msgid "Isolated thundershowers" msgid "Isolated thundershowers"
msgstr "Orageux" msgstr "Orageux"
#: extension.js:320 #: extension.js:321
msgid "Not available" msgid "Not available"
msgstr "Non disponible" msgstr "Non disponible"
#: extension.js:377 #: extension.js:336
msgid "Monday"
msgstr "Lundi"
#: extension.js:336
msgid "Tuesday"
msgstr "Mardi"
#: extension.js:336
msgid "Wednesday"
msgstr "Mercredi"
#: extension.js:336
msgid "Thursday"
msgstr "Jeudi"
#: extension.js:336
msgid "Friday"
msgstr "Vendredi"
#: extension.js:336
msgid "Saturday"
msgstr "Samedi"
#: extension.js:336
msgid "Sunday"
msgstr "Dimanche"
#: extension.js:392
msgid "Today" msgid "Today"
msgstr "Aujourd'hui" msgstr "Aujourd'hui"
#: extension.js:377 #: extension.js:392
msgid "Tomorrow" msgid "Tomorrow"
msgstr "Demain" msgstr "Demain"
#: extension.js:414 #: extension.js:429
msgid "Loading current weather ..." msgid "Loading current weather ..."
msgstr "Chargement de la météo ..." msgstr "Chargement de la météo ..."
#: extension.js:415 #: extension.js:430
msgid "Loading future weather ..." msgid "Loading future weather ..."
msgstr "Chargement des prévisions ..." msgstr "Chargement des prévisions ..."
#: extension.js:431 #: extension.js:446
msgid "Loading ..." msgid "Loading ..."
msgstr "Chargement ..." msgstr "Chargement ..."
#: extension.js:434 #: extension.js:449
msgid "Please wait" msgid "Please wait"
msgstr "Patientez s'il vous plaît" msgstr "Patientez s'il vous plaît"
#: extension.js:452 #: extension.js:467
msgid "Temperature:" msgid "Temperature:"
msgstr "Température :" msgstr "Température :"
#: extension.js:454 #: extension.js:469
msgid "Humidity:" msgid "Humidity:"
msgstr "Humidité :" msgstr "Humidité :"
#: extension.js:456 #: extension.js:471
msgid "Pressure:" msgid "Pressure:"
msgstr "Pression :" msgstr "Pression :"
#: extension.js:458 #: extension.js:473
msgid "Wind:" msgid "Wind:"
msgstr "Vent :" msgstr "Vent :"

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-05-26 08:06+0200\n" "POT-Creation-Date: 2011-05-27 01:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,214 +17,242 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: extension.js:72 #: extension.js:73
msgid "..." msgid "..."
msgstr "" msgstr ""
#: extension.js:227 #: extension.js:228
msgid "Tornado" msgid "Tornado"
msgstr "" msgstr ""
#: extension.js:229 #: extension.js:230
msgid "Tropical storm" msgid "Tropical storm"
msgstr "" msgstr ""
#: extension.js:231 #: extension.js:232
msgid "Hurricane" msgid "Hurricane"
msgstr "" msgstr ""
#: extension.js:233 #: extension.js:234
msgid "Severe thunderstorms" msgid "Severe thunderstorms"
msgstr "" msgstr ""
#: extension.js:235 #: extension.js:236
msgid "Thunderstorms" msgid "Thunderstorms"
msgstr "" msgstr ""
#: extension.js:237 #: extension.js:238
msgid "Mixed rain and snow" msgid "Mixed rain and snow"
msgstr "" msgstr ""
#: extension.js:239 #: extension.js:240
msgid "Mixed rain and sleet" msgid "Mixed rain and sleet"
msgstr "" msgstr ""
#: extension.js:241 #: extension.js:242
msgid "Mixed snow and sleet" msgid "Mixed snow and sleet"
msgstr "" msgstr ""
#: extension.js:243 #: extension.js:244
msgid "Freezing drizzle" msgid "Freezing drizzle"
msgstr "" msgstr ""
#: extension.js:245 #: extension.js:246
msgid "Drizzle" msgid "Drizzle"
msgstr "" msgstr ""
#: extension.js:247 #: extension.js:248
msgid "Freezing rain" msgid "Freezing rain"
msgstr "" msgstr ""
#: extension.js:249 extension.js:251 #: extension.js:250 extension.js:252
msgid "Showers" msgid "Showers"
msgstr "" msgstr ""
#: extension.js:253 #: extension.js:254
msgid "Snow flurries" msgid "Snow flurries"
msgstr "" msgstr ""
#: extension.js:255 #: extension.js:256
msgid "Light snow showers" msgid "Light snow showers"
msgstr "" msgstr ""
#: extension.js:257 #: extension.js:258
msgid "Blowing snow" msgid "Blowing snow"
msgstr "" msgstr ""
#: extension.js:259 #: extension.js:260
msgid "Snow" msgid "Snow"
msgstr "" msgstr ""
#: extension.js:261 #: extension.js:262
msgid "Hail" msgid "Hail"
msgstr "" msgstr ""
#: extension.js:263 #: extension.js:264
msgid "Sleet" msgid "Sleet"
msgstr "" msgstr ""
#: extension.js:265 #: extension.js:266
msgid "Dust" msgid "Dust"
msgstr "" msgstr ""
#: extension.js:267 #: extension.js:268
msgid "Foggy" msgid "Foggy"
msgstr "" msgstr ""
#: extension.js:269 #: extension.js:270
msgid "Haze" msgid "Haze"
msgstr "" msgstr ""
#: extension.js:271 #: extension.js:272
msgid "Smoky" msgid "Smoky"
msgstr "" msgstr ""
#: extension.js:273 #: extension.js:274
msgid "Blustery" msgid "Blustery"
msgstr "" msgstr ""
#: extension.js:275 #: extension.js:276
msgid "Windy" msgid "Windy"
msgstr "" msgstr ""
#: extension.js:277 #: extension.js:278
msgid "Cold" msgid "Cold"
msgstr "" msgstr ""
#: extension.js:279 #: extension.js:280
msgid "Cloudy" msgid "Cloudy"
msgstr "" msgstr ""
#: extension.js:282 #: extension.js:283
msgid "Mostly cloudy" msgid "Mostly cloudy"
msgstr "" msgstr ""
#: extension.js:285 extension.js:311 #: extension.js:286 extension.js:312
msgid "Partly cloudy" msgid "Partly cloudy"
msgstr "" msgstr ""
#: extension.js:287 #: extension.js:288
msgid "Clear" msgid "Clear"
msgstr "" msgstr ""
#: extension.js:289 #: extension.js:290
msgid "Sunny" msgid "Sunny"
msgstr "" msgstr ""
#: extension.js:292 #: extension.js:293
msgid "Fair" msgid "Fair"
msgstr "" msgstr ""
#: extension.js:294 #: extension.js:295
msgid "Mixed rain and hail" msgid "Mixed rain and hail"
msgstr "" msgstr ""
#: extension.js:296 #: extension.js:297
msgid "Hot" msgid "Hot"
msgstr "" msgstr ""
#: extension.js:298 #: extension.js:299
msgid "Isolated thunderstorms" msgid "Isolated thunderstorms"
msgstr "" msgstr ""
#: extension.js:301 #: extension.js:302
msgid "Scattered thunderstorms" msgid "Scattered thunderstorms"
msgstr "" msgstr ""
#: extension.js:303 #: extension.js:304
msgid "Scattered showers" msgid "Scattered showers"
msgstr "" msgstr ""
#: extension.js:305 extension.js:309 #: extension.js:306 extension.js:310
msgid "Heavy snow" msgid "Heavy snow"
msgstr "" msgstr ""
#: extension.js:307 #: extension.js:308
msgid "Scattered snow showers" msgid "Scattered snow showers"
msgstr "" msgstr ""
#: extension.js:313 #: extension.js:314
msgid "Thundershowers" msgid "Thundershowers"
msgstr "" msgstr ""
#: extension.js:315 #: extension.js:316
msgid "Snow showers" msgid "Snow showers"
msgstr "" msgstr ""
#: extension.js:317 #: extension.js:318
msgid "Isolated thundershowers" msgid "Isolated thundershowers"
msgstr "" msgstr ""
#: extension.js:320 #: extension.js:321
msgid "Not available" msgid "Not available"
msgstr "" msgstr ""
#: extension.js:377 #: extension.js:336
msgid "Monday"
msgstr ""
#: extension.js:336
msgid "Tuesday"
msgstr ""
#: extension.js:336
msgid "Wednesday"
msgstr ""
#: extension.js:336
msgid "Thursday"
msgstr ""
#: extension.js:336
msgid "Friday"
msgstr ""
#: extension.js:336
msgid "Saturday"
msgstr ""
#: extension.js:336
msgid "Sunday"
msgstr ""
#: extension.js:392
msgid "Today" msgid "Today"
msgstr "" msgstr ""
#: extension.js:377 #: extension.js:392
msgid "Tomorrow" msgid "Tomorrow"
msgstr "" msgstr ""
#: extension.js:414 #: extension.js:429
msgid "Loading current weather ..." msgid "Loading current weather ..."
msgstr "" msgstr ""
#: extension.js:415 #: extension.js:430
msgid "Loading future weather ..." msgid "Loading future weather ..."
msgstr "" msgstr ""
#: extension.js:431 #: extension.js:446
msgid "Loading ..." msgid "Loading ..."
msgstr "" msgstr ""
#: extension.js:434 #: extension.js:449
msgid "Please wait" msgid "Please wait"
msgstr "" msgstr ""
#: extension.js:452 #: extension.js:467
msgid "Temperature:" msgid "Temperature:"
msgstr "" msgstr ""
#: extension.js:454 #: extension.js:469
msgid "Humidity:" msgid "Humidity:"
msgstr "" msgstr ""
#: extension.js:456 #: extension.js:471
msgid "Pressure:" msgid "Pressure:"
msgstr "" msgstr ""
#: extension.js:458 #: extension.js:473
msgid "Wind:" msgid "Wind:"
msgstr "" msgstr ""

@ -322,6 +322,20 @@ WeatherMenuButton.prototype = {
} }
}, },
parse_day: function(abr) {
let yahoo_days = ['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];
for(var i =0;i<yahoo_days.length;i++){
if( yahoo_days[i].substr(0,abr.length) == abr.toLowerCase()){
return i;
}
}
return 0;
},
get_locale_day: function(abr) {
let days = [_('Monday'), _('Tuesday'), _('Wednesday'), _('Thursday'), _('Friday'), _('Saturday'), _('Sunday')];
return days[this.parse_day(abr)].substr(0,abr.length);
},
load_json: function(url) { load_json: function(url) {
var session = new Soup.SessionSync(); var session = new Soup.SessionSync();
@ -349,7 +363,7 @@ WeatherMenuButton.prototype = {
this.load_json_async(WEATHER_URL, function(weather) { this.load_json_async(WEATHER_URL, function(weather) {
let location = CITY_DISPLAYED; let location = CITY_DISPLAYED;
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 comment = this.get_weather_condition(weather.get_object_member('condition').get_string_member('code'));
let temperature = weather.get_object_member('condition').get_double_member('temperature'); 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 temperature_unit = '\u00b0' + weather.get_object_member('units').get_string_member('temperature');
let humidity = weather.get_object_member('atmosphere').get_string_member('humidity') + ' %'; let humidity = weather.get_object_member('atmosphere').get_string_member('humidity') + ' %';
@ -382,11 +396,11 @@ WeatherMenuButton.prototype = {
let forecastData = forecast2[i].get_object().get_object_member('item').get_object_member('forecast'); let forecastData = forecast2[i].get_object().get_object_member('item').get_object_member('forecast');
let code = forecastData.get_string_member('code'); let code = forecastData.get_string_member('code');
let comment = this.get_weather_condition(code);//forecastData.get_string_member('text'); let comment = this.get_weather_condition(code);
let t_low = forecastData.get_string_member('low'); let t_low = forecastData.get_string_member('low');
let t_high = forecastData.get_string_member('high'); let t_high = forecastData.get_string_member('high');
forecastUi.Day.text = date_string[i] + ' (' + forecastData.get_string_member('day') + ')'; forecastUi.Day.text = date_string[i] + ' (' + this.get_locale_day(forecastData.get_string_member('day')) + ')';
forecastUi.Temperature.text = t_low + '\u2013' + t_high + ' \u00b0' + UNITS.toUpperCase(); forecastUi.Temperature.text = t_low + '\u2013' + t_high + ' \u00b0' + UNITS.toUpperCase();
forecastUi.Summary.text = comment; forecastUi.Summary.text = comment;
forecastUi.Icon.icon_name = this.get_weather_icon(code); forecastUi.Icon.icon_name = this.get_weather_icon(code);

Loading…
Cancel
Save