How to generate a child theme pot file
-
Hi there,
I want to create a pot file for translate a few additional strings in my child theme . The parent theme is sydney.
In the child code, I added a the lines :
– Text Domain: sydney-child im the style.css
– function my_child_theme_setup() {
load_child_theme_textdomain( ‘sydney-child’, get_stylesheet_directory() . ‘/languages’ );
}
add_action( ‘after_setup_theme’, ‘my_child_theme_setup’ );
in functions.phpIn the php files of my child theme I could have lines like
echo __(“Comments are closed.”,”sydney”); // <- parent’s text domain
echo __(“Legal terms”,”sydney-child”); // <- child’s text domainIn my pot file, I just want to find the additional strings of my child theme.
I’ve tried to generate the pot using :
the poedit tool
the makepot toolIn both case the result is the same : I have the strings of the parent and child theme in the generated pot file.
Is there a way to avoid this ?
PS : the loco translate plungin seems to fix this issue. But I don’t want to use a plugin to translate 3 or 4 additional strings.
Thanks for your help.
Catherine.
- The topic ‘How to generate a child theme pot file’ is closed to new replies.