wordpress - 使用 wpml 进行 Woocommerce 自定义状态翻译
问题描述
我正在尝试翻译 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;
}
先感谢您
解决方案
推荐阅读
- flutter - 颤振LinkedHashMap与python中的orderedDict比较
- javascript - React Styled Component 不显示正确的输出
- winapi - 我如何向acl添加权限?
- reactjs - 如何使用 Nextjs 和外部 REST API 执行 oauth
- python - cbind2(1, newx) %*% nbeta 中的错误:Cholmod 错误-R 中的套索回归错误
- javafx - Javafx如何在鼠标滚轮悬停在vbox /窗口上时加速滚动条和滚动
- sql - PostgresSQL/SQL 查询
- c# - c# 处理跨国DateTime时区
- javascript - 在打字稿中循环
- vhdl - 如何找到 RTL 代码支持的最大频率?