add translators comments

This commit is contained in:
Rami Yushuvaev 2016-10-29 20:32:38 +03:00
parent e705102b6b
commit 93d55dade9
28 changed files with 113 additions and 8 deletions

View File

@ -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 );

View File

@ -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 '</div>';

View File

@ -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 '<select name="attribute_' . sanitize_title( $attribute['name'] ) . '[' . $loop . ']"><option value="">' . sprintf( __( 'Any %s&hellip;', 'woocommerce' ), esc_html( wc_attribute_label( $attribute['name'] ) ) ) . '</option>';
// Get terms for attribute taxonomy or value if its a custom attribute
@ -88,11 +89,23 @@ extract( $variation_data );
<div class="variable_pricing">
<p class="form-row form-row-first">
<label><?php printf( __( 'Regular price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?></label>
<label><?php
/* translators: %s: currency symbol */
printf(
__( 'Regular price (%s)', 'woocommerce' ),
get_woocommerce_currency_symbol()
);
?></label>
<input type="text" size="5" name="variable_regular_price[<?php echo $loop; ?>]" value="<?php if ( isset( $_regular_price ) ) echo esc_attr( $_regular_price ); ?>" class="wc_input_price" placeholder="<?php esc_attr_e( 'Variation price (required)', 'woocommerce' ); ?>" />
</p>
<p class="form-row form-row-last">
<label><?php printf( __( 'Sale price (%s)', 'woocommerce' ), get_woocommerce_currency_symbol() ); ?> <a href="#" class="sale_schedule"><?php _e( 'Schedule', 'woocommerce' ); ?></a><a href="#" class="cancel_sale_schedule" style="display:none"><?php _e( 'Cancel schedule', 'woocommerce' ); ?></a></label>
<label><?php
/* translators: %s: currency symbol */
printf(
__( 'Sale price (%s)', 'woocommerce' ),
get_woocommerce_currency_symbol()
);
?> <a href="#" class="sale_schedule"><?php _e( 'Schedule', 'woocommerce' ); ?></a><a href="#" class="cancel_sale_schedule" style="display:none"><?php _e( 'Cancel schedule', 'woocommerce' ); ?></a></label>
<input type="text" size="5" name="variable_sale_price[<?php echo $loop; ?>]" value="<?php if ( isset( $_sale_price ) ) echo esc_attr( $_sale_price ); ?>" class="wc_input_price" />
</p>
@ -170,7 +183,13 @@ extract( $variation_data );
<div>
<?php if ( wc_product_weight_enabled() ) : ?>
<p class="form-row hide_if_variation_virtual form-row-first">
<label><?php printf( __( 'Weight (%s)', 'woocommerce' ), esc_html( get_option( 'woocommerce_weight_unit' ) ) ); ?> <?php echo wc_help_tip( __( 'Enter a weight for this variation or leave blank to use the parent product weight.', 'woocommerce' ) ); ?></a></label>
<label><?php
/* translators: %s: weight unit */
printf(
__( 'Weight (%s)', 'woocommerce' ),
esc_html( get_option( 'woocommerce_weight_unit' ) )
);
?> <?php echo wc_help_tip( __( 'Enter a weight for this variation or leave blank to use the parent product weight.', 'woocommerce' ) ); ?></label>
<input type="text" size="5" name="variable_weight[<?php echo $loop; ?>]" value="<?php if ( isset( $_weight ) ) echo esc_attr( $_weight ); ?>" placeholder="<?php echo esc_attr( $parent_data['weight'] ); ?>" class="wc_input_decimal" />
</p>
<?php else : ?>
@ -178,7 +197,13 @@ extract( $variation_data );
<?php endif; ?>
<?php if ( wc_product_dimensions_enabled() ) : ?>
<p class="form-row dimensions_field hide_if_variation_virtual form-row-last">
<label for="product_length"><?php printf( __( 'Dimensions (L&times;W&times;H) (%s)', 'woocommerce' ), get_option( 'woocommerce_dimension_unit' ) ); ?></label>
<label for="product_length"><?php
/* translators: %s: dimension unit */
printf(
__( 'Dimensions (L&times;W&times;H) (%s)', 'woocommerce' ),
get_option( 'woocommerce_dimension_unit' )
);
?></label>
<input id="product_length" class="input-text wc_input_decimal" size="6" type="text" name="variable_length[<?php echo $loop; ?>]" value="<?php if ( isset( $_length ) ) echo esc_attr( $_length ); ?>" placeholder="<?php echo esc_attr( $parent_data['length'] ); ?>" />
<input class="input-text wc_input_decimal" size="6" type="text" name="variable_width[<?php echo $loop; ?>]" value="<?php if ( isset( $_width ) ) echo esc_attr( $_width ); ?>" placeholder="<?php echo esc_attr( $parent_data['width'] ); ?>" />
<input class="input-text wc_input_decimal last" size="6" type="text" name="variable_height[<?php echo $loop; ?>]" value="<?php if ( isset( $_height ) ) echo esc_attr( $_height ); ?>" placeholder="<?php echo esc_attr( $parent_data['height'] ); ?>" />
@ -293,11 +318,11 @@ extract( $variation_data );
</div>
<div class="show_if_variation_downloadable" style="display: none;">
<p class="form-row form-row-first">
<label><?php _e( 'Download limit', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Leave blank for unlimited re-downloads.', 'woocommerce' ) ); ?></a></label>
<label><?php _e( 'Download limit', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Leave blank for unlimited re-downloads.', 'woocommerce' ) ); ?></label>
<input type="number" size="5" name="variable_download_limit[<?php echo $loop; ?>]" value="<?php if ( isset( $_download_limit ) ) echo esc_attr( $_download_limit ); ?>" placeholder="<?php esc_attr_e( 'Unlimited', 'woocommerce' ); ?>" step="1" min="0" />
</p>
<p class="form-row form-row-last">
<label><?php _e( 'Download expiry', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Enter the number of days before a download link expires, or leave blank.', 'woocommerce' ) ); ?></a></label>
<label><?php _e( 'Download expiry', 'woocommerce' ); ?> <?php echo wc_help_tip( __( 'Enter the number of days before a download link expires, or leave blank.', 'woocommerce' ) ); ?></label>
<input type="number" size="5" name="variable_download_expiry[<?php echo $loop; ?>]" value="<?php if ( isset( $_download_expiry ) ) echo esc_attr( $_download_expiry ); ?>" placeholder="<?php esc_attr_e( 'Unlimited', 'woocommerce' ); ?>" step="1" min="0" />
</p>

View File

@ -105,12 +105,14 @@ class WC_Report_Coupon_Usage extends WC_Admin_Report {
$total_coupons = absint( $this->get_order_report_data( $total_coupons_query ) );
$legend[] = array(
/* translators: %s: discount ammount */
'title' => sprintf( __( '%s discounts in total', 'woocommerce' ), '<strong>' . wc_price( $total_discount ) . '</strong>' ),
'color' => $this->chart_colours['discount_amount'],
'highlight_series' => 1,
);
$legend[] = array(
/* translators: %s: coupons ammount */
'title' => sprintf( __( '%s coupons used in total', 'woocommerce' ), '<strong>' . $total_coupons . '</strong>' ),
'color' => $this->chart_colours['coupon_count'],
'highlight_series' => 0,

View File

@ -37,6 +37,7 @@ class WC_Report_Customers extends WC_Admin_Report {
$legend = array();
$legend[] = array(
/* translators: %s: signups ammount */
'title' => sprintf( __( '%s signups in this period', 'woocommerce' ), '<strong>' . sizeof( $this->customers ) . '</strong>' ),
'color' => $this->chart_colours['signups'],
'highlight_series' => 2,

View File

@ -103,12 +103,14 @@ class WC_Report_Sales_By_Product extends WC_Admin_Report {
) ) );
$legend[] = array(
/* translators: %s: total items sold */
'title' => sprintf( __( '%s sales for the selected items', 'woocommerce' ), '<strong>' . wc_price( $total_sales ) . '</strong>' ),
'color' => $this->chart_colours['sales_amount'],
'highlight_series' => 1,
);
$legend[] = array(
/* translators: %s: total items purchased */
'title' => sprintf( __( '%s purchases for the selected items', 'woocommerce' ), '<strong>' . ( $total_items ) . '</strong>' ),
'color' => $this->chart_colours['item_count'],
'highlight_series' => 0,

View File

@ -111,6 +111,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'css' => 'width:300px; height: 75px;',
'placeholder' => __( 'N/A', 'woocommerce' ),
'type' => 'textarea',
/* translators: %s: site name */
'default' => sprintf( __( '%s - Powered by WooCommerce', 'woocommerce' ), get_bloginfo( 'name', 'display' ) ),
'autoload' => false,
'desc_tip' => true,
@ -118,6 +119,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
array(
'title' => __( 'Base colour', 'woocommerce' ),
/* translators: %s: default color */
'desc' => sprintf( __( 'The base colour for WooCommerce email templates. Default %s.', 'woocommerce' ), '<code>#96588a</code>' ),
'id' => 'woocommerce_email_base_color',
'type' => 'color',
@ -129,6 +131,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
array(
'title' => __( 'Background colour', 'woocommerce' ),
/* translators: %s: default color */
'desc' => sprintf( __( 'The background colour for WooCommerce email templates. Default %s.', 'woocommerce' ), '<code>#f7f7f7</code>' ),
'id' => 'woocommerce_email_background_color',
'type' => 'color',
@ -140,6 +143,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
array(
'title' => __( 'Body background colour', 'woocommerce' ),
/* translators: %s: default color */
'desc' => sprintf( __( 'The main body background colour. Default %s.', 'woocommerce' ), '<code>#ffffff</code>' ),
'id' => 'woocommerce_email_body_background_color',
'type' => 'color',
@ -151,6 +155,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
array(
'title' => __( 'Body text colour', 'woocommerce' ),
/* translators: %s: default color */
'desc' => sprintf( __( 'The main body text colour. Default %s.', 'woocommerce' ), '<code>#3c3c3c</code>' ),
'id' => 'woocommerce_email_text_color',
'type' => 'color',

View File

@ -275,6 +275,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Posts_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 ) );
}

View File

@ -212,6 +212,7 @@ class WC_REST_Order_Notes_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 ) );
}

View File

@ -222,6 +222,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_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 ) );
}

View File

@ -688,6 +688,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_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 ) );
}

