Translation in child theme – theme and woocommerce

This topic has 2 replies, 2 voices, and was last updated 8 years, 2 months ago ago by Olga Barlow

  • Avatar: lcz
    lcz
    Participant
    July 7, 2016 at 06:13

    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.

    1 Answer
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    July 7, 2016 at 08:30

    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

  • Viewing 2 results - 1 through 2 (of 2 total)

The issue related to '‘Translation in child theme – theme and woocommerce’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.