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 = '
'; 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 {' . 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 . '