I have a child theme that loads translations normaly but if i added custom translatable strings that doesn't exist into the parent, how to add these strings to the main po file or how to load it alongside the parent's translation.
I have a child theme that loads translations normaly but if i added custom translatable strings that doesn't exist into the parent, how to add these strings to the main po file or how to load it alongside the parent's translation.
Share Improve this question asked Nov 10, 2018 at 17:44 Mohamed OmarMohamed Omar 5191 gold badge5 silver badges17 bronze badges1 Answer
Reset to default 0Actually my mistake, I was overriding the translation of the parent theme using it's text domain for child theme, while I should have defined a different text domain for child theme and load both domains into child theme's functions.php
like this:
add_action( 'after_setup_theme', 'mr_load_textdomain' );
function mr_load_textdomain(){
//for child
load_theme_textdomain (MR_DOMAIN,get_stylesheet_directory().'/languages');
//for parent
load_theme_textdomain (ET_DOMAIN,get_template_directory().'/lang');
}