Current temperature ("Now") always displayed in Farenheit (see attached)
The settings on admin/settings/google-weather affect only "Weather forecast" section and temperature sign (C of F) in "Now" section but value in "Now" section always represent the temperature in Farenheit.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | google_weather_celcius_translation_fix.patch | 1.18 KB | jvandooren |
| #9 | google_weather_celcius_fix.patch | 709 bytes | jvandooren |
| #7 | google_weather-6.x-1.4.zip | 13.93 KB | osfa |
| #2 | google_weather-block.tpl_.zip | 621 bytes | illutek |
| #1 | google_weather.jpg | 15.23 KB | VSZ |
Comments
Comment #1
VSZ commentedHere is the attached screenshot
Comment #2
illutek commentedI had the same problem
In the file google_weather-block.tpl.php on line 18 I have following code '
print $content['current']['temp'];' replaced byComment #3
adpo commentedI have the same problem in IE, and Chrome. No problem with firefox. After your update, IE and Chrome are fine, but Firefox displays wrong temperature.
Comment #4
kubala.webdesign commentedThere is no dependency on web browser - all was work on server side, browser just display static HTML content.
I'll fix it ASAP.
Comment #5
adpo commentedI have found that drupal omits your module setting in favour of user languge settings.
Comment #6
lmparra commentedHello, I had the same problem, and I have solved that.
In the file google_weather.module line 156 I have replaced:
By
Comment #7
osfa commentedSolution for ºC.
Line 156 of the file google_weather.module
Original > 'temp' => $convert_to == 'SI' ? (string) $today->temp_c->attributes()->data . $unit : (string) $today->temp_f->attributes()->data . $unit,
New > 'temp' => (string) google_weather_convert($today->temp_c->attributes()->data, $convert_to) . $unit,
No need to change google_weather-block.tpl.php
This is the solution with less impact i have found.
Kubala.webdesign, as you are the mantainer, can you add this correction if necessary? I guess you are the only one who can upload new versions of the overall module.
Thanks.
Comment #8
4kant commentedThanks osfa!
It works well for me.
Comment #9
jvandooren commentedOsfa's solution works for me as well.
I attached a patch with the change suggested in #7
Comment #10
jvandooren commentedAfter further testing, I noticed this fix is not entirely correct. Applying this fix triggers the another bug: #1075664: After Translating my website the temperature changes depending on language.
The following patch will fix both bugs.