How to get menu strings, categories and tags into po file for translation

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

1 Answer
1

check this link:
https://wiesmann.codiferes.net/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

Leave a Comment