From d2457fe922570dd307139b773bffd96f51d9abf2 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Mon, 13 Mar 2017 07:39:46 +0200 Subject: [PATCH] i18n: escape translation strings and fix wrong usage of i18n functions --- .../abstracts/abstract-wc-payment-gateway.php | 2 +- .../admin/class-wc-admin-setup-wizard.php | 124 +++++++++--------- .../class-wc-admin-webhooks-table-list.php | 6 +- .../class-wc-meta-box-product-reviews.php | 2 +- .../views/html-product-attribute.php | 4 +- .../views/html-product-data-shipping.php | 2 +- .../views/html-product-data-variations.php | 2 +- .../meta-boxes/views/html-variation-admin.php | 6 +- .../settings/class-wc-settings-checkout.php | 2 +- .../settings/class-wc-settings-emails.php | 8 +- .../settings/views/html-settings-tax.php | 2 +- .../admin/views/html-bulk-edit-product.php | 16 +-- includes/class-wc-download-handler.php | 2 +- includes/class-wc-install.php | 8 +- .../gateways/class-wc-payment-gateway-cc.php | 6 +- .../class-wc-payment-gateway-echeck.php | 4 +- includes/wc-template-functions.php | 18 +-- includes/wc-term-functions.php | 4 +- .../class-wc-widget-layered-nav-filters.php | 2 +- .../widgets/class-wc-widget-price-filter.php | 4 +- .../widgets/class-wc-widget-rating-filter.php | 2 +- .../class-wc-widget-recent-reviews.php | 2 +- templates/cart/shipping-calculator.php | 4 +- templates/loop/sale-flash.php | 2 +- templates/single-product-reviews.php | 20 +-- .../single-product/add-to-cart/variable.php | 2 +- templates/single-product/meta.php | 2 +- templates/single-product/sale-flash.php | 2 +- 28 files changed, 130 insertions(+), 130 deletions(-) diff --git a/includes/abstracts/abstract-wc-payment-gateway.php b/includes/abstracts/abstract-wc-payment-gateway.php index 3c3c24248e1..77221aefcb2 100644 --- a/includes/abstracts/abstract-wc-payment-gateway.php +++ b/includes/abstracts/abstract-wc-payment-gateway.php @@ -447,7 +447,7 @@ abstract class WC_Payment_Gateway extends WC_Settings_API { * @since 2.6.0 */ public function save_payment_method_checkbox() { - echo sprintf( + printf( '

diff --git a/includes/admin/class-wc-admin-setup-wizard.php b/includes/admin/class-wc-admin-setup-wizard.php index 445edb2eb9d..f5f935300b9 100644 --- a/includes/admin/class-wc-admin-setup-wizard.php +++ b/includes/admin/class-wc-admin-setup-wizard.php @@ -142,7 +142,7 @@ class WC_Admin_Setup_Wizard { - <?php _e( 'WooCommerce › Setup Wizard', 'woocommerce' ); ?> + <?php esc_html_e( 'WooCommerce › Setup Wizard', 'woocommerce' ); ?> @@ -158,7 +158,7 @@ class WC_Admin_Setup_Wizard { public function setup_wizard_footer() { ?> step ) : ?> - + @@ -200,12 +200,12 @@ class WC_Admin_Setup_Wizard { */ public function wc_setup_introduction() { ?> -

+

It’s completely optional and shouldn’t take longer than five minutes.', 'woocommerce' ); ?>

-

+

- - + +

-

+

pages. The following will be created automatically (if they do not already exist):', 'woocommerce' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?>

- - + + - + - + @@ -253,7 +253,7 @@ class WC_Admin_Setup_Wizard {

- +

@@ -289,11 +289,11 @@ class WC_Admin_Setup_Wizard { $dimension_unit = get_option( 'woocommerce_dimension_unit', 'cm' ); $weight_unit = get_option( 'woocommerce_weight_unit', 'kg' ); ?> -

+

- +
- +
- + - + - + - + - + - + - + - +

- +

@@ -409,29 +409,29 @@ class WC_Admin_Setup_Wizard { */ public function wc_setup_shipping_taxes() { ?> -

+

-

+

- + - + - + - - - - + + + + @@ -490,7 +490,7 @@ class WC_Admin_Setup_Wizard {
name="woocommerce_calc_shipping" class="input-checkbox" value="1" /> - +
id="woocommerce_calc_taxes" name="woocommerce_calc_taxes" class="input-checkbox" value="1" /> - +
-
- +
+

- +

@@ -639,7 +639,7 @@ class WC_Admin_Setup_Wizard { public function wc_setup_payments() { $gateways = $this->get_wizard_payment_gateways(); ?> -

+

Additional payment methods can be installed later and managed from the checkout settings screen.', 'woocommerce' ), esc_url( admin_url( 'admin.php?page=wc-addons&view=payment-gateways' ) ), esc_url( admin_url( 'admin.php?page=wc-settings&tab=checkout' ) ) ); ?>

@@ -683,7 +683,7 @@ class WC_Admin_Setup_Wizard {

- +

@@ -746,31 +746,31 @@ class WC_Admin_Setup_Wizard { -

+

', '' ); ?>

- - + +

-

+

    -
  • +

    -
  • - -
  • +
  • + +
diff --git a/includes/admin/class-wc-admin-webhooks-table-list.php b/includes/admin/class-wc-admin-webhooks-table-list.php index 0b21bfb4e01..201fdb292d5 100644 --- a/includes/admin/class-wc-admin-webhooks-table-list.php +++ b/includes/admin/class-wc-admin-webhooks-table-list.php @@ -101,12 +101,12 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table { if ( current_user_can( $post_type_object->cap->delete_post, $the_webhook->id ) ) { if ( 'trash' == $post_status ) { - $actions['untrash'] = '' . __( 'Restore', 'woocommerce' ) . ''; + $actions['untrash'] = '' . esc_html__( 'Restore', 'woocommerce' ) . ''; } elseif ( EMPTY_TRASH_DAYS ) { - $actions['trash'] = '' . __( 'Trash', 'woocommerce' ) . ''; + $actions['trash'] = '' . esc_html__( 'Trash', 'woocommerce' ) . ''; } if ( 'trash' == $post_status || ! EMPTY_TRASH_DAYS ) { - $actions['delete'] = '' . __( 'Delete permanently', 'woocommerce' ) . ''; + $actions['delete'] = '' . esc_html__( 'Delete permanently', 'woocommerce' ) . ''; } } diff --git a/includes/admin/meta-boxes/class-wc-meta-box-product-reviews.php b/includes/admin/meta-boxes/class-wc-meta-box-product-reviews.php index 5c25a24c977..59bcaeef561 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-product-reviews.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-product-reviews.php @@ -27,7 +27,7 @@ class WC_Meta_Box_Product_Reviews { ?> " placeholder="" /> @@ -66,7 +66,7 @@ - + diff --git a/includes/admin/meta-boxes/views/html-product-data-shipping.php b/includes/admin/meta-boxes/views/html-product-data-shipping.php index 16c5d6beef4..e4240541f07 100644 --- a/includes/admin/meta-boxes/views/html-product-data-shipping.php +++ b/includes/admin/meta-boxes/views/html-product-data-shipping.php @@ -16,7 +16,7 @@ if ( wc_product_dimensions_enabled() ) { ?>

- + diff --git a/includes/admin/meta-boxes/views/html-product-data-variations.php b/includes/admin/meta-boxes/views/html-product-data-variations.php index bedac760319..2962100cae6 100644 --- a/includes/admin/meta-boxes/views/html-product-data-variations.php +++ b/includes/admin/meta-boxes/views/html-product-data-variations.php @@ -18,7 +18,7 @@ $selected_value = isset( $default_attributes[ sanitize_title( $attribute->get_name() ) ] ) ? $default_attributes[ sanitize_title( $attribute->get_name() ) ] : ''; ?> "> is_taxonomy() ) : ?> get_terms() as $option ) : ?> @@ -50,7 +50,7 @@ if ( ! defined( 'ABSPATH' ) ) {