Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change textodomain to wp.org plugin slug #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ipma-weather-widget/admin/partials/widget-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

?>
<p>
<label for="<?php echo esc_attr( $title_id ); ?>"><?php esc_attr_e( 'Title', 'ipma-widget' ); ?>:</label>
<label for="<?php echo esc_attr( $title_id ); ?>"><?php esc_attr_e( 'Title', 'ipma-weather-widget' ); ?>:</label>
<input class="widefat" id="<?php echo esc_attr( $title_id ); ?>" name="<?php echo esc_attr( $title_field ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
</p>
2 changes: 1 addition & 1 deletion ipma-weather-widget/includes/class-ipma-widget-i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class IPMA_Widget_I18n {
public function load_plugin_textdomain() {

load_plugin_textdomain(
'ipma-widget',
'ipma-weather-widget',
false,
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
);
Expand Down
2 changes: 1 addition & 1 deletion ipma-weather-widget/includes/class-ipma-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private function define_public_hooks() {
*/
public function render_shortcode( $atts, $contents = null ) {
$args = array(
'widget_name' => __( 'Forecast', 'ipma-widget' ),
'widget_name' => __( 'Forecast', 'ipma-weather-widget' ),
'horizontal' => true,
);
ob_start();
Expand Down
2 changes: 1 addition & 1 deletion ipma-weather-widget/ipma-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Author URI: http://dipcode.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: ipma-widget
* Text Domain: ipma-weather-widget
* Domain Path: /languages
*/

Expand Down
56 changes: 28 additions & 28 deletions ipma-weather-widget/public/class-ipma-widget-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,34 +95,34 @@ public function javascript_translations() {
* List of all translatable strings to be rendered client-side.
*/
return array(
'forecast00' => __( 'Not available', 'ipma-widget' ),
'forecast01' => __( 'Clear sky', 'ipma-widget' ),
'forecast02' => __( 'Partly cloudy', 'ipma-widget' ),
'forecast03' => __( 'Mostly partly cloudy', 'ipma-widget' ),
'forecast04' => __( 'Cloudy sky', 'ipma-widget' ),
'forecast05' => __( 'Cloudy (high clouds)', 'ipma-widget' ),
'forecast06' => __( 'Showers', 'ipma-widget' ),
'forecast07' => __( 'Light showers', 'ipma-widget' ),
'forecast08' => __( 'Heavy showers', 'ipma-widget' ),
'forecast19' => __( 'Rain', 'ipma-widget' ),
'forecast20' => __( 'Light rain', 'ipma-widget' ),
'forecast21' => __( 'Heavy rain', 'ipma-widget' ),
'forecast22' => __( 'Intermittent rain', 'ipma-widget' ),
'forecast23' => __( 'Light intermittent rain', 'ipma-widget' ),
'forecast24' => __( 'Heavy intermittent rain', 'ipma-widget' ),
'forecast25' => __( 'Drizzle', 'ipma-widget' ),
'forecast26' => __( 'Mist', 'ipma-widget' ),
'forecast27' => __( 'Fog and low clouds', 'ipma-widget' ),
'forecast28' => __( 'Snow', 'ipma-widget' ),
'forecast29' => __( 'Lightning', 'ipma-widget' ),
'forecast30' => __( 'Intermittent rain and lightning', 'ipma-widget' ),
'forecast31' => __( 'Hail', 'ipma-widget' ),
'forecast32' => __( 'Frost', 'ipma-widget' ),
'forecast33' => __( 'Heavy rain and lightning', 'ipma-widget' ),
'forecast34' => __( 'Convective clouds', 'ipma-widget' ),
'forecast35' => __( 'Cloudy sky', 'ipma-widget' ),
'forecast36' => __( 'Fog', 'ipma-widget' ),
'forecast37' => __( 'Cloudy sky', 'ipma-widget' ),
'forecast00' => __( 'Not available', 'ipma-weather-widget' ),
'forecast01' => __( 'Clear sky', 'ipma-weather-widget' ),
'forecast02' => __( 'Partly cloudy', 'ipma-weather-widget' ),
'forecast03' => __( 'Mostly partly cloudy', 'ipma-weather-widget' ),
'forecast04' => __( 'Cloudy sky', 'ipma-weather-widget' ),
'forecast05' => __( 'Cloudy (high clouds)', 'ipma-weather-widget' ),
'forecast06' => __( 'Showers', 'ipma-weather-widget' ),
'forecast07' => __( 'Light showers', 'ipma-weather-widget' ),
'forecast08' => __( 'Heavy showers', 'ipma-weather-widget' ),
'forecast19' => __( 'Rain', 'ipma-weather-widget' ),
'forecast20' => __( 'Light rain', 'ipma-weather-widget' ),
'forecast21' => __( 'Heavy rain', 'ipma-weather-widget' ),
'forecast22' => __( 'Intermittent rain', 'ipma-weather-widget' ),
'forecast23' => __( 'Light intermittent rain', 'ipma-weather-widget' ),
'forecast24' => __( 'Heavy intermittent rain', 'ipma-weather-widget' ),
'forecast25' => __( 'Drizzle', 'ipma-weather-widget' ),
'forecast26' => __( 'Mist', 'ipma-weather-widget' ),
'forecast27' => __( 'Fog and low clouds', 'ipma-weather-widget' ),
'forecast28' => __( 'Snow', 'ipma-weather-widget' ),
'forecast29' => __( 'Lightning', 'ipma-weather-widget' ),
'forecast30' => __( 'Intermittent rain and lightning', 'ipma-weather-widget' ),
'forecast31' => __( 'Hail', 'ipma-weather-widget' ),
'forecast32' => __( 'Frost', 'ipma-weather-widget' ),
'forecast33' => __( 'Heavy rain and lightning', 'ipma-weather-widget' ),
'forecast34' => __( 'Convective clouds', 'ipma-weather-widget' ),
'forecast35' => __( 'Cloudy sky', 'ipma-weather-widget' ),
'forecast36' => __( 'Fog', 'ipma-weather-widget' ),
'forecast37' => __( 'Cloudy sky', 'ipma-weather-widget' ),
);
}
}
20 changes: 10 additions & 10 deletions ipma-weather-widget/public/partials/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@
?>
<section data-ipma-widget id="<?php echo esc_attr( $id ); ?>" class="widget widget_ipma ipma-widget-wrapper ipma-widget-<?php echo esc_attr( $display_mode ); ?>">
<figure class="ipma-widget-logo">
<a href="//www.ipma.pt/" title="<?php esc_attr_e( 'IPMA - The Portuguese Institute for Sea and Atmosphere', 'ipma-widget' ); ?>" target="_blank">
<img alt="<?php esc_attr_e( 'IPMA - The Portuguese Institute for Sea and Atmosphere', 'ipma-widget' ); ?>" src="<?php echo esc_url( $img_src ); ?>"/>
<a href="//www.ipma.pt/" title="<?php esc_attr_e( 'IPMA - The Portuguese Institute for Sea and Atmosphere', 'ipma-weather-widget' ); ?>" target="_blank">
<img alt="<?php esc_attr_e( 'IPMA - The Portuguese Institute for Sea and Atmosphere', 'ipma-weather-widget' ); ?>" src="<?php echo esc_url( $img_src ); ?>"/>
</a>
</figure>
<div class="ipma-widget-header">
<div data-ipma-widget-title class="ipma-widget-title">
<?php echo esc_html( $widget_title ); ?>
</div>
<select data-ipma-widget-select data-ipma-widget-district class="ipma-widget-select ipma-widget-select-district">
<option data-ipma-widget-placeholder><?php esc_html_e( 'Select a district','ipma-widget' ); ?></option>
<option data-ipma-widget-placeholder><?php esc_html_e( 'Select a district','ipma-weather-widget' ); ?></option>
</select>
<select data-ipma-widget-select data-ipma-widget-location class="ipma-widget-select ipma-widget-select-location">
<option data-ipma-widget-placeholder><?php esc_html_e( 'Select a location','ipma-widget' ); ?></option>
<option data-ipma-widget-placeholder><?php esc_html_e( 'Select a location','ipma-weather-widget' ); ?></option>
</select>
</div>
<div data-ipma-widget-unavailabe class="ipma-widget-unavailable hidden">
<h5><?php echo esc_html_e( 'Forecast temporarily unavailable', 'ipma-widget' ); ?></h5>
<h5><?php echo esc_html_e( 'Forecast temporarily unavailable', 'ipma-weather-widget' ); ?></h5>
</div>
<div data-ipma-widget-forecasts class="ipma-widget-forecasts hidden">
<?php for ( $i = 0; $i < $forecast_depth; $i++ ) : ?>
Expand All @@ -52,9 +52,9 @@
/* Default: Weekday */
$date_string = date_i18n( 'l', $today->format( 'U' ) );
/* Today */
$date_string = (0 == $i) ? __( 'Today','ipma-widget' ) : $date_string;
$date_string = (0 == $i) ? __( 'Today','ipma-weather-widget' ) : $date_string;
/* Tomorrow */
$date_string = (1 == $i) ? __( 'Tomorrow','ipma-widget' ) : $date_string;
$date_string = (1 == $i) ? __( 'Tomorrow','ipma-weather-widget' ) : $date_string;


?>
Expand All @@ -66,9 +66,9 @@
<figure class="ipma-widget-forecast-icon disabled">
<img data-ipma-forecast-icon alt=""/>
</figure>
<span title="<?php esc_attr_e( 'Minimum', 'ipma-widget' ); ?>" class="ipma-widget-forecast-value ipma-widget-forecast-minimum-temperature"><span data-ipma-forecast-mintemp>0</span>º</span>
<span title="<?php esc_attr_e( 'Maximum', 'ipma-widget' ); ?>" class="ipma-widget-forecast-value ipma-widget-forecast-maximum-temperature"><span data-ipma-forecast-maxtemp>0</span>º</span>
<span title="<?php esc_attr_e( 'Precipitation', 'ipma-widget' ); ?>" class="ipma-widget-forecast-value ipma-widget-forecast-precipitation"><span data-ipma-forecast-precip>0</span><sup>%</sup></span>
<span title="<?php esc_attr_e( 'Minimum', 'ipma-weather-widget' ); ?>" class="ipma-widget-forecast-value ipma-widget-forecast-minimum-temperature"><span data-ipma-forecast-mintemp>0</span>º</span>
<span title="<?php esc_attr_e( 'Maximum', 'ipma-weather-widget' ); ?>" class="ipma-widget-forecast-value ipma-widget-forecast-maximum-temperature"><span data-ipma-forecast-maxtemp>0</span>º</span>
<span title="<?php esc_attr_e( 'Precipitation', 'ipma-weather-widget' ); ?>" class="ipma-widget-forecast-value ipma-widget-forecast-precipitation"><span data-ipma-forecast-precip>0</span><sup>%</sup></span>
</div>
<?php endfor; ?>
</div>
Expand Down
6 changes: 3 additions & 3 deletions ipma-weather-widget/widgets/class-meteo-ipma.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class Meteo_IPMA extends WP_Widget {
public function __construct() {
parent::__construct(
$this->get_widget_slug(),
__( 'Weather Forecast in Portugal', 'ipma-widget' ),
__( 'Weather Forecast in Portugal', 'ipma-weather-widget' ),
array(
'classname' => 'ipma-widget-class',
'description' => __( 'Provides a weather forecast for Portuguese regions', 'ipma-widget' ),
'description' => __( 'Provides a weather forecast for Portuguese regions', 'ipma-weather-widget' ),
)
);
}
Expand Down Expand Up @@ -113,7 +113,7 @@ public function form( $instance ) {
(array) $instance
);

$title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'New title', 'ipma-widget' );
$title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'New title', 'ipma-weather-widget' );
$title_id = $this->get_field_id( 'title' );
$title_field = $this->get_field_name( 'title' );
include( plugin_dir_path( __DIR__ ) . 'admin/partials/widget-form.php' );
Expand Down