View File

@ -500,6 +500,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
'readonly' => true,
),
'weight' => array(
/* translators: %s: weight unit */
'description' => sprintf( __( 'Variation weight (%s).', 'woocommerce' ), $weight_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
@ -510,16 +511,19 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
'context' => array( 'view', 'edit' ),
'properties' => array(
'length' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Variation length (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'width' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Variation width (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'height' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Variation height (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),

View File

@ -1811,6 +1811,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_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() ) );
}
@ -1842,11 +1843,13 @@ class WC_REST_Products_Controller extends WC_REST_Posts_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 ) );
}
@ -1856,6 +1859,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_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 ) );
}
@ -2136,6 +2140,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'context' => array( 'view', 'edit' ),
),
'weight' => array(
/* translators: %s: weight unit */
'description' => sprintf( __( 'Product weight (%s).', 'woocommerce' ), $weight_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
@ -2146,16 +2151,19 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'context' => array( 'view', 'edit' ),
'properties' => array(
'length' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Product length (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'width' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Product width (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'height' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Product height (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
@ -2562,6 +2570,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'readonly' => true,
),
'weight' => array(
/* translators: %s: weight unit */
'description' => sprintf( __( 'Variation weight (%s).', 'woocommerce' ), $weight_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
@ -2572,16 +2581,19 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
'context' => array( 'view', 'edit' ),
'properties' => array(
'length' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Variation length (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'width' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Variation width (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),
),
'height' => array(
/* translators: %s: dimension unit */
'description' => sprintf( __( 'Variation height (%s).', 'woocommerce' ), $dimension_unit ),
'type' => 'string',
'context' => array( 'view', 'edit' ),

View File

@ -376,6 +376,7 @@ class WC_REST_Report_Sales_Controller extends WC_REST_Controller {
'sanitize_callback' => 'sanitize_text_field',
),
'date_min' => array(
/* translators: %s: date format */
'description' => sprintf( __( 'Return sales for a specific start date, the date need to be in the %s format.', 'woocommerce' ), 'YYYY-MM-AA' ),
'type' => 'string',
'format' => 'date',
@ -383,6 +384,7 @@ class WC_REST_Report_Sales_Controller extends WC_REST_Controller {
'sanitize_callback' => 'sanitize_text_field',
),
'date_max' => array(
/* translators: %s: date format */
'description' => sprintf( __( 'Return sales for a specific end date, the date need to be in the %s format.', 'woocommerce' ), 'YYYY-MM-AA' ),
'type' => 'string',
'format' => 'date',

View File

@ -128,6 +128,7 @@ class WC_REST_Webhooks_Controller extends WC_REST_Posts_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 ) );
}
@ -311,6 +312,7 @@ class WC_REST_Webhooks_Controller extends WC_REST_Posts_Controller {
$result = wp_delete_post( $id, true );
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 ) );
}

View File

@ -145,6 +145,7 @@ class WC_API_Authentication {
foreach ( $param_names as $param_name ) {
if ( empty( $params[ $param_name ] ) ) {
/* translators: %s: parameter name */
throw new Exception( sprintf( __( '%s parameter is missing', 'woocommerce' ), $param_name ), 404 );
}
}

View File

@ -235,6 +235,7 @@ class WC_Cart {
// Flag to indicate the stored cart should be update
$update_cart_session = true;
/* translators: %s: product name */
wc_add_notice( sprintf( __( '%s has been removed from your cart because it can no longer be purchased. Please contact us if you need assistance.', 'woocommerce' ), $_product->get_title() ), 'error' );
do_action( 'woocommerce_remove_cart_item_from_session', $key, $values );
@ -480,6 +481,7 @@ class WC_Cart {
* Check stock based on stock-status.
*/
if ( ! $_product->is_in_stock() ) {
/* translators: %s: product name */
$error->add( 'out-of-stock', sprintf( __( 'Sorry, "%s" is not in stock. Please edit your cart and try again. We apologise for any inconvenience caused.', 'woocommerce' ), $_product->get_title() ) );
return $error;
}
@ -494,6 +496,7 @@ class WC_Cart {
* Check stock based on all items in the cart.
*/
if ( ! $_product->has_enough_stock( $check_qty ) ) {
/* translators: 1: product name 2: quantity in stock */
$error->add( 'out-of-stock', sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order (%2$s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'woocommerce' ), $_product->get_title(), $_product->get_stock_quantity() ) );
return $error;
}
@ -529,6 +532,7 @@ class WC_Cart {
$not_enough_stock = true;
}
if ( $not_enough_stock ) {
/* translators: 1: product name 2: minutes */
$error->add( 'out-of-stock', sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order right now. Please try again in %2$d minutes or edit your cart and try again. We apologise for any inconvenience caused.', 'woocommerce' ), $_product->get_title(), get_option( 'woocommerce_hold_stock_minutes' ) ) );
return $error;
}
@ -922,7 +926,8 @@ class WC_Cart {
$in_cart_quantity = $cart_item_key ? $this->cart_contents[ $cart_item_key ]['quantity'] : 0;
if ( $in_cart_quantity > 0 ) {
throw new Exception( sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', wc_get_cart_url(), __( 'View cart', 'woocommerce' ), sprintf( __( 'You cannot add another &quot;%s&quot; to your cart.', 'woocommerce' ), $product_data->get_title() ) ) );
/* translators: %s: product name */
throw new Exception( sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', wc_get_cart_url(), __( 'View cart', 'woocommerce' ), sprintf( __( 'You cannot add another "%s" to your cart.', 'woocommerce' ), $product_data->get_title() ) ) );
}
}
@ -937,6 +942,7 @@ class WC_Cart {
}
if ( ! $product_data->has_enough_stock( $quantity ) ) {
/* translators: 1: product name 2: quantity in stock */
throw new Exception( sprintf( __( 'You cannot add that amount of &quot;%1$s&quot; to the cart because there is not enough stock (%2$s remaining).', 'woocommerce' ), $product_data->get_title(), $product_data->get_stock_quantity() ) );
}

View File

@ -1290,18 +1290,22 @@ class WC_Coupon extends WC_Legacy_Coupon {
$err = __( 'Coupon is not valid.', 'woocommerce' );
break;
case self::E_WC_COUPON_NOT_EXIST:
/* translators: %s: coupon code */
$err = sprintf( __( 'Coupon "%s" does not exist!', 'woocommerce' ), $this->get_code() );
break;
case self::E_WC_COUPON_INVALID_REMOVED:
/* translators: %s: coupon code */
$err = sprintf( __( 'Sorry, it seems the coupon "%s" is invalid - it has now been removed from your order.', 'woocommerce' ), $this->get_code() );
break;
case self::E_WC_COUPON_NOT_YOURS_REMOVED:
/* translators: %s: coupon code */
$err = sprintf( __( 'Sorry, it seems the coupon "%s" is not yours - it has now been removed from your order.', 'woocommerce' ), $this->get_code() );
break;
case self::E_WC_COUPON_ALREADY_APPLIED:
$err = __( 'Coupon code already applied!', 'woocommerce' );
break;
case self::E_WC_COUPON_ALREADY_APPLIED_INDIV_USE_ONLY:
/* translators: %s: coupon code */
$err = sprintf( __( 'Sorry, coupon "%s" has already been applied and cannot be used in conjunction with other coupons.', 'woocommerce' ), $this->get_code() );
break;
case self::E_WC_COUPON_USAGE_LIMIT_REACHED:
@ -1311,9 +1315,11 @@ class WC_Coupon extends WC_Legacy_Coupon {
$err = __( 'This coupon has expired.', 'woocommerce' );
break;
case self::E_WC_COUPON_MIN_SPEND_LIMIT_NOT_MET:
/* translators: %s: coupon minimum amount */
$err = sprintf( __( 'The minimum spend for this coupon is %s.', 'woocommerce' ), wc_price( $this->get_minimum_amount() ) );
break;
case self::E_WC_COUPON_MAX_SPEND_LIMIT_MET:
/* translators: %s: coupon maximum amount */
$err = sprintf( __( 'The maximum spend for this coupon is %s.', 'woocommerce' ), wc_price( $this->get_maximum_amount() ) );
break;
case self::E_WC_COUPON_NOT_APPLICABLE:
@ -1330,6 +1336,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
}
}
/* translators: %s: products list */
$err = sprintf( __( 'Sorry, this coupon is not applicable to the products: %s.', 'woocommerce' ), implode( ', ', $products ) );
break;
case self::E_WC_COUPON_EXCLUDED_CATEGORIES:
@ -1349,6 +1356,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
}
}
/* translators: %s: categories list */
$err = sprintf( __( 'Sorry, this coupon is not applicable to the categories: %s.', 'woocommerce' ), implode( ', ', array_unique( $categories ) ) );
break;
case self::E_WC_COUPON_NOT_VALID_SALE_ITEMS:

View File

@ -124,7 +124,13 @@ class WC_Embed {
if ( self::is_embedded_product() && ( $_product = wc_get_product( get_the_ID() ) ) && $_product->get_average_rating() > 0 ) {
?>
<div class="wc-embed-rating">
<?php echo esc_html( sprintf( __( 'Rated %s out of 5', 'woocommerce' ), $_product->get_average_rating() ) ); ?>
<?php
/* translators: %s: average rating */
printf(
esc_html_( 'Rated %s out of 5', 'woocommerce' ),
$_product->get_average_rating()
);
?>
</div>
<?php
}

View File

@ -474,11 +474,13 @@ class WC_Order extends WC_Abstract_Order {
protected function status_transition() {
if ( $this->status_transition ) {
if ( ! empty( $this->status_transition['from'] ) ) {
/* translators: 1: old order status 2: new order status */
$transition_note = sprintf( __( 'Order status changed from %1$s to %2$s.', 'woocommerce' ), wc_get_order_status_name( $this->status_transition['from'] ), wc_get_order_status_name( $this->status_transition['to'] ) );
do_action( 'woocommerce_order_status_' . $this->status_transition['from'] . '_to_' . $this->status_transition['to'], $this->get_id() );
do_action( 'woocommerce_order_status_changed', $this->get_id(), $this->status_transition['from'], $this->status_transition['to'] );
} else {
/* translators: %s: new order status */
$transition_note = sprintf( __( 'Order status set to %s.', 'woocommerce' ), wc_get_order_status_name( $this->status_transition['to'] ) );
}
@ -822,6 +824,7 @@ class WC_Order extends WC_Abstract_Order {
* @return string
*/
public function get_formatted_billing_full_name() {
/* translators: 1: first name 2: last name */
return sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $this->get_billing_first_name(), $this->get_billing_last_name() );
}
@ -830,6 +833,7 @@ class WC_Order extends WC_Abstract_Order {
* @return string
*/
public function get_formatted_shipping_full_name() {
/* translators: 1: first name 2: last name */
return sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $this->get_shipping_first_name(), $this->get_shipping_last_name() );
}

View File

@ -95,6 +95,7 @@ class WC_Query {
break;
case 'orders' :
if ( ! empty( $wp->query_vars['orders'] ) ) {
/* translators: %s: page */
$title = sprintf( __( 'Orders (page %d)', 'woocommerce' ), intval( $wp->query_vars['orders'] ) );
} else {
$title = __( 'Orders', 'woocommerce' );
@ -102,6 +103,7 @@ class WC_Query {
break;
case 'view-order' :
$order = wc_get_order( $wp->query_vars['view-order'] );
/* translators: %s: order number */
$title = ( $order ) ? sprintf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ) : '';
break;
case 'downloads' :

View File

@ -563,6 +563,7 @@ class WC_CLI_Customer extends WC_CLI_Command {
}
if ( ! $user ) {
/* translators: %s: id email or login */
throw new WC_CLI_Exception( 'woocommerce_cli_invalid_customer', sprintf( __( 'Invalid customer "%s"', 'woocommerce' ), $id_email_or_login ) );
}

View File

@ -119,6 +119,7 @@ class WC_CLI_Order extends WC_CLI_Command {
$order = $this->create_base_order( $default_order_args, $data );
if ( is_wp_error( $order ) ) {
/* translators: %s: error messages */
throw new WC_CLI_Exception( 'woocommerce_cli_cannot_create_order', sprintf( __( 'Cannot create order: %s', 'woocommerce' ), implode( ', ', $order->get_error_messages() ) ) );
}

View File

@ -121,6 +121,7 @@ class WC_CLI_Product_Category extends WC_CLI_Command {
$term = get_term( $term_id, 'product_cat' );
if ( is_wp_error( $term ) || is_null( $term ) ) {
/* translators: %s: product category ID */
throw new WC_CLI_Exception( 'woocommerce_cli_invalid_product_category_id', sprintf( __( 'Invalid product category ID "%s"', 'woocommerce' ), $term_id ) );
}

View File

@ -144,6 +144,7 @@ class WC_Email_Customer_Completed_Order extends WC_Email {
'subject' => array(
'title' => __( 'Subject', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default subject */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->subject . '</code>' ),
'placeholder' => '',
'default' => '',
@ -152,6 +153,7 @@ class WC_Email_Customer_Completed_Order extends WC_Email {
'heading' => array(
'title' => __( 'Email heading', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default heading */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->heading . '</code>' ),
'placeholder' => '',
'default' => '',
@ -160,6 +162,7 @@ class WC_Email_Customer_Completed_Order extends WC_Email {
'subject_downloadable' => array(
'title' => __( 'Subject (downloadable)', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default subject */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->subject_downloadable . '</code>' ),
'placeholder' => '',
'default' => '',
@ -168,6 +171,7 @@ class WC_Email_Customer_Completed_Order extends WC_Email {
'heading_downloadable' => array(
'title' => __( 'Email heading (downloadable)', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default heading */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->heading_downloadable . '</code>' ),
'placeholder' => '',
'default' => '',

View File

@ -157,6 +157,7 @@ class WC_Email_Customer_Invoice extends WC_Email {
'subject' => array(
'title' => __( 'Email subject', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default subject */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->subject . '</code>' ),
'placeholder' => '',
'default' => '',
@ -165,6 +166,7 @@ class WC_Email_Customer_Invoice extends WC_Email {
'heading' => array(
'title' => __( 'Email heading', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default heading */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->heading . '</code>' ),
'placeholder' => '',
'default' => '',
@ -173,6 +175,7 @@ class WC_Email_Customer_Invoice extends WC_Email {
'subject_paid' => array(
'title' => __( 'Email subject (paid)', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default subject */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->subject_paid . '</code>' ),
'placeholder' => '',
'default' => '',
@ -181,6 +184,7 @@ class WC_Email_Customer_Invoice extends WC_Email {
'heading_paid' => array(
'title' => __( 'Email heading (paid)', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default heading */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->heading_paid . '</code>' ),
'placeholder' => '',
'default' => '',

View File

@ -202,6 +202,7 @@ class WC_Email_Customer_Refunded_Order extends WC_Email {
'subject_full' => array(
'title' => __( 'Full refund subject', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default subject */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->subject_full . '</code>' ),
'placeholder' => '',
'default' => $this->subject_full,
@ -210,6 +211,7 @@ class WC_Email_Customer_Refunded_Order extends WC_Email {
'subject_partial' => array(
'title' => __( 'Partial refund subject', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default subject */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->subject_partial . '</code>' ),
'placeholder' => '',
'default' => $this->subject_partial,
@ -218,6 +220,7 @@ class WC_Email_Customer_Refunded_Order extends WC_Email {
'heading_full' => array(
'title' => __( 'Full refund email heading', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default heading */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->heading_full . '</code>' ),
'placeholder' => '',
'default' => $this->heading_full,
@ -226,6 +229,7 @@ class WC_Email_Customer_Refunded_Order extends WC_Email {
'heading_partial' => array(
'title' => __( 'Partial refund email heading', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default heading */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->heading_partial . '</code>' ),
'placeholder' => '',
'default' => $this->heading_partial,

View File

@ -491,6 +491,7 @@ class WC_Email extends WC_Settings_API {
'subject' => array(
'title' => __( 'Email subject', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default subject */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->subject . '</code>' ),
'placeholder' => '',
'default' => '',
@ -499,6 +500,7 @@ class WC_Email extends WC_Settings_API {
'heading' => array(
'title' => __( 'Email heading', 'woocommerce' ),
'type' => 'text',
/* translators: %s: default heading */
'description' => sprintf( __( 'Defaults to %s', 'woocommerce' ), '<code>' . $this->heading . '</code>' ),
'placeholder' => '',
'default' => '',