我试图翻译woocommerce自定义状态 我在woocommerce论坛上发现了这个代码,但它不可翻译
/**
* Add or modify States
*/
add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) {
$states['XX'] = array(
'XX1' => 'State 1',
'XX2' => 'State 2'
);
return $states;
}
我这样修改了它,但我不确定代码是否正确
/**
* Add or modify States
*/
add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) {
$states['XX'] = array(
'X' => __( 'XX1', 'woocommerce' ),
'Y' => __( 'YY2', 'woocommerce' ),
);
return $states;
}
提前谢谢