0

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.

1 Answer 1

0

Actually 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');

 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.