diff --git a/assets/css/photoswipe/default-skin/default-skin.css b/assets/css/photoswipe/default-skin/default-skin.css index f99db1be625..f678fea2f08 100755 --- a/assets/css/photoswipe/default-skin/default-skin.css +++ b/assets/css/photoswipe/default-skin/default-skin.css @@ -12,7 +12,7 @@ */ /* - + 1. Buttons */ @@ -257,7 +257,7 @@ a.pswp__share--download:hover { padding: 0 10px; } /* - + 4. Caption */ @@ -338,8 +338,8 @@ a.pswp__share--download:hover { margin: 0; } .pswp--css_animation .pswp__preloader__cut { - /* - The idea of animating inner circle is based on Polymer ("material") loading indicator + /* + The idea of animating inner circle is based on Polymer ("material") loading indicator by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html */ position: relative; @@ -409,7 +409,7 @@ a.pswp__share--download:hover { transform: rotate(0); } } /* - + 6. Additional styles */ diff --git a/assets/css/woocommerce.scss b/assets/css/woocommerce.scss index 2e40398f227..3d3bad2f0e9 100644 --- a/assets/css/woocommerce.scss +++ b/assets/css/woocommerce.scss @@ -1611,6 +1611,7 @@ p.demo_store, button.pswp__button { box-shadow: none !important; + background-image: url('photoswipe/default-skin/default-skin.png') !important; } button.pswp__button, diff --git a/assets/js/admin/meta-boxes-product-variation.js b/assets/js/admin/meta-boxes-product-variation.js index 5e0e86a7a86..5380587b563 100644 --- a/assets/js/admin/meta-boxes-product-variation.js +++ b/assets/js/admin/meta-boxes-product-variation.js @@ -31,6 +31,7 @@ jQuery( function( $ ) { */ reload: function() { wc_meta_boxes_product_variations_ajax.load_variations( 1 ); + wc_meta_boxes_product_variations_pagenav.set_paginav( 0 ); }, /** diff --git a/assets/js/frontend/single-product.js b/assets/js/frontend/single-product.js index 1e337b2fe13..8feef6e0dc4 100644 --- a/assets/js/frontend/single-product.js +++ b/assets/js/frontend/single-product.js @@ -179,7 +179,9 @@ jQuery( function( $ ) { /** * Initialise photoswipe. */ - trigger_photoswipe: function() { + trigger_photoswipe: function( e ) { + e.preventDefault(); + var pswpElement = $( '.pswp' )[0]; // Build items array. diff --git a/i18n/states/IE.php b/i18n/states/IE.php new file mode 100644 index 00000000000..ca686dd7e94 --- /dev/null +++ b/i18n/states/IE.php @@ -0,0 +1,39 @@ + __( 'Clare', 'woocommerce' ), + 'CK' => __( 'Cork', 'woocommerce' ), + 'CN' => __( 'Cavan', 'woocommerce' ), + 'CW' => __( 'Carlow', 'woocommerce' ), + 'DL' => __( 'Donegal', 'woocommerce' ), + 'DN' => __( 'Dublin', 'woocommerce' ), + 'GY' => __( 'Galway', 'woocommerce' ), + 'KE' => __( 'Kildare', 'woocommerce' ), + 'KK' => __( 'Kilkenny', 'woocommerce' ), + 'KY' => __( 'Kerry', 'woocommerce' ), + 'LD' => __( 'Longford', 'woocommerce' ), + 'LH' => __( 'Louth', 'woocommerce' ), + 'LK' => __( 'Limerick', 'woocommerce' ), + 'LM' => __( 'Leitrim', 'woocommerce' ), + 'LS' => __( 'Laois', 'woocommerce' ), + 'MH' => __( 'Meath', 'woocommerce' ), + 'MN' => __( 'Monaghan', 'woocommerce' ), + 'MO' => __( 'Mayo', 'woocommerce' ), + 'OY' => __( 'Offaly', 'woocommerce' ), + 'RN' => __( 'Roscommon', 'woocommerce' ), + 'SO' => __( 'Sligo', 'woocommerce' ), + 'TY' => __( 'Tipperary', 'woocommerce' ), + 'WD' => __( 'Waterford', 'woocommerce' ), + 'WH' => __( 'Westmeath', 'woocommerce' ), + 'WW' => __( 'Wicklow', 'woocommerce' ), + 'WX' => __( 'Wexford', 'woocommerce' ), +); diff --git a/includes/abstracts/abstract-wc-order.php b/includes/abstracts/abstract-wc-order.php index 5b47e4981b1..0725c9f2471 100644 --- a/includes/abstracts/abstract-wc-order.php +++ b/includes/abstracts/abstract-wc-order.php @@ -146,6 +146,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order { */ protected function get_post_title() { // @codingStandardsIgnoreStart + /* translators: %s: Order date */ return sprintf( __( 'Order – %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Order date parsed by strftime', 'woocommerce' ) ) ); // @codingStandardsIgnoreEnd } @@ -1511,6 +1512,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order { } } + /* translators: %s: shipping method */ $shipping .= apply_filters( 'woocommerce_order_shipping_to_display_shipped_via', ' ' . sprintf( __( 'via %s', 'woocommerce' ), $this->get_shipping_method() ) . '', $this ); } elseif ( $this->get_shipping_method() ) { diff --git a/includes/abstracts/abstract-wc-product.php b/includes/abstracts/abstract-wc-product.php index 5de133bfb0b..10666fe0ae1 100644 --- a/includes/abstracts/abstract-wc-product.php +++ b/includes/abstracts/abstract-wc-product.php @@ -694,6 +694,7 @@ class WC_Product { break; case 'low_amount' : if ( $this->get_total_stock() <= get_option( 'woocommerce_notify_low_stock_amount' ) ) { + /* translators: %s: total items in stock */ $availability = sprintf( __( 'Only %s left in stock', 'woocommerce' ), $this->get_total_stock() ); if ( $this->backorders_allowed() && $this->backorders_require_notification() ) { @@ -704,6 +705,7 @@ class WC_Product { } break; default : + /* translators: %s: total items in stock */ $availability = sprintf( __( '%s in stock', 'woocommerce' ), $this->get_total_stock() ); if ( $this->backorders_allowed() && $this->backorders_require_notification() ) { @@ -1187,8 +1189,10 @@ class WC_Product { if ( $rating > 0 ) { + /* translators: %s: rating */ $rating_html = '
'; + /* translators: %s: rating */ $rating_html .= '' . sprintf( __( '%s out of 5', 'woocommerce' ), '' . $rating . '' ) . ''; $rating_html .= '
'; diff --git a/includes/abstracts/abstract-wc-rest-controller.php b/includes/abstracts/abstract-wc-rest-controller.php index 6d4616868e1..bb2941304e1 100644 --- a/includes/abstracts/abstract-wc-rest-controller.php +++ b/includes/abstracts/abstract-wc-rest-controller.php @@ -93,6 +93,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller { } if ( $total > $limit ) { + /* translators: %s: items limit */ return new WP_Error( 'woocommerce_rest_request_entity_too_large', sprintf( __( 'Unable to accept more than %s items for this request.', 'woocommerce' ), $limit ), array( 'status' => 413 ) ); } diff --git a/includes/abstracts/abstract-wc-rest-posts-controller.php b/includes/abstracts/abstract-wc-rest-posts-controller.php index 63d271877ce..89861551737 100644 --- a/includes/abstracts/abstract-wc-rest-posts-controller.php +++ b/includes/abstracts/abstract-wc-rest-posts-controller.php @@ -173,6 +173,7 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { */ public function create_item( $request ) { if ( ! empty( $request['id'] ) ) { + /* translators: %s: post type */ return new WP_Error( "woocommerce_rest_{$this->post_type}_exists", sprintf( __( 'Cannot create existing %s.', 'woocommerce' ), $this->post_type ), array( 'status' => 400 ) ); } @@ -431,6 +432,7 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { $supports_trash = apply_filters( "woocommerce_rest_{$this->post_type}_trashable", $supports_trash, $post ); if ( ! wc_rest_check_post_permissions( $this->post_type, 'delete', $post->ID ) ) { + /* translators: %s: post type */ return new WP_Error( "woocommerce_rest_user_cannot_delete_{$this->post_type}", sprintf( __( 'Sorry, you are not allowed to delete %s.', 'woocommerce' ), $this->post_type ), array( 'status' => rest_authorization_required_code() ) ); } @@ -443,11 +445,13 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { } else { // If we don't support trashing for this type, error out. if ( ! $supports_trash ) { + /* translators: %s: post type */ return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( 'The %s does not support trashing.', 'woocommerce' ), $this->post_type ), array( 'status' => 501 ) ); } // Otherwise, only trash if we haven't already. if ( 'trash' === $post->post_status ) { + /* translators: %s: post type */ return new WP_Error( 'woocommerce_rest_already_trashed', sprintf( __( 'The %s has already been deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 410 ) ); } @@ -457,6 +461,7 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { } if ( ! $result ) { + /* translators: %s: post type */ return new WP_Error( 'woocommerce_rest_cannot_delete', sprintf( __( 'The %s cannot be deleted.', 'woocommerce' ), $this->post_type ), array( 'status' => 500 ) ); } diff --git a/includes/admin/class-wc-admin-assets.php b/includes/admin/class-wc-admin-assets.php index c4aaf9c5d2c..59f94b4df02 100644 --- a/includes/admin/class-wc-admin-assets.php +++ b/includes/admin/class-wc-admin-assets.php @@ -143,7 +143,9 @@ class WC_Admin_Assets { $decimal = isset( $locale['decimal_point'] ) ? $locale['decimal_point'] : '.'; $params = array( + /* translators: %s: decimal */ 'i18n_decimal_error' => sprintf( __( 'Please enter in decimal (%s) format without thousand separators.', 'woocommerce' ), $decimal ), + /* translators: %s: price decimal separator */ 'i18n_mon_decimal_error' => sprintf( __( 'Please enter in monetary decimal (%s) format without thousand separators and currency symbols.', 'woocommerce' ), wc_get_price_decimal_separator() ), 'i18n_country_iso_error' => __( 'Please enter in country code with two capital letters.', 'woocommerce' ), 'i18_sale_less_than_regular_error' => __( 'Please enter in a value less than the regular price.', 'woocommerce' ), diff --git a/includes/admin/class-wc-admin-attributes.php b/includes/admin/class-wc-admin-attributes.php index 8bac78285c9..4d35caad5f0 100644 --- a/includes/admin/class-wc-admin-attributes.php +++ b/includes/admin/class-wc-admin-attributes.php @@ -95,8 +95,10 @@ class WC_Admin_Attributes { */ private static function valid_attribute_name( $attribute_name ) { if ( strlen( $attribute_name ) >= 28 ) { + /* translators: %s: attribute name */ return new WP_Error( 'error', sprintf( __( 'Slug "%s" is too long (28 characters max). Shorten it, please.', 'woocommerce' ), sanitize_title( $attribute_name ) ) ); } elseif ( wc_check_if_attribute_name_is_reserved( $attribute_name ) ) { + /* translators: %s: attribute name */ return new WP_Error( 'error', sprintf( __( 'Slug "%s" is not allowed because it is a reserved term. Change it, please.', 'woocommerce' ), sanitize_title( $attribute_name ) ) ); } @@ -118,6 +120,7 @@ class WC_Admin_Attributes { } elseif ( ( $valid_attribute_name = self::valid_attribute_name( $attribute['attribute_name'] ) ) && is_wp_error( $valid_attribute_name ) ) { return $valid_attribute_name; } elseif ( taxonomy_exists( wc_attribute_taxonomy_name( $attribute['attribute_name'] ) ) ) { + /* translators: %s: attribute name */ return new WP_Error( 'error', sprintf( __( 'Slug "%s" is already in use. Change it, please.', 'woocommerce' ), sanitize_title( $attribute['attribute_name'] ) ) ); } @@ -151,6 +154,7 @@ class WC_Admin_Attributes { $taxonomy_exists = taxonomy_exists( wc_attribute_taxonomy_name( $attribute['attribute_name'] ) ); $old_attribute_name = $wpdb->get_var( "SELECT attribute_name FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_id = $attribute_id" ); if ( $old_attribute_name != $attribute['attribute_name'] && wc_sanitize_taxonomy_name( $old_attribute_name ) != $attribute['attribute_name'] && $taxonomy_exists ) { + /* translators: %s: attribute name */ return new WP_Error( 'error', sprintf( __( 'Slug "%s" is already in use. Change it, please.', 'woocommerce' ), sanitize_title( $attribute['attribute_name'] ) ) ); } diff --git a/includes/admin/class-wc-admin-dashboard.php b/includes/admin/class-wc-admin-dashboard.php index 3e5bcd9297b..e9083ee222f 100644 --- a/includes/admin/class-wc-admin-dashboard.php +++ b/includes/admin/class-wc-admin-dashboard.php @@ -96,7 +96,13 @@ class WC_Admin_Dashboard {
  • sales_sparkline( '', max( 7, date( 'd', current_time( 'timestamp' ) ) ) ); ?> - ' . wc_price( $report_data->net_sales ) . '' ); ?> + ' . wc_price( $report_data->net_sales ) . '' + ); + ?>
  • sales_sparkline( $top_seller->product_id, max( 7, date( 'd', current_time( 'timestamp' ) ) ), 'count' ); ?> - ' . get_the_title( $top_seller->product_id ) . '', $top_seller->qty ); ?> + ' . get_the_title( $top_seller->product_id ) . '', + $top_seller->qty + ); + ?>
  • - %s order awaiting processing", "%s orders awaiting processing", $processing_count, 'woocommerce' ), $processing_count ); ?> + %s order awaiting processing', '%s orders awaiting processing', $processing_count, 'woocommerce' ), + $processing_count + ); + ?>
  • - %s order on-hold", "%s orders on-hold", $on_hold_count, 'woocommerce' ), $on_hold_count ); ?> + %s order on-hold', '%s orders on-hold', $on_hold_count, 'woocommerce' ), + $on_hold_count + ); + ?>
  • - %s product low in stock", "%s products low in stock", $lowinstock_count, 'woocommerce' ), $lowinstock_count ); ?> + %s product low in stock', '%s products low in stock', $lowinstock_count, 'woocommerce' ), + $lowinstock_count + ); + ?>
  • - %s product out of stock", "%s products out of stock", $outofstock_count, 'woocommerce' ), $outofstock_count ); ?> + %s product out of stock', '%s products out of stock', $outofstock_count, 'woocommerce' ), + $outofstock_count + ); + ?>
  • comment_ID, 'rating', true ) ); - echo '
    - ' . sprintf( __( '%s out of 5', 'woocommerce' ), $rating ) . '
    '; + /* translators: %s: rating */ + echo '
    ' . sprintf( __( '%s out of 5', 'woocommerce' ), $rating ) . '
    '; + /* translators: %s: review author */ echo '

    ' . esc_html( apply_filters( 'woocommerce_admin_dashboard_recent_reviews', $comment->post_title, $comment ) ) . ' ' . sprintf( __( 'reviewed by %s', 'woocommerce' ), esc_html( $comment->comment_author ) ) . '

    '; echo '
    ' . wp_kses_data( $comment->comment_excerpt ) . ' [...]
    '; diff --git a/includes/admin/class-wc-admin-duplicate-product.php b/includes/admin/class-wc-admin-duplicate-product.php index 0e098c649c2..bda8187c508 100644 --- a/includes/admin/class-wc-admin-duplicate-product.php +++ b/includes/admin/class-wc-admin-duplicate-product.php @@ -103,6 +103,7 @@ class WC_Admin_Duplicate_Product { wp_redirect( admin_url( 'post.php?action=edit&post=' . $new_id ) ); exit; } else { + /* translators: %s: product id */ wp_die( sprintf( __( 'Product creation failed, could not find original product: %s', 'woocommerce' ), $id ) ); } } @@ -164,6 +165,7 @@ class WC_Admin_Duplicate_Product { // Set title for variations if ( 'product_variation' === $post->post_type ) { + /* translators: 1: variation id 2: product name */ $post_title = sprintf( __( 'Variation #%1$s of %2$s', 'woocommerce' ), absint( $new_post_id ), esc_html( get_the_title( $post_parent ) ) ); $wpdb->update( $wpdb->posts, diff --git a/includes/admin/class-wc-admin-post-types.php b/includes/admin/class-wc-admin-post-types.php index 7279b64772e..a01103eec5c 100644 --- a/includes/admin/class-wc-admin-post-types.php +++ b/includes/admin/class-wc-admin-post-types.php @@ -132,12 +132,17 @@ class WC_Admin_Post_Types { 2 => __( 'Custom field updated.', 'woocommerce' ), 3 => __( 'Custom field deleted.', 'woocommerce' ), 4 => __( 'Product updated.', 'woocommerce' ), + /* translators: %s: revision title */ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Product restored to revision from %s', 'woocommerce' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, + /* translators: %s: product url */ 6 => sprintf( __( 'Product published. View Product', 'woocommerce' ), esc_url( get_permalink( $post_ID ) ) ), 7 => __( 'Product saved.', 'woocommerce' ), + /* translators: %s: product url */ 8 => sprintf( __( 'Product submitted. Preview product', 'woocommerce' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) ), + /* translators: 1: date 2: product url */ 9 => sprintf( __( 'Product scheduled for: %1$s. Preview product', 'woocommerce' ), date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post_ID ) ) ), + /* translators: %s: product url */ 10 => sprintf( __( 'Product draft updated. Preview product', 'woocommerce' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) ), ); @@ -147,10 +152,12 @@ class WC_Admin_Post_Types { 2 => __( 'Custom field updated.', 'woocommerce' ), 3 => __( 'Custom field deleted.', 'woocommerce' ), 4 => __( 'Order updated.', 'woocommerce' ), + /* translators: %s: revision title */ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Order restored to revision from %s', 'woocommerce' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 6 => __( 'Order updated.', 'woocommerce' ), 7 => __( 'Order saved.', 'woocommerce' ), 8 => __( 'Order submitted.', 'woocommerce' ), + /* translators: %s: date */ 9 => sprintf( __( 'Order scheduled for: %1$s.', 'woocommerce' ), date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ) ), 10 => __( 'Order draft updated.', 'woocommerce' ), @@ -163,10 +170,12 @@ class WC_Admin_Post_Types { 2 => __( 'Custom field updated.', 'woocommerce' ), 3 => __( 'Custom field deleted.', 'woocommerce' ), 4 => __( 'Coupon updated.', 'woocommerce' ), + /* translators: %s: revision title */ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Coupon restored to revision from %s', 'woocommerce' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 6 => __( 'Coupon updated.', 'woocommerce' ), 7 => __( 'Coupon saved.', 'woocommerce' ), 8 => __( 'Coupon submitted.', 'woocommerce' ), + /* translators: %s: date */ 9 => sprintf( __( 'Coupon scheduled for: %1$s.', 'woocommerce' ), date_i18n( __( 'M j, Y @ G:i', 'woocommerce' ), strtotime( $post->post_date ) ) ), 10 => __( 'Coupon draft updated.', 'woocommerce' ), @@ -184,26 +193,41 @@ class WC_Admin_Post_Types { public function bulk_post_updated_messages( $bulk_messages, $bulk_counts ) { $bulk_messages['product'] = array( + /* translators: %s: product count */ 'updated' => _n( '%s product updated.', '%s products updated.', $bulk_counts['updated'], 'woocommerce' ), + /* translators: %s: product count */ 'locked' => _n( '%s product not updated, somebody is editing it.', '%s products not updated, somebody is editing them.', $bulk_counts['locked'], 'woocommerce' ), + /* translators: %s: product count */ 'deleted' => _n( '%s product permanently deleted.', '%s products permanently deleted.', $bulk_counts['deleted'], 'woocommerce' ), + /* translators: %s: product count */ 'trashed' => _n( '%s product moved to the Trash.', '%s products moved to the Trash.', $bulk_counts['trashed'], 'woocommerce' ), + /* translators: %s: product count */ 'untrashed' => _n( '%s product restored from the Trash.', '%s products restored from the Trash.', $bulk_counts['untrashed'], 'woocommerce' ), ); $bulk_messages['shop_order'] = array( + /* translators: %s: order count */ 'updated' => _n( '%s order updated.', '%s orders updated.', $bulk_counts['updated'], 'woocommerce' ), + /* translators: %s: order count */ 'locked' => _n( '%s order not updated, somebody is editing it.', '%s orders not updated, somebody is editing them.', $bulk_counts['locked'], 'woocommerce' ), + /* translators: %s: order count */ 'deleted' => _n( '%s order permanently deleted.', '%s orders permanently deleted.', $bulk_counts['deleted'], 'woocommerce' ), + /* translators: %s: order count */ 'trashed' => _n( '%s order moved to the Trash.', '%s orders moved to the Trash.', $bulk_counts['trashed'], 'woocommerce' ), + /* translators: %s: order count */ 'untrashed' => _n( '%s order restored from the Trash.', '%s orders restored from the Trash.', $bulk_counts['untrashed'], 'woocommerce' ), ); $bulk_messages['shop_coupon'] = array( + /* translators: %s: coupon count */ 'updated' => _n( '%s coupon updated.', '%s coupons updated.', $bulk_counts['updated'], 'woocommerce' ), + /* translators: %s: coupon count */ 'locked' => _n( '%s coupon not updated, somebody is editing it.', '%s coupons not updated, somebody is editing them.', $bulk_counts['locked'], 'woocommerce' ), + /* translators: %s: coupon count */ 'deleted' => _n( '%s coupon permanently deleted.', '%s coupons permanently deleted.', $bulk_counts['deleted'], 'woocommerce' ), + /* translators: %s: coupon count */ 'trashed' => _n( '%s coupon moved to the Trash.', '%s coupons moved to the Trash.', $bulk_counts['trashed'], 'woocommerce' ), + /* translators: %s: coupon count */ 'untrashed' => _n( '%s coupon restored from the Trash.', '%s coupons restored from the Trash.', $bulk_counts['untrashed'], 'woocommerce' ), ); @@ -462,9 +486,12 @@ class WC_Admin_Post_Types { } if ( $post_type_object->public ) { if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) { - if ( $can_edit_post ) + if ( $can_edit_post ) { + /* translators: %s: product title */ $actions['view'] = '' . __( 'Preview', 'woocommerce' ) . ''; + } } elseif ( 'trash' != $post->post_status ) { + /* translators: %s: product title */ $actions['view'] = '' . __( 'View', 'woocommerce' ) . ''; } } @@ -647,6 +674,7 @@ class WC_Admin_Post_Types { break; case 'order_items' : + /* translators: %d: order items count */ echo '' . apply_filters( 'woocommerce_admin_order_item_count', sprintf( _n( '%d item', '%d items', $the_order->get_item_count(), 'woocommerce' ), $the_order->get_item_count() ), $the_order ) . ''; if ( sizeof( $the_order->get_items() ) > 0 ) { @@ -722,8 +750,10 @@ class WC_Admin_Post_Types { if ( isset( $latest_note->comment_content ) && 1 == $post->comment_count ) { echo '' . __( 'Yes', 'woocommerce' ) . ''; } elseif ( isset( $latest_note->comment_content ) ) { + /* translators: %d: notes count */ echo '' . sprintf( _n( 'plus %d other note', 'plus %d other notes', ( $post->comment_count - 1 ), 'woocommerce' ), $post->comment_count - 1 ) . '' ) . '">' . __( 'Yes', 'woocommerce' ) . ''; } else { + /* translators: %d: notes count */ echo '' . __( 'Yes', 'woocommerce' ) . ''; } } else { @@ -749,6 +779,7 @@ class WC_Admin_Post_Types { $username = ''; if ( $user_info->first_name || $user_info->last_name ) { + /* translators: 1: first name 2: last name */ $username .= esc_html( sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), ucfirst( $user_info->first_name ), ucfirst( $user_info->last_name ) ) ); } else { $username .= esc_html( ucfirst( $user_info->display_name ) ); @@ -758,6 +789,7 @@ class WC_Admin_Post_Types { } else { if ( $the_order->get_billing_first_name()|| $the_order->get_billing_last_name() ) { + /* translators: 1: first name 2: last name */ $username = trim( sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $the_order->get_billing_first_name(), $the_order->get_billing_last_name() ) ); } elseif ( $the_order->get_billing_company() ) { $username = trim( $the_order->get_billing_company() ); @@ -1516,6 +1548,7 @@ class WC_Admin_Post_Types { if ( isset( $_REQUEST[ 'marked_' . str_replace( 'wc-', '', $slug ) ] ) ) { $number = isset( $_REQUEST['changed'] ) ? absint( $_REQUEST['changed'] ) : 0; + /* translators: %s: orders count */ $message = sprintf( _n( 'Order status changed.', '%s order statuses changed.', $number, 'woocommerce' ), number_format_i18n( $number ) ); echo '

    ' . $message . '

    '; @@ -1703,6 +1736,7 @@ class WC_Admin_Post_Types { if ( ! empty( $_GET['_customer_user'] ) ) { $user_id = absint( $_GET['_customer_user'] ); $user = get_user_by( 'id', $user_id ); + /* translators: 1: user display name 2: user ID 3: user email */ $user_string = sprintf( esc_html__( '%1$s (#%2$s – %3$s)', 'woocommerce' ), $user->display_name, diff --git a/includes/admin/class-wc-admin-webhooks-table-list.php b/includes/admin/class-wc-admin-webhooks-table-list.php index e2015f91ee2..74130f7715e 100644 --- a/includes/admin/class-wc-admin-webhooks-table-list.php +++ b/includes/admin/class-wc-admin-webhooks-table-list.php @@ -160,6 +160,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table { private function get_status_label( $status_name, $status ) { switch ( $status_name ) { case 'publish' : + /* translators: %s: count */ $label = array( 'singular' => __( 'Activated (%s)', 'woocommerce' ), 'plural' => __( 'Activated (%s)', 'woocommerce' ), @@ -168,6 +169,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table { ); break; case 'draft' : + /* translators: %s: count */ $label = array( 'singular' => __( 'Paused (%s)', 'woocommerce' ), 'plural' => __( 'Paused (%s)', 'woocommerce' ), @@ -176,6 +178,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table { ); break; case 'pending' : + /* translators: %s: count */ $label = array( 'singular' => __( 'Disabled (%s)', 'woocommerce' ), 'plural' => __( 'Disabled (%s)', 'woocommerce' ), @@ -209,6 +212,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table { } $class = empty( $class ) && empty( $_REQUEST['status'] ) ? ' class="current"' : ''; + /* translators: %s: count */ $status_links['all'] = "
    " . sprintf( _nx( 'All (%s)', 'All (%s)', $total_posts, 'posts', 'woocommerce' ), number_format_i18n( $total_posts ) ) . ''; foreach ( get_post_stati( array( 'show_in_admin_status_list' => true ), 'objects' ) as $status ) { diff --git a/includes/admin/class-wc-admin-webhooks.php b/includes/admin/class-wc-admin-webhooks.php index 2a633fbf5f5..042bc7b7444 100644 --- a/includes/admin/class-wc-admin-webhooks.php +++ b/includes/admin/class-wc-admin-webhooks.php @@ -47,6 +47,7 @@ class WC_Admin_Webhooks { global $wpdb; // @codingStandardsIgnoreStart + /* translators: %s: date` */ $name = ! empty( $_POST['webhook_name'] ) ? $_POST['webhook_name'] : sprintf( __( 'Webhook created on %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Webhook created on date parsed by strftime', 'woocommerce' ) ) ); // @codingStandardsIgnoreEnd $wpdb->update( $wpdb->posts, array( 'post_title' => $name ), array( 'ID' => $webhook_id ) ); @@ -198,6 +199,7 @@ class WC_Admin_Webhooks { 'post_author' => get_current_user_id(), 'post_password' => strlen( ( $password = uniqid( 'webhook_' ) ) ) > 20 ? substr( $password, 0, 20 ) : $password, // @codingStandardsIgnoreStart + /* translators: %s: date */ 'post_title' => sprintf( __( 'Webhook created on %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Webhook created on date parsed by strftime', 'woocommerce' ) ) ), // @codingStandardsIgnoreEnd 'comment_status' => 'open', @@ -375,19 +377,22 @@ class WC_Admin_Webhooks { if ( isset( $_GET['trashed'] ) ) { $trashed = absint( $_GET['trashed'] ); - WC_Admin_Settings::add_message( sprintf( _n( '1 webhook moved to the Trash.', '%d webhooks moved to the Trash.', $trashed, 'woocommerce' ), $trashed ) ); + /* translators: %d: count */ + WC_Admin_Settings::add_message( sprintf( _n( '%d webhook moved to the Trash.', '%d webhooks moved to the Trash.', $trashed, 'woocommerce' ), $trashed ) ); } if ( isset( $_GET['untrashed'] ) ) { $untrashed = absint( $_GET['untrashed'] ); - WC_Admin_Settings::add_message( sprintf( _n( '1 webhook restored from the Trash.', '%d webhooks restored from the Trash.', $untrashed, 'woocommerce' ), $untrashed ) ); + /* translators: %d: count */ + WC_Admin_Settings::add_message( sprintf( _n( '%d webhook restored from the Trash.', '%d webhooks restored from the Trash.', $untrashed, 'woocommerce' ), $untrashed ) ); } if ( isset( $_GET['deleted'] ) ) { $deleted = absint( $_GET['deleted'] ); - WC_Admin_Settings::add_message( sprintf( _n( '1 webhook permanently deleted.', '%d webhooks permanently deleted.', $deleted, 'woocommerce' ), $deleted ) ); + /* translators: %d: count */ + WC_Admin_Settings::add_message( sprintf( _n( '%d webhook permanently deleted.', '%d webhooks permanently deleted.', $deleted, 'woocommerce' ), $deleted ) ); } if ( isset( $_GET['updated'] ) ) { @@ -493,7 +498,13 @@ class WC_Admin_Webhooks { $html = '
    '; $html .= '

    '; - $html .= sprintf( '%s – Page %d of %d', _n( '1 item', sprintf( '%d items', $total ), $total, 'woocommerce' ), $current, $pages ); + /* translators: 1: items count (i.e. 8 items) 2: current page 3: total pages */ + $html .= sprintf( + __( '%1%s – Page %2$d of %3$d', 'woocommerce' ), + sprintf( _n( '%d item', '%d items', $total, 'woocommerce' ), $total ), + $current, + $pages + ); $html .= '

    '; if ( 1 < $pages ) { diff --git a/includes/admin/importers/class-wc-tax-rate-importer.php b/includes/admin/importers/class-wc-tax-rate-importer.php index 4a47acd2bfe..61fdacbc704 100644 --- a/includes/admin/importers/class-wc-tax-rate-importer.php +++ b/includes/admin/importers/class-wc-tax-rate-importer.php @@ -163,9 +163,13 @@ class WC_Tax_Rate_Importer extends WP_Importer { } // Show Result - echo '

    - ' . sprintf( __( 'Import complete - imported %s tax rates.', 'woocommerce' ), '' . $loop . '' ) . ' -

    '; + echo '

    '; + /* translators: %s: tax rates count */ + printf( + __( 'Import complete - imported %s tax rates.', 'woocommerce' ), + '' . $loop . '' + ); + echo '

    '; $this->import_end(); } @@ -251,7 +255,13 @@ class WC_Tax_Rate_Importer extends WP_Importer { - + diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php b/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php index 90ba6b71ec1..537915b95cf 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php @@ -126,6 +126,7 @@ class WC_Meta_Box_Order_Actions { foreach ( $mails as $mail ) { if ( $mail->id == $email_to_send ) { $mail->trigger( $order->get_id() ); + /* translators: %s: email title */ $order->add_order_note( sprintf( __( '%s email notification manually sent.', 'woocommerce' ), $mail->title ), false, true ); } } diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-data.php b/includes/admin/meta-boxes/class-wc-meta-box-order-data.php index b4ecc5176d9..d264b5a6e64 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-data.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-data.php @@ -177,7 +177,11 @@ class WC_Meta_Box_Order_Data {

    get_title() ) : esc_html( $payment_method ) ) ); + /* translators: %s: payment method */ + printf( + __( 'Payment via %s', 'woocommerce' ), + ( isset( $payment_gateways[ $payment_method ] ) ? esc_html( $payment_gateways[ $payment_method ]->get_title() ) : esc_html( $payment_method ) ) + ); if ( $transaction_id = $order->get_transaction_id() ) { if ( isset( $payment_gateways[ $payment_method ] ) && ( $url = $payment_gateways[ $payment_method ]->get_transaction_url( $order ) ) ) { @@ -196,6 +200,7 @@ class WC_Meta_Box_Order_Data { } if ( $ip_address = get_post_meta( $post->ID, '_customer_ip_address', true ) ) { + /* translators: %s: IP address */ printf( __( 'Customer IP: %s', 'woocommerce' ), '' . esc_html( $ip_address ) . '' @@ -248,6 +253,7 @@ class WC_Meta_Box_Order_Data { if ( $order->get_user_id() ) { $user_id = absint( $order->get_user_id() ); $user = get_user_by( 'id', $user_id ); + /* translators: 1: user display name 2: user ID 3: user email */ $user_string = sprintf( esc_html__( '%1$s (#%2$s – %3$s)', 'woocommerce' ), $user->display_name, diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-notes.php b/includes/admin/meta-boxes/class-wc-meta-box-order-notes.php index 3633e945f70..aefa4710abd 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-notes.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-notes.php @@ -56,9 +56,12 @@ class WC_Meta_Box_Order_Notes {

    comment_date ) ), date_i18n( wc_time_format(), strtotime( $note->comment_date ) ) ); ?> - comment_author ) : ?> - comment_author ); ?> - + comment_author ) : + /* translators: %s: note author */ + printf( ' ' . __( 'by %s', 'woocommerce' ), $note->comment_author ); + endif; + ?>

    diff --git a/includes/admin/meta-boxes/class-wc-meta-box-product-data.php b/includes/admin/meta-boxes/class-wc-meta-box-product-data.php index bac1477c223..5605c6d9ca0 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-product-data.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-product-data.php @@ -1185,6 +1185,7 @@ class WC_Meta_Box_Product_Data { $extension = pathinfo( $parsed_url, PATHINFO_EXTENSION ); if ( ! empty( $extension ) && ! in_array( $file_type['type'], $allowed_file_types ) ) { + /* translators: 1: file url 2: allowed file types */ WC_Admin_Meta_Boxes::add_error( sprintf( __( 'The downloadable file %1$s cannot be used as it does not have an allowed file type. Allowed types include: %2$s', 'woocommerce' ), '' . basename( $file_url ) . '', '' . implode( ', ', array_keys( $allowed_file_types ) ) . '' ) ); continue; } @@ -1309,6 +1310,7 @@ class WC_Meta_Box_Product_Data { $manage_stock = isset( $variable_manage_stock[ $i ] ) ? 'yes' : 'no'; // Generate a useful post title + /* translators: 1: variation id 2: product name */ $variation_post_title = sprintf( __( 'Variation #%1$s of %2$s', 'woocommerce' ), absint( $variation_id ), esc_html( get_the_title( $post_id ) ) ); // Update or Add post @@ -1362,6 +1364,7 @@ class WC_Meta_Box_Product_Data { $unique_sku = wc_product_has_unique_sku( $variation_id, $new_sku ); if ( ! $unique_sku ) { + /* translators: %s: variation id */ WC_Admin_Meta_Boxes::add_error( sprintf( __( '#%s – Variation SKU must be unique.', 'woocommerce' ), $variation_id ) ); } else { update_post_meta( $variation_id, '_sku', $new_sku ); @@ -1451,6 +1454,7 @@ class WC_Meta_Box_Product_Data { $extension = pathinfo( $parsed_url, PATHINFO_EXTENSION ); if ( ! empty( $extension ) && ! in_array( $file_type['type'], $allowed_file_types ) ) { + /* translators: 1: variation id 2: file url 3: allowed file types */ WC_Admin_Meta_Boxes::add_error( sprintf( __( '#%1$s – The downloadable file %2$s cannot be used as it does not have an allowed file type. Allowed types include: %3$s', 'woocommerce' ), $variation_id, '' . basename( $file_url ) . '', '' . implode( ', ', array_keys( $allowed_file_types ) ) . '' ) ); continue; } @@ -1458,6 +1462,7 @@ class WC_Meta_Box_Product_Data { // Validate the file exists if ( 'relative' === $file_is && ! apply_filters( 'woocommerce_downloadable_file_exists', file_exists( $file_url ), $file_url ) ) { + /* translators: 1: variation id 2: file url */ WC_Admin_Meta_Boxes::add_error( sprintf( __( '#%1$s – The downloadable file %2$s cannot be used as it does not exist on the server.', 'woocommerce' ), $variation_id, '' . $file_url . '' ) ); continue; } diff --git a/includes/admin/meta-boxes/views/html-order-item.php b/includes/admin/meta-boxes/views/html-order-item.php index 84f3cc2151f..d54ef527921 100644 --- a/includes/admin/meta-boxes/views/html-order-item.php +++ b/includes/admin/meta-boxes/views/html-order-item.php @@ -29,6 +29,7 @@ $thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnai if ( 'product_variation' === get_post_type( $item->get_variation_id() ) ) { echo esc_html( $item->get_variation_id() ); } else { + /* translators: %s: variation id */ printf( esc_html__( '%s (No longer exists)', 'woocommerce' ), $item->get_variation_id() ); } echo ''; diff --git a/includes/admin/meta-boxes/views/html-order-refund.php b/includes/admin/meta-boxes/views/html-order-refund.php index 8aedf5ad2bf..0e58cf7c44c 100644 --- a/includes/admin/meta-boxes/views/html-order-refund.php +++ b/includes/admin/meta-boxes/views/html-order-refund.php @@ -13,6 +13,7 @@ $who_refunded = new WP_User( $refund->get_refunded_by() ); get_id(), date_i18n( get_option( 'date_format' ) . ', ' . get_option( 'time_format' ), $refund->get_date_created() ) ); if ( $who_refunded->exists() ) { diff --git a/includes/admin/meta-boxes/views/html-product-attribute.php b/includes/admin/meta-boxes/views/html-product-attribute.php index 4eab03e690a..3e1472f6957 100644 --- a/includes/admin/meta-boxes/views/html-product-attribute.php +++ b/includes/admin/meta-boxes/views/html-product-attribute.php @@ -52,7 +52,12 @@ // Text attributes should list terms pipe separated echo esc_attr( implode( ' ' . WC_DELIMITER . ' ', wp_get_post_terms( $thepostid, $taxonomy, array( 'fields' => 'names' ) ) ) ); - ?>" placeholder="" /> + ?>" placeholder="" /> diff --git a/includes/admin/meta-boxes/views/html-variation-admin.php b/includes/admin/meta-boxes/views/html-variation-admin.php index b766cd9b824..1f5168c38ab 100644 --- a/includes/admin/meta-boxes/views/html-variation-admin.php +++ b/includes/admin/meta-boxes/views/html-variation-admin.php @@ -30,6 +30,7 @@ extract( $variation_data ); $variation_selected_value = isset( $variation_data[ 'attribute_' . sanitize_title( $attribute['name'] ) ] ) ? $variation_data[ 'attribute_' . sanitize_title( $attribute['name'] ) ] : ''; // Name will be something like attribute_pa_color + /* translators: %s: attribute label */ echo '

    - +

    @@ -170,7 +183,13 @@ extract( $variation_data );

    - +

    @@ -178,7 +197,13 @@ extract( $variation_data );

    - + @@ -293,11 +318,11 @@ extract( $variation_data );