Version Description
Upgraded to most recent OpenWeatherMap APIS and included translation files.
Download this release
Release Info
Developer | halgatewood |
Plugin | Awesome Weather Widget |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.6 to 1.3
- awesome-weather.php +114 -86
- languages/awesome-weather.pot +174 -0
- readme.txt +9 -0
awesome-weather.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://halgatewood.com/awesome-weather
|
|
5 |
Description: A weather widget that actually looks cool
|
6 |
Author: Hal Gatewood
|
7 |
Author URI: http://www.halgatewood.com
|
8 |
-
Version: 1.
|
9 |
|
10 |
|
11 |
FILTERS AVAILABLE:
|
@@ -26,6 +26,15 @@ $awesome_weather_sizes = apply_filters( 'awesome_weather_sizes' , array( 'tall',
|
|
26 |
|
27 |
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
// HAS SHORTCODE - by pippin
|
30 |
function awesome_weather_wp_head( $posts )
|
31 |
{
|
@@ -58,98 +67,110 @@ function awesome_weather_logic( $atts )
|
|
58 |
$show_stats = (isset($atts['hide_stats']) AND $atts['hide_stats'] == 1) ? 0 : 1;
|
59 |
$show_link = (isset($atts['show_link']) AND $atts['show_link'] == 1) ? 1 : 0;
|
60 |
$background = isset($atts['background']) ? $atts['background'] : false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
|
|
62 |
if( !$location ) { return awesome_weather_error(); }
|
63 |
|
64 |
|
65 |
//FIND AND CACHE CITY ID
|
66 |
-
$city_id = false;
|
67 |
$city_name_slug = sanitize_title( $location );
|
68 |
-
$
|
69 |
-
$weather_transient_name = 'awesome-weather-' . $units . '-' . $city_name_slug;
|
70 |
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
{
|
73 |
-
$
|
74 |
}
|
75 |
-
|
76 |
-
// NOT AN ElSE JUST IN CASE THE TRANSIENT
|
77 |
-
// HAS AN EMPTY CITY_ID FOR WHATEVER REASON
|
78 |
-
if(!$city_id)
|
79 |
{
|
80 |
-
|
81 |
-
$
|
82 |
-
|
83 |
-
|
|
|
84 |
{
|
85 |
-
return awesome_weather_error( $
|
86 |
-
}
|
87 |
-
|
88 |
-
|
89 |
-
$data = json_decode( $city_ping_get['body'] );
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
|
|
|
|
94 |
}
|
95 |
-
|
96 |
-
if($data AND $data->list)
|
97 |
{
|
98 |
-
|
99 |
-
$city = $data->list[0];
|
100 |
-
$city_id = $city->id;
|
101 |
}
|
102 |
|
103 |
-
if($city_id)
|
104 |
-
{
|
105 |
-
set_transient( $city_id_transient_name, $city_id, 2629743); // CACHE FOR A MONTH
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
// NO CITY ID
|
110 |
-
if( !$city_id ) { return awesome_weather_error( __('City could not be found', 'awesome-weather') ); }
|
111 |
-
|
112 |
-
if( get_transient( $weather_transient_name ) )
|
113 |
-
{
|
114 |
-
$weather_data = get_transient( $weather_transient_name );
|
115 |
-
}
|
116 |
-
|
117 |
-
|
118 |
-
if(!isset($weather_data['today']))
|
119 |
-
{
|
120 |
-
$today_get = wp_remote_get("http://api.openweathermap.org/data/2.1/weather/city/" . $city_id . "?units=" . $units);
|
121 |
|
122 |
-
|
|
|
123 |
{
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
-
|
|
|
136 |
{
|
137 |
-
|
|
|
138 |
}
|
139 |
-
|
140 |
-
$weather_data['forecast'] = json_decode( $forecast_get['body'] );
|
141 |
-
set_transient( $weather_transient_name, $weather_data, apply_filters( 'awesome_weather_cache', 3600 ) ); // CACHE FOR AN HOUR
|
142 |
}
|
143 |
|
|
|
|
|
144 |
// NO WEATHER
|
145 |
-
if( !$weather_data OR
|
146 |
|
147 |
|
148 |
// TODAYS TEMPS
|
149 |
-
$today = $weather_data['
|
150 |
-
$today_temp = (
|
151 |
-
$today_high = (
|
152 |
-
$today_low = (
|
153 |
|
154 |
|
155 |
// COLOR OF WIDGET
|
@@ -177,8 +198,8 @@ function awesome_weather_logic( $atts )
|
|
177 |
// DATA
|
178 |
$header_title = $override_title ? $override_title : $today->name;
|
179 |
|
180 |
-
$today->main->humidity
|
181 |
-
$today->wind->speed
|
182 |
|
183 |
$wind_label = array (
|
184 |
__('N', 'awesome-weather'),
|
@@ -228,13 +249,16 @@ function awesome_weather_logic( $atts )
|
|
228 |
|
229 |
if($show_stats)
|
230 |
{
|
|
|
|
|
|
|
231 |
$rtn .= "
|
232 |
|
233 |
<div class=\"awesome-weather-todays-stats\">
|
234 |
<div class=\"awe_desc\">{$today->weather[0]->description}</div>
|
235 |
-
<div class=\"awe_humidty\">humidity: {$today->main->humidity}% </div>
|
236 |
-
<div class=\"awe_wind\">wind: {$today->wind->speed}
|
237 |
-
<div class=\"awe_highlow\"> H {$today_high} • L {$today_low} </div>
|
238 |
</div> <!-- /.awesome-weather-todays-stats -->
|
239 |
";
|
240 |
}
|
@@ -251,7 +275,7 @@ function awesome_weather_logic( $atts )
|
|
251 |
{
|
252 |
if( $dt_today >= date('Ymd', $forecast->dt)) continue;
|
253 |
|
254 |
-
$forecast->temp = (int) $forecast->temp;
|
255 |
$day_of_week = date('D', $forecast->dt);
|
256 |
$rtn .= "
|
257 |
<div class=\"awesome-weather-forecast-day\">
|
@@ -265,12 +289,12 @@ function awesome_weather_logic( $atts )
|
|
265 |
$rtn .= " </div> <!-- /.awesome-weather-forecast -->";
|
266 |
}
|
267 |
|
268 |
-
if($show_link AND $
|
269 |
{
|
270 |
-
$show_link_text = apply_filters('awesome_weather_extended_forecast_text' ,
|
271 |
|
272 |
$rtn .= "<div class=\"awesome-weather-more-weather-link\">";
|
273 |
-
$rtn .= "<a href=\"http://openweathermap.org/city/{$
|
274 |
$rtn .= "</div> <!-- /.awesome-weather-more-weather-link -->";
|
275 |
}
|
276 |
|
@@ -344,25 +368,28 @@ class AwesomeWeatherWidget extends WP_Widget
|
|
344 |
$hide_stats = (isset($instance['hide_stats']) AND $instance['hide_stats'] == 1) ? 1 : 0;
|
345 |
$show_link = (isset($instance['show_link']) AND $instance['show_link'] == 1) ? 1 : 0;
|
346 |
$background = isset($instance['background']) ? esc_attr($instance['background']) : "";
|
347 |
-
|
348 |
<p>
|
349 |
-
<label for="<?php echo $this->get_field_id('location'); ?>"
|
350 |
-
|
|
|
|
|
|
|
351 |
</p>
|
352 |
|
353 |
<p>
|
354 |
-
<label for="<?php echo $this->get_field_id('override_title'); ?>"><?php _e('Override Title:'); ?></label>
|
355 |
<input class="widefat" id="<?php echo $this->get_field_id('override_title'); ?>" name="<?php echo $this->get_field_name('override_title'); ?>" type="text" value="<?php echo $override_title; ?>" />
|
356 |
</p>
|
357 |
|
358 |
<p>
|
359 |
-
<label for="<?php echo $this->get_field_id('units'); ?>"><?php _e('Units:'); ?></label>
|
360 |
<input id="<?php echo $this->get_field_id('units'); ?>" name="<?php echo $this->get_field_name('units'); ?>" type="radio" value="F" <?php if($units == "F") echo ' checked="checked"'; ?> /> F
|
361 |
<input id="<?php echo $this->get_field_id('units'); ?>" name="<?php echo $this->get_field_name('units'); ?>" type="radio" value="C" <?php if($units == "C") echo ' checked="checked"'; ?> /> C
|
362 |
</p>
|
363 |
|
364 |
<p>
|
365 |
-
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Size:'); ?></label>
|
366 |
<select class="widefat" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
|
367 |
<?php foreach($awesome_weather_sizes as $size) { ?>
|
368 |
<option value="<?php echo $size; ?>"<?php if($selected_size == $size) echo " selected=\"selected\""; ?>><?php echo $size; ?></option>
|
@@ -371,7 +398,7 @@ class AwesomeWeatherWidget extends WP_Widget
|
|
371 |
</p>
|
372 |
|
373 |
<p>
|
374 |
-
<label for="<?php echo $this->get_field_id('forecast_days'); ?>"><?php _e('Forecast:'); ?></label>
|
375 |
<select class="widefat" id="<?php echo $this->get_field_id('forecast_days'); ?>" name="<?php echo $this->get_field_name('forecast_days'); ?>">
|
376 |
<option value="5"<?php if($forecast_days == 5) echo " selected=\"selected\""; ?>>5 Days</option>
|
377 |
<option value="4"<?php if($forecast_days == 4) echo " selected=\"selected\""; ?>>4 Days</option>
|
@@ -383,19 +410,20 @@ class AwesomeWeatherWidget extends WP_Widget
|
|
383 |
</p>
|
384 |
|
385 |
<p>
|
386 |
-
<label for="<?php echo $this->get_field_id('background'); ?>"><?php _e('Background Image:'); ?></label>
|
387 |
<input class="widefat" id="<?php echo $this->get_field_id('background'); ?>" name="<?php echo $this->get_field_name('background'); ?>" type="text" value="<?php echo $background; ?>" />
|
388 |
</p>
|
389 |
|
390 |
<p>
|
391 |
-
<label for="<?php echo $this->get_field_id('hide_stats'); ?>"><?php _e('Hide Stats:'); ?></label>
|
392 |
<input id="<?php echo $this->get_field_id('hide_stats'); ?>" name="<?php echo $this->get_field_name('hide_stats'); ?>" type="checkbox" value="1" <?php if($hide_stats) echo ' checked="checked"'; ?> />
|
393 |
</p>
|
394 |
|
395 |
<p>
|
396 |
-
<label for="<?php echo $this->get_field_id('show_link'); ?>"><?php _e('Link to OpenWeatherMap:'); ?></label>
|
397 |
<input id="<?php echo $this->get_field_id('show_link'); ?>" name="<?php echo $this->get_field_name('show_link'); ?>" type="checkbox" value="1" <?php if($show_link) echo ' checked="checked"'; ?> />
|
398 |
-
</p>
|
|
|
399 |
|
400 |
<?php
|
401 |
}
|
5 |
Description: A weather widget that actually looks cool
|
6 |
Author: Hal Gatewood
|
7 |
Author URI: http://www.halgatewood.com
|
8 |
+
Version: 1.3
|
9 |
|
10 |
|
11 |
FILTERS AVAILABLE:
|
26 |
|
27 |
|
28 |
|
29 |
+
// SETUP
|
30 |
+
function awesome_weather_setup()
|
31 |
+
{
|
32 |
+
load_plugin_textdomain( 'awesome-weather', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
33 |
+
}
|
34 |
+
add_action('plugins_loaded', 'awesome_weather_setup', 99999);
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
// HAS SHORTCODE - by pippin
|
39 |
function awesome_weather_wp_head( $posts )
|
40 |
{
|
67 |
$show_stats = (isset($atts['hide_stats']) AND $atts['hide_stats'] == 1) ? 0 : 1;
|
68 |
$show_link = (isset($atts['show_link']) AND $atts['show_link'] == 1) ? 1 : 0;
|
69 |
$background = isset($atts['background']) ? $atts['background'] : false;
|
70 |
+
$locale = 'en';
|
71 |
+
|
72 |
+
$sytem_locale = get_locale();
|
73 |
+
$available_locales = array( 'en', 'sp', 'fr', 'it', 'de', 'pt', 'ro', 'pl', 'ru', 'ua', 'fi', 'nl', 'bg', 'se', 'tr', 'zh_tw', 'zh_cn' );
|
74 |
+
|
75 |
+
|
76 |
+
// CHECK FOR LOCALE
|
77 |
+
if( in_array( $sytem_locale , $available_locales ) )
|
78 |
+
{
|
79 |
+
$locale = $sytem_locale;
|
80 |
+
}
|
81 |
+
|
82 |
+
// CHECK FOR LOCALE BY FIRST TWO DIGITS
|
83 |
+
if( in_array(substr($sytem_locale, 0, 2), $available_locales ) )
|
84 |
+
{
|
85 |
+
$locale = substr($sytem_locale, 0, 2);
|
86 |
+
}
|
87 |
+
|
88 |
|
89 |
+
// NO LOCATION, ABORT ABORT!!!1!
|
90 |
if( !$location ) { return awesome_weather_error(); }
|
91 |
|
92 |
|
93 |
//FIND AND CACHE CITY ID
|
|
|
94 |
$city_name_slug = sanitize_title( $location );
|
95 |
+
$weather_transient_name = 'awesome-weather-' . $units . '-' . $city_name_slug . "-". $locale;
|
|
|
96 |
|
97 |
+
|
98 |
+
// TWO APIS USED (VERSION 2.5)
|
99 |
+
//http://api.openweathermap.org/data/2.5/weather?q=London,uk&units=metric&cnt=7&lang=fr
|
100 |
+
//http://api.openweathermap.org/data/2.5/forecast/daily?q=London&units=metric&cnt=7&lang=fr
|
101 |
+
|
102 |
+
|
103 |
+
|
104 |
+
// GET WEATHER DATA
|
105 |
+
if( get_transient( $weather_transient_name ) )
|
106 |
{
|
107 |
+
$weather_data = get_transient( $weather_transient_name );
|
108 |
}
|
109 |
+
else
|
|
|
|
|
|
|
110 |
{
|
111 |
+
// NOW
|
112 |
+
$now_ping = "http://api.openweathermap.org/data/2.5/weather?q=" . $city_name_slug . "&lang=" . $locale . "&units=" . $units;
|
113 |
+
$now_ping_get = wp_remote_get( $now_ping );
|
114 |
+
|
115 |
+
if( is_wp_error( $now_ping_get ) )
|
116 |
{
|
117 |
+
return awesome_weather_error( $now_ping_get->get_error_message() );
|
118 |
+
}
|
|
|
|
|
|
|
119 |
|
120 |
+
$city_data = json_decode( $now_ping_get['body'] );
|
121 |
+
|
122 |
+
if( isset($city_data->cod) AND $city_data->cod == 404 )
|
123 |
+
{
|
124 |
+
return awesome_weather_error( $city_data->message );
|
125 |
}
|
126 |
+
else
|
|
|
127 |
{
|
128 |
+
$weather_data['now'] = $city_data;
|
|
|
|
|
129 |
}
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
+
// FORECAST
|
133 |
+
if( $days_to_show != "hide" )
|
134 |
{
|
135 |
+
$forecast_ping = "http://api.openweathermap.org/data/2.5/forecast/daily?q=" . $city_name_slug . "&lang=" . $locale . "&units=" . $units ."&cnt=7";
|
136 |
+
$forecast_ping_get = wp_remote_get( $forecast_ping );
|
137 |
+
|
138 |
+
if( is_wp_error( $forecast_ping_get ) )
|
139 |
+
{
|
140 |
+
return awesome_weather_error( $forecast_ping_get->get_error_message() );
|
141 |
+
}
|
142 |
+
|
143 |
+
$forecast_data = json_decode( $forecast_ping_get['body'] );
|
144 |
+
|
145 |
+
if( isset($forecast_data->cod) AND $forecast_data->cod == 404 )
|
146 |
+
{
|
147 |
+
return awesome_weather_error( $forecast_data->message );
|
148 |
+
}
|
149 |
+
else
|
150 |
+
{
|
151 |
+
$weather_data['forecast'] = $forecast_data;
|
152 |
+
}
|
153 |
+
}
|
154 |
|
155 |
+
|
156 |
+
if($weather_data['now'] AND $weather_data['forecast'])
|
157 |
{
|
158 |
+
// SET THE TRANSIENT, CACHE FOR AN HOUR
|
159 |
+
set_transient( $weather_transient_name, $weather_data, apply_filters( 'awesome_weather_cache', 3600 ) );
|
160 |
}
|
|
|
|
|
|
|
161 |
}
|
162 |
|
163 |
+
|
164 |
+
|
165 |
// NO WEATHER
|
166 |
+
if( !$weather_data OR !isset($weather_data['now'])) { return awesome_weather_error(); }
|
167 |
|
168 |
|
169 |
// TODAYS TEMPS
|
170 |
+
$today = $weather_data['now'];
|
171 |
+
$today_temp = round($today->main->temp);
|
172 |
+
$today_high = round($today->main->temp_max);
|
173 |
+
$today_low = round($today->main->temp_min);
|
174 |
|
175 |
|
176 |
// COLOR OF WIDGET
|
198 |
// DATA
|
199 |
$header_title = $override_title ? $override_title : $today->name;
|
200 |
|
201 |
+
$today->main->humidity = round($today->main->humidity);
|
202 |
+
$today->wind->speed = round($today->wind->speed);
|
203 |
|
204 |
$wind_label = array (
|
205 |
__('N', 'awesome-weather'),
|
249 |
|
250 |
if($show_stats)
|
251 |
{
|
252 |
+
$speed_text = ($units == "metric") ? __('km/h', 'awesome-weather') : __('mph', 'awesome-weather');
|
253 |
+
|
254 |
+
|
255 |
$rtn .= "
|
256 |
|
257 |
<div class=\"awesome-weather-todays-stats\">
|
258 |
<div class=\"awe_desc\">{$today->weather[0]->description}</div>
|
259 |
+
<div class=\"awe_humidty\">" . __('humidity:', 'awesome-weather') . " {$today->main->humidity}% </div>
|
260 |
+
<div class=\"awe_wind\">" . __('wind:', 'awesome-weather') . " {$today->wind->speed}" . $speed_text . " {$wind_direction}</div>
|
261 |
+
<div class=\"awe_highlow\"> " .__('H', 'awesome-weather') . " {$today_high} • " . __('L', 'awesome-weather') . " {$today_low} </div>
|
262 |
</div> <!-- /.awesome-weather-todays-stats -->
|
263 |
";
|
264 |
}
|
275 |
{
|
276 |
if( $dt_today >= date('Ymd', $forecast->dt)) continue;
|
277 |
|
278 |
+
$forecast->temp = (int) $forecast->temp->day;
|
279 |
$day_of_week = date('D', $forecast->dt);
|
280 |
$rtn .= "
|
281 |
<div class=\"awesome-weather-forecast-day\">
|
289 |
$rtn .= " </div> <!-- /.awesome-weather-forecast -->";
|
290 |
}
|
291 |
|
292 |
+
if($show_link AND isset($today->id))
|
293 |
{
|
294 |
+
$show_link_text = apply_filters('awesome_weather_extended_forecast_text' , __('extended forecast', 'awesome-weather'));
|
295 |
|
296 |
$rtn .= "<div class=\"awesome-weather-more-weather-link\">";
|
297 |
+
$rtn .= "<a href=\"http://openweathermap.org/city/{$today->id}\" target=\"_blank\">{$show_link_text}</a>";
|
298 |
$rtn .= "</div> <!-- /.awesome-weather-more-weather-link -->";
|
299 |
}
|
300 |
|
368 |
$hide_stats = (isset($instance['hide_stats']) AND $instance['hide_stats'] == 1) ? 1 : 0;
|
369 |
$show_link = (isset($instance['show_link']) AND $instance['show_link'] == 1) ? 1 : 0;
|
370 |
$background = isset($instance['background']) ? esc_attr($instance['background']) : "";
|
371 |
+
?>
|
372 |
<p>
|
373 |
+
<label for="<?php echo $this->get_field_id('location'); ?>">
|
374 |
+
<?php _e('Location:', 'awesome-weather'); ?><br />
|
375 |
+
<small><?php _e('(i.e: London,UK or New York City,NY)', 'awesome-weather'); ?></small>
|
376 |
+
</label>
|
377 |
+
<input class="widefat" style="margin-top: 4px;" id="<?php echo $this->get_field_id('location'); ?>" name="<?php echo $this->get_field_name('location'); ?>" type="text" value="<?php echo $location; ?>" />
|
378 |
</p>
|
379 |
|
380 |
<p>
|
381 |
+
<label for="<?php echo $this->get_field_id('override_title'); ?>"><?php _e('Override Title:', 'awesome-weather'); ?></label>
|
382 |
<input class="widefat" id="<?php echo $this->get_field_id('override_title'); ?>" name="<?php echo $this->get_field_name('override_title'); ?>" type="text" value="<?php echo $override_title; ?>" />
|
383 |
</p>
|
384 |
|
385 |
<p>
|
386 |
+
<label for="<?php echo $this->get_field_id('units'); ?>"><?php _e('Units:', 'awesome-weather'); ?></label>
|
387 |
<input id="<?php echo $this->get_field_id('units'); ?>" name="<?php echo $this->get_field_name('units'); ?>" type="radio" value="F" <?php if($units == "F") echo ' checked="checked"'; ?> /> F
|
388 |
<input id="<?php echo $this->get_field_id('units'); ?>" name="<?php echo $this->get_field_name('units'); ?>" type="radio" value="C" <?php if($units == "C") echo ' checked="checked"'; ?> /> C
|
389 |
</p>
|
390 |
|
391 |
<p>
|
392 |
+
<label for="<?php echo $this->get_field_id('size'); ?>"><?php _e('Size:', 'awesome-weather'); ?></label>
|
393 |
<select class="widefat" id="<?php echo $this->get_field_id('size'); ?>" name="<?php echo $this->get_field_name('size'); ?>">
|
394 |
<?php foreach($awesome_weather_sizes as $size) { ?>
|
395 |
<option value="<?php echo $size; ?>"<?php if($selected_size == $size) echo " selected=\"selected\""; ?>><?php echo $size; ?></option>
|
398 |
</p>
|
399 |
|
400 |
<p>
|
401 |
+
<label for="<?php echo $this->get_field_id('forecast_days'); ?>"><?php _e('Forecast:', 'awesome-weather'); ?></label>
|
402 |
<select class="widefat" id="<?php echo $this->get_field_id('forecast_days'); ?>" name="<?php echo $this->get_field_name('forecast_days'); ?>">
|
403 |
<option value="5"<?php if($forecast_days == 5) echo " selected=\"selected\""; ?>>5 Days</option>
|
404 |
<option value="4"<?php if($forecast_days == 4) echo " selected=\"selected\""; ?>>4 Days</option>
|
410 |
</p>
|
411 |
|
412 |
<p>
|
413 |
+
<label for="<?php echo $this->get_field_id('background'); ?>"><?php _e('Background Image:', 'awesome-weather'); ?></label>
|
414 |
<input class="widefat" id="<?php echo $this->get_field_id('background'); ?>" name="<?php echo $this->get_field_name('background'); ?>" type="text" value="<?php echo $background; ?>" />
|
415 |
</p>
|
416 |
|
417 |
<p>
|
418 |
+
<label for="<?php echo $this->get_field_id('hide_stats'); ?>"><?php _e('Hide Stats:', 'awesome-weather'); ?></label>
|
419 |
<input id="<?php echo $this->get_field_id('hide_stats'); ?>" name="<?php echo $this->get_field_name('hide_stats'); ?>" type="checkbox" value="1" <?php if($hide_stats) echo ' checked="checked"'; ?> />
|
420 |
</p>
|
421 |
|
422 |
<p>
|
423 |
+
<label for="<?php echo $this->get_field_id('show_link'); ?>"><?php _e('Link to OpenWeatherMap:', 'awesome-weather'); ?></label>
|
424 |
<input id="<?php echo $this->get_field_id('show_link'); ?>" name="<?php echo $this->get_field_name('show_link'); ?>" type="checkbox" value="1" <?php if($show_link) echo ' checked="checked"'; ?> />
|
425 |
+
</p>
|
426 |
+
|
427 |
|
428 |
<?php
|
429 |
}
|
languages/awesome-weather.pot
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2013 Awesome Weather Widget
|
2 |
+
# This file is distributed under the same license as the Awesome Weather Widget package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: Awesome Weather Widget 1.3\n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/awesome-weather\n"
|
7 |
+
"POT-Creation-Date: 2013-07-23 18:07:09+00:00\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2013-07-23 13:08-0600\n"
|
12 |
+
"Last-Translator: Hal Gatewood <hal@halgatewood.com>\n"
|
13 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
+
|
15 |
+
#: awesome-weather.php:64
|
16 |
+
msgid "C"
|
17 |
+
msgstr ""
|
18 |
+
|
19 |
+
#: awesome-weather.php:64
|
20 |
+
msgid "F"
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: awesome-weather.php:205
|
24 |
+
msgid "N"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: awesome-weather.php:206
|
28 |
+
msgid "NNE"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: awesome-weather.php:207
|
32 |
+
msgid "NE"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: awesome-weather.php:208
|
36 |
+
msgid "ENE"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: awesome-weather.php:209
|
40 |
+
msgid "E"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: awesome-weather.php:210
|
44 |
+
msgid "ESE"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: awesome-weather.php:211
|
48 |
+
msgid "SE"
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
#: awesome-weather.php:212
|
52 |
+
msgid "SSE"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#: awesome-weather.php:213
|
56 |
+
msgid "S"
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: awesome-weather.php:214
|
60 |
+
msgid "SSW"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: awesome-weather.php:215
|
64 |
+
msgid "SW"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: awesome-weather.php:216
|
68 |
+
msgid "WSW"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: awesome-weather.php:217
|
72 |
+
msgid "W"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
#: awesome-weather.php:218
|
76 |
+
msgid "WNW"
|
77 |
+
msgstr ""
|
78 |
+
|
79 |
+
#: awesome-weather.php:219
|
80 |
+
msgid "NW"
|
81 |
+
msgstr ""
|
82 |
+
|
83 |
+
#: awesome-weather.php:220
|
84 |
+
msgid "NNW"
|
85 |
+
msgstr ""
|
86 |
+
|
87 |
+
#: awesome-weather.php:252
|
88 |
+
msgid "km/h"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: awesome-weather.php:252
|
92 |
+
msgid "mph"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: awesome-weather.php:259
|
96 |
+
msgid "humidity:"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
#: awesome-weather.php:260
|
100 |
+
msgid "wind:"
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
#: awesome-weather.php:261
|
104 |
+
msgid "H"
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: awesome-weather.php:261
|
108 |
+
msgid "L"
|
109 |
+
msgstr ""
|
110 |
+
|
111 |
+
#: awesome-weather.php:294
|
112 |
+
msgid "extended forecast"
|
113 |
+
msgstr ""
|
114 |
+
|
115 |
+
#: awesome-weather.php:316
|
116 |
+
msgid "No weather information available"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: awesome-weather.php:374
|
120 |
+
msgid "Location:"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: awesome-weather.php:375
|
124 |
+
msgid "(i.e: London,UK or New York City,NY)"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: awesome-weather.php:381
|
128 |
+
msgid "Override Title:"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: awesome-weather.php:386
|
132 |
+
msgid "Units:"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: awesome-weather.php:392
|
136 |
+
msgid "Size:"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: awesome-weather.php:401
|
140 |
+
msgid "Forecast:"
|
141 |
+
msgstr ""
|
142 |
+
|
143 |
+
#: awesome-weather.php:413
|
144 |
+
msgid "Background Image:"
|
145 |
+
msgstr ""
|
146 |
+
|
147 |
+
#: awesome-weather.php:418
|
148 |
+
msgid "Hide Stats:"
|
149 |
+
msgstr ""
|
150 |
+
|
151 |
+
#: awesome-weather.php:423
|
152 |
+
msgid "Link to OpenWeatherMap:"
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#. Plugin Name of the plugin/theme
|
156 |
+
msgid "Awesome Weather Widget"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
#. Plugin URI of the plugin/theme
|
160 |
+
msgid "http://halgatewood.com/awesome-weather"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#. Description of the plugin/theme
|
164 |
+
msgid "A weather widget that actually looks cool"
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#. Author of the plugin/theme
|
168 |
+
msgid "Hal Gatewood"
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#. Author URI of the plugin/theme
|
172 |
+
msgid "http://www.halgatewood.com"
|
173 |
+
msgstr ""
|
174 |
+
|
readme.txt
CHANGED
@@ -48,6 +48,9 @@ All weather data is provided by http://openweathermap.org and is cached for one
|
|
48 |
|
49 |
== Upgrade Notice ==
|
50 |
|
|
|
|
|
|
|
51 |
= 1.2.6 =
|
52 |
Improved error handling with API calls
|
53 |
|
@@ -77,6 +80,12 @@ Changed API endpoints. Might not find weather without update.
|
|
77 |
|
78 |
== Changelog ==
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
= 1.2.6 =
|
81 |
* Improved error handling with API calls
|
82 |
|
48 |
|
49 |
== Upgrade Notice ==
|
50 |
|
51 |
+
= 1.3 =
|
52 |
+
Upgraded to most recent OpenWeatherMap APIS and included translation files.
|
53 |
+
|
54 |
= 1.2.6 =
|
55 |
Improved error handling with API calls
|
56 |
|
80 |
|
81 |
== Changelog ==
|
82 |
|
83 |
+
= 1.3 =
|
84 |
+
* Upgraded to most recent OpenWeatherMap APIS
|
85 |
+
* Ready for translations
|
86 |
+
* Current Locales available from OpenWeatherMap:
|
87 |
+
* English - en, Russian - ru, Italian - it, Spanish - sp, Ukrainian - ua, German - de, Portuguese - pt, Romanian - ro, Polish - pl, Finnish - fi, Dutch - nl, French - fr, Bulgarian - bg, Swedish - se, Chinese Traditional - zh_tw, Chinese Simplified - zh_cn, Turkish - tr
|
88 |
+
|
89 |
= 1.2.6 =
|
90 |
* Improved error handling with API calls
|
91 |
|