Merge pull request #715 from GeertDD/placeholder_context
Added "placeholder" context to translations used as placeholder text in forms
This commit is contained in:
commit
a221864c71
|
@ -30,7 +30,7 @@ function woocommerce_coupon_data_meta_box($post) {
|
|||
woocommerce_wp_select( array( 'id' => 'discount_type', 'label' => __('Discount type', 'woocommerce'), 'options' => $woocommerce->get_coupon_discount_types() ) );
|
||||
|
||||
// Amount
|
||||
woocommerce_wp_text_input( array( 'id' => 'coupon_amount', 'label' => __('Coupon amount', 'woocommerce'), 'placeholder' => __('0.00', 'woocommerce'), 'description' => __('Enter an amount e.g. 2.99', 'woocommerce') ) );
|
||||
woocommerce_wp_text_input( array( 'id' => 'coupon_amount', 'label' => __('Coupon amount', 'woocommerce'), 'placeholder' => _x('0.00', 'placeholder', 'woocommerce'), 'description' => __('Enter an amount e.g. 2.99', 'woocommerce') ) );
|
||||
|
||||
// Individual use
|
||||
woocommerce_wp_checkbox( array( 'id' => 'individual_use', 'label' => __('Individual use', 'woocommerce'), 'description' => __('Check this box if the coupon cannot be used in conjunction with other coupons', 'woocommerce') ) );
|
||||
|
@ -42,16 +42,16 @@ function woocommerce_coupon_data_meta_box($post) {
|
|||
woocommerce_wp_checkbox( array( 'id' => 'free_shipping', 'label' => __('Enable free shipping', 'woocommerce'), 'description' => sprintf(__('Check this box if the coupon enables free shipping (see <a href="%s">Free Shipping</a>)', 'woocommerce'), admin_url('admin.php?page=woocommerce&tab=shipping_methods&subtab=shipping-free_shipping')) ) );
|
||||
|
||||
// Product ids
|
||||
woocommerce_wp_text_input( array( 'id' => 'product_ids', 'label' => __('Product IDs', 'woocommerce'), 'placeholder' => __('N/A', 'woocommerce'), 'description' => __('(optional) Comma separate IDs which need to be in the cart to use this coupon or, for "Product Discounts", which products are discounted.', 'woocommerce') ) );
|
||||
woocommerce_wp_text_input( array( 'id' => 'product_ids', 'label' => __('Product IDs', 'woocommerce'), 'placeholder' => _x('N/A', 'placeholder', 'woocommerce'), 'description' => __('(optional) Comma separate IDs which need to be in the cart to use this coupon or, for "Product Discounts", which products are discounted.', 'woocommerce') ) );
|
||||
|
||||
// Exclude Product ids
|
||||
woocommerce_wp_text_input( array( 'id' => 'exclude_product_ids', 'label' => __('Exclude Product IDs', 'woocommerce'), 'placeholder' => __('N/A', 'woocommerce'), 'description' => __('(optional) Comma separate IDs which must not be in the cart to use this coupon or, for "Product Discounts", which products are not discounted.', 'woocommerce') ) );
|
||||
woocommerce_wp_text_input( array( 'id' => 'exclude_product_ids', 'label' => __('Exclude Product IDs', 'woocommerce'), 'placeholder' => _x('N/A', 'placeholder', 'woocommerce'), 'description' => __('(optional) Comma separate IDs which must not be in the cart to use this coupon or, for "Product Discounts", which products are not discounted.', 'woocommerce') ) );
|
||||
|
||||
// Usage limit
|
||||
woocommerce_wp_text_input( array( 'id' => 'usage_limit', 'label' => __('Usage limit', 'woocommerce'), 'placeholder' => __('Unlimited usage', 'woocommerce'), 'description' => __('(optional) How many times this coupon can be used before it is void', 'woocommerce') ) );
|
||||
woocommerce_wp_text_input( array( 'id' => 'usage_limit', 'label' => __('Usage limit', 'woocommerce'), 'placeholder' => _x('Unlimited usage', 'placeholder', 'woocommerce'), 'description' => __('(optional) How many times this coupon can be used before it is void', 'woocommerce') ) );
|
||||
|
||||
// Expiry date
|
||||
woocommerce_wp_text_input( array( 'id' => 'expiry_date', 'label' => __('Expiry date', 'woocommerce'), 'placeholder' => __('Never expire', 'woocommerce'), 'description' => __('(optional) The date this coupon will expire, <code>YYYY-MM-DD</code>', 'woocommerce'), 'class' => 'short date-picker' ) );
|
||||
woocommerce_wp_text_input( array( 'id' => 'expiry_date', 'label' => __('Expiry date', 'woocommerce'), 'placeholder' => _x('Never expire', 'placeholder', 'woocommerce'), 'description' => __('(optional) The date this coupon will expire, <code>YYYY-MM-DD</code>', 'woocommerce'), 'class' => 'short date-picker' ) );
|
||||
|
||||
do_action('woocommerce_coupon_options');
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ function woocommerce_product_data_box() {
|
|||
woocommerce_wp_text_input( array( 'id' => '_product_url', 'label' => __('Product URL', 'woocommerce'), 'placeholder' => 'http://', 'description' => __('Enter the external URL to the product.', 'woocommerce') ) );
|
||||
|
||||
// Button text
|
||||
woocommerce_wp_text_input( array( 'id' => '_button_text', 'label' => __('Button text', 'woocommerce'), 'placeholder' => __('Buy product', 'woocommerce'), 'description' => __('This text will be shown on the button linking to the external product.', 'woocommerce') ) );
|
||||
woocommerce_wp_text_input( array( 'id' => '_button_text', 'label' => __('Button text', 'woocommerce'), 'placeholder' => _x('Buy product', 'placeholder', 'woocommerce'), 'description' => __('This text will be shown on the button linking to the external product.', 'woocommerce') ) );
|
||||
|
||||
echo '</div>';
|
||||
|
||||
|
@ -84,10 +84,10 @@ function woocommerce_product_data_box() {
|
|||
<label for="'.$field['id'].'_from">'.$field['label'].'</label>
|
||||
<input type="text" class="short" name="'.$field['id'].'_from" id="'.$field['id'].'_from" value="';
|
||||
if ($sale_price_dates_from) echo date('Y-m-d', $sale_price_dates_from);
|
||||
echo '" placeholder="' . __('From…', 'woocommerce') . '" maxlength="10" />
|
||||
echo '" placeholder="' . _x('From…', 'placeholder', 'woocommerce') . '" maxlength="10" />
|
||||
<input type="text" class="short" name="'.$field['id'].'_to" id="'.$field['id'].'_to" value="';
|
||||
if ($sale_price_dates_to) echo date('Y-m-d', $sale_price_dates_to);
|
||||
echo '" placeholder="' . __('To…', 'woocommerce') . '" maxlength="10" />
|
||||
echo '" placeholder="' . _x('To…', 'placeholder', 'woocommerce') . '" maxlength="10" />
|
||||
<a href="#" class="cancel_sale_schedule">'. __('Cancel', 'woocommerce') .'</a>
|
||||
</p>';
|
||||
|
||||
|
|
|
@ -34,18 +34,18 @@ class WC_Checkout {
|
|||
'account_username' => array(
|
||||
'type' => 'text',
|
||||
'label' => __('Account username', 'woocommerce'),
|
||||
'placeholder' => __('Username', 'woocommerce')
|
||||
'placeholder' => _x('Username', 'placeholder', 'woocommerce')
|
||||
),
|
||||
'account_password' => array(
|
||||
'type' => 'password',
|
||||
'label' => __('Account password', 'woocommerce'),
|
||||
'placeholder' => __('Password', 'woocommerce'),
|
||||
'placeholder' => _x('Password', 'placeholder', 'woocommerce'),
|
||||
'class' => array('form-row-first')
|
||||
),
|
||||
'account_password-2' => array(
|
||||
'type' => 'password',
|
||||
'label' => __('Account password', 'woocommerce'),
|
||||
'placeholder' => __('Password', 'woocommerce'),
|
||||
'placeholder' => _x('Password', 'placeholder', 'woocommerce'),
|
||||
'class' => array('form-row-last'),
|
||||
'label_class' => array('hidden')
|
||||
)
|
||||
|
@ -55,7 +55,7 @@ class WC_Checkout {
|
|||
'type' => 'textarea',
|
||||
'class' => array('notes'),
|
||||
'label' => __('Order Notes', 'woocommerce'),
|
||||
'placeholder' => __('Notes about your order, e.g. special notes for delivery.', 'woocommerce')
|
||||
'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce')
|
||||
)
|
||||
);
|
||||
$this->checkout_fields = apply_filters('woocommerce_checkout_fields', $this->checkout_fields);
|
||||
|
|
|
@ -847,44 +847,44 @@ class WC_Countries {
|
|||
$fields = array(
|
||||
'first_name' => array(
|
||||
'label' => __('First Name', 'woocommerce'),
|
||||
'placeholder' => __('First Name', 'woocommerce'),
|
||||
'placeholder' => _x('First Name', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-first'),
|
||||
),
|
||||
'last_name' => array(
|
||||
'label' => __('Last Name', 'woocommerce'),
|
||||
'placeholder' => __('Last Name', 'woocommerce'),
|
||||
'placeholder' => _x('Last Name', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-last'),
|
||||
'clear' => true
|
||||
),
|
||||
'company' => array(
|
||||
'label' => __('Company Name', 'woocommerce'),
|
||||
'placeholder' => __('Company (optional)', 'woocommerce'),
|
||||
'placeholder' => _x('Company (optional)', 'placeholder', 'woocommerce'),
|
||||
'clear' => true
|
||||
),
|
||||
'address_1' => array(
|
||||
'label' => __('Address', 'woocommerce'),
|
||||
'placeholder' => __('Address', 'woocommerce'),
|
||||
'placeholder' => _x('Address', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-first'),
|
||||
),
|
||||
'address_2' => array(
|
||||
'label' => __('Address 2', 'woocommerce'),
|
||||
'placeholder' => __('Address 2 (optional)', 'woocommerce'),
|
||||
'placeholder' => _x('Address 2 (optional)', 'placeholder', 'woocommerce'),
|
||||
'class' => array('form-row-last'),
|
||||
'label_class' => array('hidden'),
|
||||
'clear' => true
|
||||
),
|
||||
'city' => array(
|
||||
'label' => __('Town/City', 'woocommerce'),
|
||||
'placeholder' => __('Town/City', 'woocommerce'),
|
||||
'placeholder' => _x('Town/City', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-first'),
|
||||
),
|
||||
'postcode' => array(
|
||||
'label' => __('Postcode/Zip', 'woocommerce'),
|
||||
'placeholder' => __('Postcode/Zip', 'woocommerce'),
|
||||
'placeholder' => _x('Postcode/Zip', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-last', 'update_totals_on_change'),
|
||||
'clear' => true
|
||||
|
@ -892,14 +892,14 @@ class WC_Countries {
|
|||
'country' => array(
|
||||
'type' => 'country',
|
||||
'label' => __('Country', 'woocommerce'),
|
||||
'placeholder' => __('Country', 'woocommerce'),
|
||||
'placeholder' => _x('Country', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-first', 'update_totals_on_change', 'country_select'),
|
||||
),
|
||||
'state' => array(
|
||||
'type' => 'state',
|
||||
'label' => __('State/County', 'woocommerce'),
|
||||
'placeholder' => __('State/County', 'woocommerce'),
|
||||
'placeholder' => _x('State/County', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-last', 'update_totals_on_change'),
|
||||
'clear' => true
|
||||
|
@ -929,13 +929,13 @@ class WC_Countries {
|
|||
|
||||
$address_fields['billing_email'] = array(
|
||||
'label' => __('Email Address', 'woocommerce'),
|
||||
'placeholder' => __('Email Address', 'woocommerce'),
|
||||
'placeholder' => _x('Email Address', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-first')
|
||||
);
|
||||
$address_fields['billing_phone'] = array(
|
||||
'label' => __('Phone', 'woocommerce'),
|
||||
'placeholder' => __('Phone', 'woocommerce'),
|
||||
'placeholder' => _x('Phone', 'placeholder', 'woocommerce'),
|
||||
'required' => true,
|
||||
'class' => array('form-row-last'),
|
||||
'clear' => true
|
||||
|
|
Loading…
Reference in New Issue