gpt4 book ai didi

wordpress - WooCommerce - 翻译结帐页面上的单词

转载 作者:行者123 更新时间:2023-12-02 03:23:37 25 4
gpt4 key购买 nike

我正在尝试翻译 WooCommerce 结帐页面上的一个词。我的网站是荷兰语,但他们翻译得不好,所以我想换个词。

需要翻译的内容

它涉及以下行:

“总计 469,38 欧元(包括 79,38 欧元 Belasting)”

英文是这样说的:

“总计 469,38 欧元(包括 79,38 欧元)”

这是汇总订单总金额的行。我想将“Belasting”这个词翻译成“BTW”。

我尝试过的

  1. 检查 WooCommerce 中的设置

  2. 安装插件 Loco 翻译器

  3. 使用 FTP (Adobe Dreamweaver) 搜索单词

因为我在任何地方都找不到“Belasting”这个词,所以我确实找到了包含该行元素的 php 文件。

这是我在 PHP 文档 wc-cart-functions.php 中找到的:

if ( ! empty( $tax_string_array ) ) {
$value .= '<small class="includes_tax">' . sprintf( __( '(Includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) ) . '</small>';
}

这就是 HTML 部分的样子:

<small class="includes_tax">
(inclusief
<span class="amount">€79,38</span>
Belasting)
</small>

我的问题

我假设它确实用“%s”变量打印了“Belasting”这个词。但是我无法在任何地方找到该变量的内容。

所以有人可以帮助我找到如何翻译这个词吗?

感谢阅读,非常感谢您的帮助。

最佳答案

您可以尝试使用 gettext过滤器

例子

function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'Check out these related products', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );

关于wordpress - WooCommerce - 翻译结帐页面上的单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31559778/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com