Add translations to Card Fields inputs and labelds.

This commit is contained in:
Pedro Silva 2023-12-22 17:47:03 +00:00
parent 425b7b4a31
commit 00dfa6122b
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
2 changed files with 39 additions and 4 deletions

View file

@ -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,