Update products settings to use I18nUtil for unit labels

This commit is contained in:
Corey McKrill 2023-01-31 17:26:14 -08:00
parent 31d5b45443
commit cdff039569
No known key found for this signature in database
GPG Key ID: 84BBFE669C4D97B8
1 changed files with 11 additions and 9 deletions

View File

@ -6,6 +6,8 @@
* @version 2.4.0
*/
use Automattic\WooCommerce\Utilities\I18nUtil;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@ -112,10 +114,10 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'kg',
'type' => 'select',
'options' => array(
'kg' => __( 'kg', 'woocommerce' ),
'g' => __( 'g', 'woocommerce' ),
'lbs' => __( 'lbs', 'woocommerce' ),
'oz' => __( 'oz', 'woocommerce' ),
'kg' => I18nUtil::get_weight_unit_label( 'kg' ),
'g' => I18nUtil::get_weight_unit_label( 'g' ),
'lbs' => I18nUtil::get_weight_unit_label( 'lbs' ),
'oz' => I18nUtil::get_weight_unit_label( 'oz' ),
),
'desc_tip' => true,
),
@ -129,11 +131,11 @@ class WC_Settings_Products extends WC_Settings_Page {
'default' => 'cm',
'type' => 'select',
'options' => array(
'm' => __( 'm', 'woocommerce' ),
'cm' => __( 'cm', 'woocommerce' ),
'mm' => __( 'mm', 'woocommerce' ),
'in' => __( 'in', 'woocommerce' ),
'yd' => __( 'yd', 'woocommerce' ),
'm' => I18nUtil::get_dimensions_unit_label( 'm' ),
'cm' => I18nUtil::get_dimensions_unit_label( 'cm' ),
'mm' => I18nUtil::get_dimensions_unit_label( 'mm' ),
'in' => I18nUtil::get_dimensions_unit_label( 'in' ),
'yd' => I18nUtil::get_dimensions_unit_label( 'yd' ),
),
'desc_tip' => true,
),