简体   繁体   English

Woocommerce本地化问题

[英]Woocommerce localization problems

I am localizing woocommerce and facing this problem. 我正在本地woocommerce并面临此问题。 On "shop" page, I have "showing" message which is printed this way: 在“商店”页面上,我以这种方式打印“正在显示”消息:

printf( _x( '<p>Showing</p> <span> %1$d–%2$d of %3$d results </span>', '%1$d = first, %2$d = last, %3$d = total', 'woocommerce' ), $first, $last, $total );

So, I went to admin panel, located this message and entered the translation, generated new mo file, but nothing is changed on the page. 因此,我转到管理面板,找到此消息并输入翻译,生成了新的mo文件,但页面上没有任何更改。 This is also applies to other messages on this page. 这也适用于此页面上的其他消息。 However, in header/footer/sidebar everything works ok. 但是,在页眉/页脚/侧边栏中,一切正常。

From i18n/languages/woocommerce-lt_LT.po: 从i18n / languages / woocommerce-lt_LT.po:

#: templates/loop/result-count.php:32
#, php-format
#@ woocommerce
msgctxt "%1$d = first, %2$d = last, %3$d = total"
msgid "Showing %1$d–%2$d of %3$d results"
msgstr "Rodomi rezultatai %1$d–%2$d iš %3$d"

Why messages are not displaying translated? 为什么邮件未显示翻译? What should I do? 我该怎么办?

In functions.php of theme there was: 在主题的functions.php中,有:

$lang = get_template_directory_uri() . '/languages';
load_theme_textdomain($textdomain, $lang);

while should be: 而应为:

$lang = get_template_directory() . '/languages';
load_theme_textdomain($textdomain, $lang);

so language simply has not been loaded 所以根本就没有加载语言

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM