admin管理员组文章数量:1287579
I'm prepping my theme for translation. I've added the following line to my functions.php, and added the text domain within my theme files.
<?php /*** LOAD THEME TEXTDOMAIN ***/
load_theme_textdomain( 'mytheme', get_template_directory() . '/languages' );
$locale = get_locale();
$locale_file = get_template_directory() . "/languages/$locale.php";
if ( is_readable( $locale_file ) ) {
require_once( $locale_file );
}
?>
I've used poedit to generate my po files. It is finding some of the strings that are labeled with the text domain, but it's not finding my menu items, categories, or tags. Guessing I'm missing something?
I did some digging and I couldn't find any answers. Ultimately this is for a front-end translation - wp admin will remain in english.
BTW, the menu is based on wp-bootstrap-navwalker
I'm prepping my theme for translation. I've added the following line to my functions.php, and added the text domain within my theme files.
<?php /*** LOAD THEME TEXTDOMAIN ***/
load_theme_textdomain( 'mytheme', get_template_directory() . '/languages' );
$locale = get_locale();
$locale_file = get_template_directory() . "/languages/$locale.php";
if ( is_readable( $locale_file ) ) {
require_once( $locale_file );
}
?>
I've used poedit to generate my po files. It is finding some of the strings that are labeled with the text domain, but it's not finding my menu items, categories, or tags. Guessing I'm missing something?
I did some digging and I couldn't find any answers. Ultimately this is for a front-end translation - wp admin will remain in english.
BTW, the menu is based on wp-bootstrap-navwalker
Share Improve this question edited Aug 4, 2014 at 14:14 Pieter Goosen 55.4k23 gold badges115 silver badges210 bronze badges asked Aug 4, 2014 at 14:08 roybattyroybatty 1131 gold badge1 silver badge12 bronze badges 2- ok, so i did a wp export using the default functionality in wp admin, and i noticed that my categories are included in the xml file. but i don't see the strings contained in my menu items. where do these live? seems they're not being pulled into my export or my .po files. i had a look at the translation docs at wordpress, and they seem to deal mainly with translating wordpress itself, but i'm not finding much about translating the actual content for a front-end translation. thanks for your help! – roybatty Commented Aug 6, 2014 at 15:00
- 7 years later, I am in the same situation. Anyone can help? Thanks – Badr Louachama Commented Sep 18, 2021 at 15:36
1 Answer
Reset to default 0check this link: https://wiesmann.codiferes/wordpress/?p=25829
for translater your themes add Xili... Plugins that is multilanguages plugin. in there you can make po. file in Languages folder in themes folder, and translater it to any languages you want.
good luck
本文标签: textdomainHow to get menu stringscategories and tags into po file for translation
版权声明:本文标题:textdomain - How to get menu strings, categories and tags into po file for translation 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741312658a2371736.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论