From 6cc301e58cf872ec076b7d28892dcc1cc4261d47 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Sat, 29 Oct 2016 13:16:03 +0300 Subject: [PATCH 1/8] add translators comments --- includes/abstracts/abstract-wc-order.php | 2 + includes/abstracts/abstract-wc-product.php | 4 ++ .../abstracts/abstract-wc-rest-controller.php | 1 + .../abstract-wc-rest-posts-controller.php | 5 ++ includes/admin/class-wc-admin-assets.php | 2 + includes/admin/class-wc-admin-attributes.php | 4 ++ includes/admin/class-wc-admin-dashboard.php | 54 ++++++++++++++++--- .../class-wc-admin-duplicate-product.php | 1 + includes/admin/class-wc-admin-post-types.php | 36 ++++++++++++- .../class-wc-admin-webhooks-table-list.php | 4 ++ includes/admin/class-wc-admin-webhooks.php | 19 +++++-- .../importers/class-wc-tax-rate-importer.php | 18 +++++-- .../class-wc-meta-box-order-actions.php | 1 + .../class-wc-meta-box-order-data.php | 8 ++- .../class-wc-meta-box-order-notes.php | 9 ++-- .../admin/settings/views/html-keys-edit.php | 1 + .../views/html-admin-page-status-report.php | 6 ++- includes/class-wc-ajax.php | 1 + .../class-wc-widget-product-tag-cloud.php | 2 +- .../class-wc-widget-recent-reviews.php | 2 +- 20 files changed, 156 insertions(+), 24 deletions(-) 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..48e03dd2b11 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 ) ); } } 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..bb9cf4bca23 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: %s: items count (i.e. 8 items) %d: current page %d: total pages */ + $html .= sprintf( + __( '%s – Page %d of %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/settings/views/html-keys-edit.php b/includes/admin/settings/views/html-keys-edit.php index 5e031e42f9d..fe6e6611f78 100644 --- a/includes/admin/settings/views/html-keys-edit.php +++ b/includes/admin/settings/views/html-keys-edit.php @@ -30,6 +30,7 @@ if ( ! defined( 'ABSPATH' ) ) { $curent_user_id = get_current_user_id(); $user_id = ! empty( $key_data['user_id'] ) ? absint( $key_data['user_id'] ) : $curent_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/views/html-admin-page-status-report.php b/includes/admin/views/html-admin-page-status-report.php index a43de57470d..b601de0a4d4 100644 --- a/includes/admin/views/html-admin-page-status-report.php +++ b/includes/admin/views/html-admin-page-status-report.php @@ -361,7 +361,11 @@ $pages = $system_status->get_pages();   - + ID, $exclude ) ) { + /* translators: 1: user display name 2: user ID 3: user email */ $found_customers[ $customer->ID ] = sprintf( esc_html__( '%1$s (#%2$s – %3$s)', 'woocommerce' ), $customer->display_name, diff --git a/includes/widgets/class-wc-widget-product-tag-cloud.php b/includes/widgets/class-wc-widget-product-tag-cloud.php index 527ab29849e..549811f3efc 100644 --- a/includes/widgets/class-wc-widget-product-tag-cloud.php +++ b/includes/widgets/class-wc-widget-product-tag-cloud.php @@ -82,7 +82,7 @@ class WC_Widget_Product_Tag_Cloud extends WC_Widget { * @return string */ public function _topic_count_text( $count ) { - /* translators: %s for product quantity, e.g. 1 product and 2 products */ + /* translators: %s: product count */ return sprintf( _n( '%s product', '%s products', $count, 'woocommerce' ), number_format_i18n( $count ) ); } } diff --git a/includes/widgets/class-wc-widget-recent-reviews.php b/includes/widgets/class-wc-widget-recent-reviews.php index b8012de636c..72d254a5889 100644 --- a/includes/widgets/class-wc-widget-recent-reviews.php +++ b/includes/widgets/class-wc-widget-recent-reviews.php @@ -83,7 +83,7 @@ class WC_Widget_Recent_Reviews extends WC_Widget { echo $rating_html; - /* translators: %s: comment author */ + /* translators: %s: review author */ echo '' . sprintf( __( 'by %s', 'woocommerce' ), get_comment_author() ) . ''; echo ''; From 8ab8bef52ecece808785a44d1d67ca3573b0c618 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Sat, 29 Oct 2016 13:51:56 +0300 Subject: [PATCH 2/8] add translators comments --- .../admin/meta-boxes/views/html-product-attribute.php | 7 ++++++- includes/admin/settings/views/html-settings-tax.php | 8 +++++++- .../class-wc-addons-gateway-simplify-commerce.php | 8 +++++++- includes/payment-tokens/class-wc-payment-token-cc.php | 1 + .../shipping/flat-rate/includes/settings-flat-rate.php | 1 + .../legacy-flat-rate/includes/settings-flat-rate.php | 1 + 6 files changed, 23 insertions(+), 3 deletions(-) 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/settings/views/html-settings-tax.php b/includes/admin/settings/views/html-settings-tax.php index 28eff73e5d8..3787e926ad2 100644 --- a/includes/admin/settings/views/html-settings-tax.php +++ b/includes/admin/settings/views/html-settings-tax.php @@ -10,7 +10,13 @@ if ( ! defined( 'ABSPATH' ) ) {
    -

    +

    diff --git a/includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php b/includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php index b73d682681c..70b54f90b68 100644 --- a/includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php +++ b/includes/gateways/simplify-commerce/class-wc-addons-gateway-simplify-commerce.php @@ -426,7 +426,13 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce { try { $order_items = $order->get_items(); $order_item = array_shift( $order_items ); - $pre_order_name = sprintf( __( '%1$s - Pre-order for "%2$s"', 'woocommerce' ), esc_html( get_bloginfo( 'name', 'display' ) ), $order_item['name'] ) . ' ' . sprintf( __( '(Order #%s)', 'woocommerce' ), $order->get_order_number() ); + /* translators: 1: site name 2: product name 3: order number */ + $pre_order_name = sprintf( + __( '%1$s - Pre-order for "%2$s" (Order #%3$s)', 'woocommerce' ), + esc_html( get_bloginfo( 'name', 'display' ) ), + $order_item['name'], + $order->get_order_number() + ); $customer_id = get_post_meta( $order->get_id(), '_simplify_customer_id', true ); diff --git a/includes/payment-tokens/class-wc-payment-token-cc.php b/includes/payment-tokens/class-wc-payment-token-cc.php index ab81db46f25..e85fc03c44e 100644 --- a/includes/payment-tokens/class-wc-payment-token-cc.php +++ b/includes/payment-tokens/class-wc-payment-token-cc.php @@ -68,6 +68,7 @@ class WC_Payment_Token_CC extends WC_Payment_Token { * @return string */ public function get_display_name() { + /* translators: 1: credit card type 2: last 4 digits 3: expiry month 4: expiry year */ $display = sprintf( __( '%1$s ending in %2$s (expires %3$s/%4$s)', 'woocommerce' ), wc_get_credit_card_type_label( $this->get_card_type() ), diff --git a/includes/shipping/flat-rate/includes/settings-flat-rate.php b/includes/shipping/flat-rate/includes/settings-flat-rate.php index d27987104f2..68a8bbd1a7f 100644 --- a/includes/shipping/flat-rate/includes/settings-flat-rate.php +++ b/includes/shipping/flat-rate/includes/settings-flat-rate.php @@ -51,6 +51,7 @@ if ( ! empty( $shipping_classes ) ) { continue; } $settings[ 'class_cost_' . $shipping_class->term_id ] = array( + /* translators: %s: shipping class name */ 'title' => sprintf( __( '"%s" shipping class cost', 'woocommerce' ), esc_html( $shipping_class->name ) ), 'type' => 'text', 'placeholder' => __( 'N/A', 'woocommerce' ), diff --git a/includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php b/includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php index 13950a619e1..228e6c8a433 100644 --- a/includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php +++ b/includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php @@ -78,6 +78,7 @@ if ( ! empty( $shipping_classes ) ) { continue; } $settings[ 'class_cost_' . $shipping_class->term_id ] = array( + /* translators: %s: shipping class name */ 'title' => sprintf( __( '"%s" shipping class cost', 'woocommerce' ), esc_html( $shipping_class->name ) ), 'type' => 'text', 'placeholder' => __( 'N/A', 'woocommerce' ), From 4e36ce74255d2170e64bf6a0a5fe131e53b97986 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Sat, 29 Oct 2016 15:57:09 +0300 Subject: [PATCH 3/8] add translators comments --- .../reports/class-wc-report-sales-by-date.php | 60 +++++++++++++++---- .../views/html-admin-page-status-report.php | 2 + includes/class-wc-auth.php | 15 ++++- includes/class-wc-checkout.php | 3 + includes/class-wc-emails.php | 8 ++- includes/vendor/wp-rest-functions.php | 5 ++ 6 files changed, 80 insertions(+), 13 deletions(-) diff --git a/includes/admin/reports/class-wc-report-sales-by-date.php b/includes/admin/reports/class-wc-report-sales-by-date.php index 0318efac350..a0d8d7d01e6 100644 --- a/includes/admin/reports/class-wc-report-sales-by-date.php +++ b/includes/admin/reports/class-wc-report-sales-by-date.php @@ -358,18 +358,38 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report { switch ( $this->chart_groupby ) { case 'day' : - $average_total_sales_title = sprintf( __( '%s average gross daily sales', 'woocommerce' ), '' . wc_price( $data->average_total_sales ) . '' ); - $average_sales_title = sprintf( __( '%s average net daily sales', 'woocommerce' ), '' . wc_price( $data->average_sales ) . '' ); + /* translators: %s: average total sales */ + $average_total_sales_title = sprintf( + __( '%s average gross daily sales', 'woocommerce' ), + '' . wc_price( $data->average_total_sales ) . '' + ); + /* translators: %s: average sales */ + $average_sales_title = sprintf( + __( '%s average net daily sales', 'woocommerce' ), + '' . wc_price( $data->average_sales ) . '' + ); break; case 'month' : default : - $average_total_sales_title = sprintf( __( '%s average gross monthly sales', 'woocommerce' ), '' . wc_price( $data->average_total_sales ) . '' ); - $average_sales_title = sprintf( __( '%s average net monthly sales', 'woocommerce' ), '' . wc_price( $data->average_sales ) . '' ); + /* translators: %s: average total sales */ + $average_total_sales_title = sprintf( + __( '%s average gross monthly sales', 'woocommerce' ), + '' . wc_price( $data->average_total_sales ) . '' + ); + /* translators: %s: average sales */ + $average_sales_title = sprintf( + __( '%s average net monthly sales', 'woocommerce' ), + '' . wc_price( $data->average_sales ) . '' + ); break; } $legend[] = array( - 'title' => sprintf( __( '%s gross sales in this period', 'woocommerce' ), '' . wc_price( $data->total_sales ) . '' ), + /* translators: %s: total sales */ + 'title' => sprintf( + __( '%s gross sales in this period', 'woocommerce' ), + '' . wc_price( $data->total_sales ) . '' + ), 'placeholder' => __( 'This is the sum of the order totals after any refunds and including shipping and taxes.', 'woocommerce' ), 'color' => $this->chart_colours['sales_amount'], 'highlight_series' => 6, @@ -383,7 +403,11 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report { } $legend[] = array( - 'title' => sprintf( __( '%s net sales in this period', 'woocommerce' ), '' . wc_price( $data->net_sales ) . '' ), + /* translators: %s: net sales */ + 'title' => sprintf( + __( '%s net sales in this period', 'woocommerce' ), + '' . wc_price( $data->net_sales ) . '' + ), 'placeholder' => __( 'This is the sum of the order totals after any refunds and excluding shipping and taxes.', 'woocommerce' ), 'color' => $this->chart_colours['net_sales_amount'], 'highlight_series' => 7, @@ -397,13 +421,21 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report { } $legend[] = array( - 'title' => sprintf( __( '%s orders placed', 'woocommerce' ), '' . $data->total_orders . '' ), + /* translators: %s: total orders */ + 'title' => sprintf( + __( '%s orders placed', 'woocommerce' ), + '' . $data->total_orders . '' + ), 'color' => $this->chart_colours['order_count'], 'highlight_series' => 1, ); $legend[] = array( - 'title' => sprintf( __( '%s items purchased', 'woocommerce' ), '' . $data->total_items . '' ), + /* translators: %s: total items */ + 'title' => sprintf( + __( '%s items purchased', 'woocommerce' ), + '' . $data->total_items . '' + ), 'color' => $this->chart_colours['item_count'], 'highlight_series' => 0, ); @@ -419,12 +451,20 @@ class WC_Report_Sales_By_Date extends WC_Admin_Report { 'highlight_series' => 8, ); $legend[] = array( - 'title' => sprintf( __( '%s charged for shipping', 'woocommerce' ), '' . wc_price( $data->total_shipping ) . '' ), + /* translators: %s: total shipping */ + 'title' => sprintf( + __( '%s charged for shipping', 'woocommerce' ), + '' . wc_price( $data->total_shipping ) . '' + ), 'color' => $this->chart_colours['shipping_amount'], 'highlight_series' => 5, ); $legend[] = array( - 'title' => sprintf( __( '%s worth of coupons used', 'woocommerce' ), '' . wc_price( $data->total_coupons ) . '' ), + /* translators: %s: total coupons */ + 'title' => sprintf( + __( '%s worth of coupons used', 'woocommerce' ), + '' . wc_price( $data->total_coupons ) . '' + ), 'color' => $this->chart_colours['coupon_amount'], 'highlight_series' => 4, ); diff --git a/includes/admin/views/html-admin-page-status-report.php b/includes/admin/views/html-admin-page-status-report.php index b601de0a4d4..30327e8eb0d 100644 --- a/includes/admin/views/html-admin-page-status-report.php +++ b/includes/admin/views/html-admin-page-status-report.php @@ -494,6 +494,7 @@ $pages = $system_status->get_pages(); @@ -524,6 +525,7 @@ $pages = $system_status->get_pages(); diff --git a/includes/class-wc-auth.php b/includes/class-wc-auth.php index b293a504bef..54a9c38e5de 100644 --- a/includes/class-wc-auth.php +++ b/includes/class-wc-auth.php @@ -173,11 +173,13 @@ class WC_Auth { foreach ( $params as $param ) { if ( empty( $_REQUEST[ $param ] ) ) { + /* translators: %s: parameter */ throw new Exception( sprintf( __( 'Missing parameter %s', 'woocommerce' ), $param ) ); } } if ( ! in_array( $_REQUEST['scope'], array( 'read', 'write', 'read_write' ) ) ) { + /* translators: %s: scope */ throw new Exception( sprintf( __( 'Invalid scope %s', 'woocommerce' ), wc_clean( $_REQUEST['scope'] ) ) ); } @@ -185,6 +187,7 @@ class WC_Auth { $param = $this->get_formatted_url( $_REQUEST[ $param ] ); if ( false === filter_var( $param, FILTER_VALIDATE_URL ) ) { + /* translators: %s: url */ throw new Exception( sprintf( __( 'The %s is not a valid URL', 'woocommerce' ), $param ) ); } } @@ -210,8 +213,15 @@ class WC_Auth { protected function create_keys( $app_name, $app_user_id, $scope ) { global $wpdb; - $description = sprintf( __( '%1$s - API %2$s (created on %3$s at %4$s).', 'woocommerce' ), wc_clean( $app_name ), $this->get_i18n_scope( $scope ), date_i18n( wc_date_format() ), date_i18n( wc_time_format() ) ); - $user = wp_get_current_user(); + /* translators: 1: app name 2: scope 3: date 4: time */ + $description = sprintf( + __( '%1$s - API %2$s (created on %3$s at %4$s).', 'woocommerce' ), + wc_clean( $app_name ), + $this->get_i18n_scope( $scope ), + date_i18n( wc_date_format() ), + date_i18n( wc_time_format() ) + ); + $user = wp_get_current_user(); // Created API keys. $permissions = ( in_array( $scope, array( 'read', 'write', 'read_write' ) ) ) ? sanitize_text_field( $scope ) : 'read'; @@ -372,6 +382,7 @@ class WC_Auth { } catch ( Exception $e ) { $this->maybe_delete_key( $consumer_data ); + /* translators: %s: error messase */ wp_die( sprintf( __( 'Error: %s.', 'woocommerce' ), $e->getMessage() ), __( 'Access denied', 'woocommerce' ), array( 'response' => 401 ) ); } } diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index 8bd6a94e39c..7e6d4fb0a33 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -502,6 +502,7 @@ class WC_Checkout { $this->posted[ $key ] = wc_format_phone_number( $this->posted[ $key ] ); if ( ! WC_Validation::is_phone( $this->posted[ $key ] ) ) { + /* translators: %s: phone number */ wc_add_notice( sprintf( __( '%s is not a valid phone number.', 'woocommerce' ), '' . $field['label'] . '' ), 'error' ); } break; @@ -509,6 +510,7 @@ class WC_Checkout { $this->posted[ $key ] = strtolower( $this->posted[ $key ] ); if ( ! is_email( $this->posted[ $key ] ) ) { + /* translators: %s: email address */ wc_add_notice( sprintf( __( '%s is not a valid email address.', 'woocommerce' ), '' . $field['label'] . '' ), 'error' ); } break; @@ -528,6 +530,7 @@ class WC_Checkout { // Only validate if the country has specific state options if ( ! empty( $valid_states ) && is_array( $valid_states ) && sizeof( $valid_states ) > 0 ) { if ( ! in_array( $this->posted[ $key ], array_keys( $valid_states ) ) ) { + /* translators: 1: state field 2: valid states */ wc_add_notice( sprintf( __( '%1$s is not valid. Please enter one of the following: %2$s', 'woocommerce' ), '' . $field['label'] . '', implode( ', ', $valid_states ) ), 'error' ); } } diff --git a/includes/class-wc-emails.php b/includes/class-wc-emails.php index db4ff6b9ae5..d474bf5dfc5 100644 --- a/includes/class-wc-emails.php +++ b/includes/class-wc-emails.php @@ -395,7 +395,12 @@ class WC_Emails { */ public function low_stock( $product ) { $subject = sprintf( '[%s] %s', $this->get_blogname(), __( 'Product low in stock', 'woocommerce' ) ); - $message = sprintf( __( '%s is low in stock.', 'woocommerce' ), html_entity_decode( strip_tags( $product->get_formatted_name() ), ENT_QUOTES, get_bloginfo( 'charset' ) ) ) . ' ' . sprintf( __( 'There are %d left', 'woocommerce' ), html_entity_decode( strip_tags( $product->get_total_stock() ) ) ); + /* translators: %s: product name %d: items in stock */ + $message = sprintf( + __( '%s is low in stock. There are %d left', 'woocommerce' ), + html_entity_decode( strip_tags( $product->get_formatted_name() ), ENT_QUOTES, get_bloginfo( 'charset' ) ), + html_entity_decode( strip_tags( $product->get_total_stock() ) ) + ); wp_mail( apply_filters( 'woocommerce_email_recipient_low_stock', get_option( 'woocommerce_stock_email_recipient' ), $product ), @@ -413,6 +418,7 @@ class WC_Emails { */ public function no_stock( $product ) { $subject = sprintf( '[%s] %s', $this->get_blogname(), __( 'Product out of stock', 'woocommerce' ) ); + /* translators: %s: product name */ $message = sprintf( __( '%s is out of stock.', 'woocommerce' ), html_entity_decode( strip_tags( $product->get_formatted_name() ), ENT_QUOTES, get_bloginfo( 'charset' ) ) ); wp_mail( diff --git a/includes/vendor/wp-rest-functions.php b/includes/vendor/wp-rest-functions.php index aec4b332ed3..e0a32d5e667 100644 --- a/includes/vendor/wp-rest-functions.php +++ b/includes/vendor/wp-rest-functions.php @@ -166,19 +166,23 @@ if ( ! function_exists( 'rest_validate_request_arg' ) ) { if ( ! empty( $args['enum'] ) ) { if ( ! in_array( $value, $args['enum'] ) ) { + /* translators: 1: parameter 2: arguments */ return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not one of %2$s', 'woocommerce' ), $param, implode( ', ', $args['enum'] ) ) ); } } if ( 'integer' === $args['type'] && ! is_numeric( $value ) ) { + /* translators: 1: parameter 2: integer type */ return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s', 'woocommerce' ), $param, 'integer' ) ); } if ( 'boolean' === $args['type'] && ! rest_is_boolean( $value ) ) { + /* translators: 1: parameter 2: boolean type */ return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s', 'woocommerce' ), $value, 'boolean' ) ); } if ( 'string' === $args['type'] && ! is_string( $value ) ) { + /* translators: 1: parameter 2: string type */ return new WP_Error( 'rest_invalid_param', sprintf( __( '%1$s is not of type %2$s', 'woocommerce' ), $param, 'string' ) ); } @@ -197,6 +201,7 @@ if ( ! function_exists( 'rest_validate_request_arg' ) ) { break; case 'ipv4' : if ( ! rest_is_ip_address( $value ) ) { + /* translators: %s: IP address */ return new WP_Error( 'rest_invalid_param', sprintf( __( '%s is not a valid IP address.', 'woocommerce' ), $value ) ); } break; From 9c9f165448ccbdcbf63783d1f6bffa3b0c081f6d Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Sat, 29 Oct 2016 16:10:55 +0300 Subject: [PATCH 4/8] Fix travis error --- includes/admin/class-wc-admin-webhooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/class-wc-admin-webhooks.php b/includes/admin/class-wc-admin-webhooks.php index bb9cf4bca23..042bc7b7444 100644 --- a/includes/admin/class-wc-admin-webhooks.php +++ b/includes/admin/class-wc-admin-webhooks.php @@ -498,9 +498,9 @@ class WC_Admin_Webhooks { $html = '
    '; $html .= '

    '; - /* translators: %s: items count (i.e. 8 items) %d: current page %d: total pages */ + /* translators: 1: items count (i.e. 8 items) 2: current page 3: total pages */ $html .= sprintf( - __( '%s – Page %d of %d', 'woocommerce' ), + __( '%1%s – Page %2$d of %3$d', 'woocommerce' ), sprintf( _n( '%d item', '%d items', $total, 'woocommerce' ), $total ), $current, $pages From e705102b6bd617f7da5af61ff9e44bb5d8f5e4c9 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Sat, 29 Oct 2016 16:13:46 +0300 Subject: [PATCH 5/8] Fix travis error --- includes/class-wc-emails.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-wc-emails.php b/includes/class-wc-emails.php index d474bf5dfc5..50bb5f6e260 100644 --- a/includes/class-wc-emails.php +++ b/includes/class-wc-emails.php @@ -395,9 +395,9 @@ class WC_Emails { */ public function low_stock( $product ) { $subject = sprintf( '[%s] %s', $this->get_blogname(), __( 'Product low in stock', 'woocommerce' ) ); - /* translators: %s: product name %d: items in stock */ + /* translators: 1: product name 2: items in stock */ $message = sprintf( - __( '%s is low in stock. There are %d left', 'woocommerce' ), + __( '%1$s is low in stock. There are %2$d left.', 'woocommerce' ), html_entity_decode( strip_tags( $product->get_formatted_name() ), ENT_QUOTES, get_bloginfo( 'charset' ) ), html_entity_decode( strip_tags( $product->get_total_stock() ) ) ); From 93d55dade9f371a1d1a653eb240c25badbecc0ce Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Sat, 29 Oct 2016 20:32:38 +0300 Subject: [PATCH 6/8] add translators comments --- .../class-wc-meta-box-product-data.php | 1 + .../meta-boxes/views/html-order-item.php | 1 + .../meta-boxes/views/html-variation-admin.php | 37 ++++++++++++++++--- .../reports/class-wc-report-coupon-usage.php | 2 + .../reports/class-wc-report-customers.php | 1 + .../class-wc-report-sales-by-product.php | 2 + .../settings/class-wc-settings-emails.php | 5 +++ .../api/class-wc-rest-coupons-controller.php | 1 + .../class-wc-rest-order-notes-controller.php | 1 + ...class-wc-rest-order-refunds-controller.php | 1 + .../api/class-wc-rest-orders-controller.php | 1 + ...-wc-rest-product-variations-controller.php | 4 ++ .../api/class-wc-rest-products-controller.php | 12 ++++++ .../class-wc-rest-report-sales-controller.php | 2 + .../api/class-wc-rest-webhooks-controller.php | 2 + .../legacy/v1/class-wc-api-authentication.php | 1 + includes/class-wc-cart.php | 8 +++- includes/class-wc-coupon.php | 8 ++++ includes/class-wc-embed.php | 8 +++- includes/class-wc-order.php | 4 ++ includes/class-wc-query.php | 2 + includes/cli/class-wc-cli-customer.php | 1 + includes/cli/class-wc-cli-order.php | 1 + .../cli/class-wc-cli-product-category.php | 1 + ...lass-wc-email-customer-completed-order.php | 4 ++ .../class-wc-email-customer-invoice.php | 4 ++ ...class-wc-email-customer-refunded-order.php | 4 ++ includes/emails/class-wc-email.php | 2 + 28 files changed, 113 insertions(+), 8 deletions(-) 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..cf0e2606e62 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 @@ -1362,6 +1362,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 ); 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-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 );

    From 55f08d62ae4fb2668351b59c39ce56695f41fe26 Mon Sep 17 00:00:00 2001 From: Rami Yushuvaev Date: Sat, 29 Oct 2016 23:03:28 +0300 Subject: [PATCH 8/8] add translators comments --- .../admin/class-wc-admin-duplicate-product.php | 1 + .../meta-boxes/class-wc-meta-box-product-data.php | 4 ++++ .../admin/meta-boxes/views/html-order-refund.php | 1 + includes/admin/reports/class-wc-admin-report.php | 2 ++ .../reports/class-wc-report-sales-by-category.php | 1 + .../api/class-wc-rest-products-controller.php | 1 + includes/api/legacy/v2/class-wc-api-products.php | 1 + includes/api/legacy/v3/class-wc-api-products.php | 1 + includes/cli/class-wc-cli-product.php | 1 + .../emails/class-wc-email-cancelled-order.php | 3 +++ includes/wc-order-functions.php | 2 ++ templates/myaccount/dashboard.php | 1 + templates/myaccount/my-orders.php | 5 ++++- templates/myaccount/orders.php | 5 ++++- templates/myaccount/payment-methods.php | 1 + templates/myaccount/view-order.php | 1 + templates/order/tracking.php | 1 + templates/single-product-reviews.php | 6 ++++-- templates/single-product/rating.php | 15 ++++++++++++--- 19 files changed, 46 insertions(+), 7 deletions(-) diff --git a/includes/admin/class-wc-admin-duplicate-product.php b/includes/admin/class-wc-admin-duplicate-product.php index 48e03dd2b11..bda8187c508 100644 --- a/includes/admin/class-wc-admin-duplicate-product.php +++ b/includes/admin/class-wc-admin-duplicate-product.php @@ -165,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/meta-boxes/class-wc-meta-box-product-data.php b/includes/admin/meta-boxes/class-wc-meta-box-product-data.php index cf0e2606e62..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 @@ -1452,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; } @@ -1459,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-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() );
    ' . sprintf( __( '%s is available', 'woocommerce' ), esc_html( $theme['version_latest'] ) ) . ''; } ?>' . sprintf( __( '%s is available', 'woocommerce' ), esc_html( $theme['parent_version_latest'] ) ) . ''; } ?> 
    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/reports/class-wc-admin-report.php b/includes/admin/reports/class-wc-admin-report.php index 3e50a1f2ed1..58e4c3d38ea 100644 --- a/includes/admin/reports/class-wc-admin-report.php +++ b/includes/admin/reports/class-wc-admin-report.php @@ -480,8 +480,10 @@ class WC_Admin_Report { } if ( 'sales' === $type ) { + /* translators: 1: total income 2: days */ $tooltip = sprintf( __( 'Sold %1$s worth in the last %2$d days', 'woocommerce' ), strip_tags( wc_price( $total ) ), $days ); } else { + /* translators: 1: total items sold 2: days */ $tooltip = sprintf( _n( 'Sold 1 item in the last %2$d days', 'Sold %1$d items in the last %2$d days', $total, 'woocommerce' ), $total, $days ); } diff --git a/includes/admin/reports/class-wc-report-sales-by-category.php b/includes/admin/reports/class-wc-report-sales-by-category.php index f7b293e083e..0bf12cafeb0 100644 --- a/includes/admin/reports/class-wc-report-sales-by-category.php +++ b/includes/admin/reports/class-wc-report-sales-by-category.php @@ -93,6 +93,7 @@ class WC_Report_Sales_By_Category extends WC_Admin_Report { } $legend[] = array( + /* translators: 1: total items sold 2: category name */ 'title' => sprintf( __( '%1$s sales in %2$s', 'woocommerce' ), '' . wc_price( $total ) . '', $category->name ), 'color' => isset( $this->chart_colours[ $index ] ) ? $this->chart_colours[ $index ] : $this->chart_colours[0], 'highlight_series' => $index, diff --git a/includes/api/class-wc-rest-products-controller.php b/includes/api/class-wc-rest-products-controller.php index 3b04f17aedd..3945781e787 100644 --- a/includes/api/class-wc-rest-products-controller.php +++ b/includes/api/class-wc-rest-products-controller.php @@ -1354,6 +1354,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller { $variation_id = isset( $variation['id'] ) ? absint( $variation['id'] ) : 0; // Generate a useful post title. + /* translators: 1: variation id 2: product name */ $variation_post_title = sprintf( __( 'Variation #%1$s of %2$s', 'woocommerce' ), $variation_id, esc_html( get_the_title( $product->id ) ) ); // Update or Add post. diff --git a/includes/api/legacy/v2/class-wc-api-products.php b/includes/api/legacy/v2/class-wc-api-products.php index 3bf19dec4cc..152f4e5299e 100644 --- a/includes/api/legacy/v2/class-wc-api-products.php +++ b/includes/api/legacy/v2/class-wc-api-products.php @@ -1258,6 +1258,7 @@ class WC_API_Products extends WC_API_Resource { $variation_id = isset( $variation['id'] ) ? absint( $variation['id'] ) : 0; // Generate a useful post title + /* translators: 1: variation id 2: product name */ $variation_post_title = sprintf( __( 'Variation #%1$s of %2$s', 'woocommerce' ), $variation_id, esc_html( get_the_title( $id ) ) ); // Update or Add post diff --git a/includes/api/legacy/v3/class-wc-api-products.php b/includes/api/legacy/v3/class-wc-api-products.php index f37121cef91..d4f5ba39db6 100644 --- a/includes/api/legacy/v3/class-wc-api-products.php +++ b/includes/api/legacy/v3/class-wc-api-products.php @@ -1753,6 +1753,7 @@ class WC_API_Products extends WC_API_Resource { } // Generate a useful post title + /* translators: 1: variation id 2: product name */ $variation_post_title = sprintf( __( 'Variation #%1$s of %2$s', 'woocommerce' ), $variation_id, esc_html( get_the_title( $id ) ) ); // Update or Add post diff --git a/includes/cli/class-wc-cli-product.php b/includes/cli/class-wc-cli-product.php index a6b10c4e0e6..95330e9aac6 100644 --- a/includes/cli/class-wc-cli-product.php +++ b/includes/cli/class-wc-cli-product.php @@ -1529,6 +1529,7 @@ class WC_CLI_Product extends WC_CLI_Command { $variation_id = isset( $variation['id'] ) ? absint( $variation['id'] ) : 0; // Generate a useful post title + /* translators: 1: variation id 2: product name */ $variation_post_title = sprintf( __( 'Variation #%1$s of %2$s', 'woocommerce' ), $variation_id, esc_html( get_the_title( $id ) ) ); // Update or Add post diff --git a/includes/emails/class-wc-email-cancelled-order.php b/includes/emails/class-wc-email-cancelled-order.php index cf5a97a0f15..d63d7ef1db8 100644 --- a/includes/emails/class-wc-email-cancelled-order.php +++ b/includes/emails/class-wc-email-cancelled-order.php @@ -108,6 +108,7 @@ class WC_Email_Cancelled_Order extends WC_Email { 'recipient' => array( 'title' => __( 'Recipient(s)', 'woocommerce' ), 'type' => 'text', + /* translators: %s: admin email */ 'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to %s.', 'woocommerce' ), '' . esc_attr( get_option( 'admin_email' ) ) . '' ), 'placeholder' => '', 'default' => '', @@ -116,6 +117,7 @@ class WC_Email_Cancelled_Order extends WC_Email { 'subject' => array( 'title' => __( 'Subject', 'woocommerce' ), 'type' => 'text', + /* translators: %s: default subject */ 'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: %s.', 'woocommerce' ), '' . $this->subject . '' ), 'placeholder' => '', 'default' => '', @@ -124,6 +126,7 @@ class WC_Email_Cancelled_Order extends WC_Email { 'heading' => array( 'title' => __( 'Email heading', 'woocommerce' ), 'type' => 'text', + /* translators: %s: default heading */ 'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: %s.', 'woocommerce' ), '' . $this->heading . '' ), 'placeholder' => '', 'default' => '', diff --git a/includes/wc-order-functions.php b/includes/wc-order-functions.php index af1a201cf27..78667c55495 100644 --- a/includes/wc-order-functions.php +++ b/includes/wc-order-functions.php @@ -1139,8 +1139,10 @@ function wc_reduce_stock_levels( $order_id ) { $item_name = $product->get_sku() ? $product->get_sku(): $item['product_id']; if ( ! empty( $item['variation_id'] ) ) { + /* translators: 1: item name 2: variation id 3: old stock quantity 4: new stock quantity */ $order->add_order_note( sprintf( __( 'Item %1$s variation #%2$s stock reduced from %3$s to %4$s.', 'woocommerce' ), $item_name, $item['variation_id'], $new_stock + $qty, $new_stock ) ); } else { + /* translators: 1: item name 2: old stock quantity 3: new stock quantity */ $order->add_order_note( sprintf( __( 'Item %1$s stock reduced from %2$s to %3$s.', 'woocommerce' ), $item_name, $new_stock + $qty, $new_stock ) ); } diff --git a/templates/myaccount/dashboard.php b/templates/myaccount/dashboard.php index b59d93c5926..215f9eaf3f5 100644 --- a/templates/myaccount/dashboard.php +++ b/templates/myaccount/dashboard.php @@ -24,6 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) { ?>

    Sign out)', 'woocommerce' ), '' . esc_html( $current_user->display_name ) . '', diff --git a/templates/myaccount/my-orders.php b/templates/myaccount/my-orders.php index f7420ddf51d..40e78cbaf3f 100644 --- a/templates/myaccount/my-orders.php +++ b/templates/myaccount/my-orders.php @@ -62,7 +62,10 @@ if ( $customer_orders ) : ?> get_status() ); ?> - get_formatted_order_total(), $item_count ); ?> + get_formatted_order_total(), $item_count ); + ?> get_status() ); ?> - get_formatted_order_total(), $item_count ); ?> + get_formatted_order_total(), $item_count ); + ?> do_action( 'woocommerce_account_payment_methods_column_' . $column_id, $method ); } elseif ( 'method' === $column_id ) { if ( ! empty( $method['method']['last4'] ) ) { + /* translators: 1: credit card type 2: last 4 digits */ echo sprintf( __( '%1$s ending in %2$s', 'woocommerce' ), esc_html( wc_get_credit_card_type_label( $method['method']['brand'] ) ), esc_html( $method['method']['last4'] ) ); } else { echo esc_html( wc_get_credit_card_type_label( $method['method']['brand'] ) ); diff --git a/templates/myaccount/view-order.php b/templates/myaccount/view-order.php index 54686cdb2da..1091f874133 100644 --- a/templates/myaccount/view-order.php +++ b/templates/myaccount/view-order.php @@ -24,6 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) { ?>

    ' . $order->get_order_number() . '', diff --git a/templates/order/tracking.php b/templates/order/tracking.php index 35605e61e47..199dc22912a 100644 --- a/templates/order/tracking.php +++ b/templates/order/tracking.php @@ -22,6 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) { ?>

    ' . $order->get_order_number() . '', diff --git a/templates/single-product-reviews.php b/templates/single-product-reviews.php index 272acd456f7..592b3c1d967 100644 --- a/templates/single-product-reviews.php +++ b/templates/single-product-reviews.php @@ -29,10 +29,12 @@ if ( ! comments_open() ) {

    get_review_count() ) ) + if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' && ( $count = $product->get_review_count() ) ) { + /* translators: 1: reviews count 2: product name */ printf( esc_html( _n( '%1$s review for %2$s', '%1$s reviews for %2$s', $count, 'woocommerce' ) ), $count, '' . get_the_title() . '' ); - else + } else { _e( 'Reviews', 'woocommerce' ); + } ?>

    diff --git a/templates/single-product/rating.php b/templates/single-product/rating.php index 5d389878288..7d0951f7fee 100644 --- a/templates/single-product/rating.php +++ b/templates/single-product/rating.php @@ -35,12 +35,21 @@ if ( $rating_count > 0 ) : ?>
    - ' . esc_html( $average ) . '', '5' - ); ?> - ' . $rating_count . '' ); ?> + ); + ?> + ' . $rating_count . '' + ); + ?>
    (' . $review_count . '' ); ?>)