0

I have a site with polylang installed with 3 languages. LV as default, EN and RU. For the PLURAR(polylang does not support it) strings translation I want to use poedit locally and then copy the translated mo/po files to the child theme /language folder. I tried to translate two string, copied the created mo/po files to the server, but the at the sites frontend transaltion is not shown. I have read multiple manuals and everything should be working, but nothing really happens.

In my child themes /languages folder I even created two types of language code files lv.mo , lv.po and lv_LV.mo and lv_LV.po but nothing happens.

My child themes function.php has definition of language folder.

load_child_theme_textdomain ( 'greattheme', get_stylesheet_directory () . '/languages' );

What could be wrong with my setup?

1 Answer 1

0

As per Theme Handbook ⇒ Internationalization, you should call load_child_theme_textdomain() from within the after_setup_theme hook:

function load_greattheme_textdomain() {
    load_child_theme_textdomain( 'greattheme', get_stylesheet_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'load_greattheme_textdomain' );

Make sure you name your *.mo and *.po files properly (follow the link above).

1
  • Thanks! This helped and also the text domain for the string was incorrect from previous loco translate plugin experiment.
    – jam
    Sep 11, 2020 at 12:30

Your Answer

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

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