This topic has 2 replies, 2 voices, and was last updated 8 years, 2 months ago ago by Olga Barlow
Hi there, I have a WP site with XStore 1.3 as a parent and a child theme which is active.
I am trying to translate the theme to spanish:
– I already have WP set up in spanish, woocommerce ( most of it) is also in spanish.
– I used the ‘xstore/languages/xstore.pot’ file to create .po and.mo files (in poedit), which I have added to the child theme folder under a ‘languages’ folder
– I added the following to the ‘functions.php’ file: `add_action( ‘after_setup_theme’, ‘load_child_language’ );
function load_child_language() {
load_child_theme_textdomain( ‘mychildtheme-name’, get_stylesheet_directory() . ‘/languages’ );
}`
– No changes seem to take effect
– Also want to do the same for woocommerce, some labels are not changing
Could you please assist with clarifying where/how the files should be structured and called in the child theme to take effect? Ideally I would like to keep the child theme with all my translation files for the theme and woocommerce,
thank you very much.
Hello,
If you need to translate strings from pages theme you need to place .po/.mo files into parent theme languages folder.
You should create new child theme pot file and translate it in case you have added some new strings in child theme.
Also you may use Loco Translate plugin if you want to translate theme via Dashboard. If you use this plugin you should save po/mo files into wp-content/languages/themes folder.
Regards
The issue related to '‘Translation in child theme – theme and woocommerce’' has been successfully resolved, and the topic is now closed for further responses