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?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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).
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0