mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Add translations to Card Fields inputs and labelds.
This commit is contained in:
parent
425b7b4a31
commit
00dfa6122b
2 changed files with 39 additions and 4 deletions
|
@ -80,6 +80,17 @@ class CardFieldsModule implements ModuleInterface {
|
|||
array_unshift( $default_fields, $new_field );
|
||||
}
|
||||
|
||||
if ( apply_filters( 'woocommerce_paypal_payments_card_fields_translate_card_number', true ) ) {
|
||||
if ( isset( $default_fields['card-number-field'] ) ) {
|
||||
// Replaces the default card number placeholder with a translatable one.
|
||||
$default_fields['card-number-field'] = str_replace(
|
||||
'•••• •••• •••• ••••',
|
||||
esc_attr__( 'Card number', 'woocommerce-paypal-payments' ),
|
||||
$default_fields['card-number-field']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $default_fields;
|
||||
},
|
||||
10,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue