summaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/weather/update_weather.config2
-rw-r--r--widgets/weather/update_weather.php7
2 files changed, 9 insertions, 0 deletions
diff --git a/widgets/weather/update_weather.config b/widgets/weather/update_weather.config
index 4a749212..f799c6d3 100644
--- a/widgets/weather/update_weather.config
+++ b/widgets/weather/update_weather.config
@@ -9,6 +9,8 @@ Units = "si"
DegreeSign = "°C"
# Can be set to 'en', 'de', 'pl', 'es', 'fr', 'it', 'tet' or 'x-pig-latin' (see forecast.io API); default is 'en'
Lang = "de"
+# convert . to , for german format
+ConvertPoint2Comma = 1
# We have only 1000 api calls per day, so please only do one update per day!
# Or request an own key for free at forecast.io
ApiKey = "137f2d85a1f1db5762e5e073103541d2"
diff --git a/widgets/weather/update_weather.php b/widgets/weather/update_weather.php
index 800f3f7b..a35e89f4 100644
--- a/widgets/weather/update_weather.php
+++ b/widgets/weather/update_weather.php
@@ -8,6 +8,7 @@ $locationSkin = $ini_array['LocationSkin'];
$units = $ini_array['Units'];
$degree_sign = $ini_array['DegreeSign'];
$lang = $ini_array['Lang'];
+$convertPoint = $ini_array['ConvertPoint2Comma'];
$api_key = $ini_array['ApiKey'];
include('lib/forecast.io.php');
@@ -24,6 +25,8 @@ if( !$handle = fopen("weather.0.temp", "w") ) {
continue;
}
$temp = round($condition->getTemperature(), 1);
+if( $convertPoint == 1 )
+ $temp = str_replace(".", ",", $temp);
fwrite($handle, $temp);
fwrite($handle, $degree_sign);
fclose($handle);
@@ -57,6 +60,8 @@ foreach($conditions_week as $conditions) {
}
// we only have min & max so we must calc
$temp = round($conditions->getMinTemperature(), 1);
+ if( $convertPoint == 1 )
+ $temp = str_replace(".", ",", $temp);
fwrite($handle, $temp);
fwrite($handle, $degree_sign);
fclose($handle);
@@ -66,6 +71,8 @@ foreach($conditions_week as $conditions) {
continue;
}
// we only have min & max so we must calc
+ if( $convertPoint == 1 )
+ $temp = str_replace(".", ",", $temp);
$temp = round($conditions->getMaxTemperature(), 1);
fwrite($handle, $temp);
fwrite($handle, $degree_sign);