php - 更改 Elementor 菜单购物车小部件中的文本
问题描述
如何在新的 Elementor 菜单购物车小部件中更改“结帐”和“显示购物车”按钮中的“小计”和文本?我想将它们翻译成我的语言(波兰语),但这些文本在我使用的 Loco 翻译小部件中不可见。可能 str_ireplace () 会起作用,但我不能正确使用它。链接到我的网站 - https://www.abreo.pl。
解决方案
问题解决了...
/*Change text strings */
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Subtotal' :
$translated_text = __( 'Your text here', 'woocommerce' );
break;
case 'Checkout' :
$translated_text = __( 'Your text here', 'woocommerce' );
break;
case 'Show Cart' :
$translated_text = __( 'Your text here', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
推荐阅读
- ruby-on-rails - 为什么将 Rails 升级到 6.0.0 后 Heroku Rails App 会崩溃?
- reactjs - 当 tinymce 与反应应用程序集成时,CORS 出错
- javascript - Highcharts Navigator 不会更改时间
- angular - Jasmine 在 Angular 中的嵌套函数测试覆盖率
- flutter - 一个小部件中可以有多个 StreamBuilder 吗?
- java - 如何在 JAVA 中对文件进行签名和验证
- wix - 如何在 DefineConstants 中根据您的构建版本放置变量以使用 HeatDirectory 进行 Harvest?
- git - 如何可靠地确定 git 子模块的当前分支名称
- java - 基于具有特殊标准的多个字段对对象列表进行排序
- bash - 将 shell 命令的输出复制到变量中,并且需要使输出数据的逗号分隔