From 6be097ff4575ca72b7e184c0a84be7f91f664323 Mon Sep 17 00:00:00 2001 From: Michael Pretty Date: Thu, 11 May 2023 10:59:24 -0400 Subject: [PATCH] Add context to the credit card names used for translators. (#36364) Co-authored-by: Michael Pretty Co-authored-by: Jorge A. Torres --- .../changelog/add-credit-card-i18n-context | 4 ++++ plugins/woocommerce/includes/wc-core-functions.php | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 plugins/woocommerce/changelog/add-credit-card-i18n-context diff --git a/plugins/woocommerce/changelog/add-credit-card-i18n-context b/plugins/woocommerce/changelog/add-credit-card-i18n-context new file mode 100644 index 00000000000..d4a62357142 --- /dev/null +++ b/plugins/woocommerce/changelog/add-credit-card-i18n-context @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak + +Add context to translatable strings for credit card labels. diff --git a/plugins/woocommerce/includes/wc-core-functions.php b/plugins/woocommerce/includes/wc-core-functions.php index cb67f8e70d4..86100564f40 100644 --- a/plugins/woocommerce/includes/wc-core-functions.php +++ b/plugins/woocommerce/includes/wc-core-functions.php @@ -1560,12 +1560,12 @@ function wc_get_credit_card_type_label( $type ) { $labels = apply_filters( 'woocommerce_credit_card_type_labels', array( - 'mastercard' => __( 'MasterCard', 'woocommerce' ), - 'visa' => __( 'Visa', 'woocommerce' ), - 'discover' => __( 'Discover', 'woocommerce' ), - 'american express' => __( 'American Express', 'woocommerce' ), - 'diners' => __( 'Diners', 'woocommerce' ), - 'jcb' => __( 'JCB', 'woocommerce' ), + 'mastercard' => _x( 'MasterCard', 'Name of credit card', 'woocommerce' ), + 'visa' => _x( 'Visa', 'Name of credit card', 'woocommerce' ), + 'discover' => _x( 'Discover', 'Name of credit card', 'woocommerce' ), + 'american express' => _x( 'American Express', 'Name of credit card', 'woocommerce' ), + 'diners' => _x( 'Diners', 'Name of credit card', 'woocommerce' ), + 'jcb' => _x( 'JCB', 'Name of credit card', 'woocommerce' ), ) );