• Hi,

    I need to translate strings from my child theme, but i need to translate and parent theme also.

    When i load the child theme texdomain:

    function solid_construction_setup() {
        $path = get_stylesheet_directory().'/languages';
        load_child_theme_textdomain( 'solid-construction-child', $path );
    }
    add_action( 'after_setup_theme', 'solid_construction_setup' );

    the translations from the parent theme disappear.

    Can you help me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tim W

    (@timwhitlock)

    This looks like a coding question and not a question about using Loco Translate.

    Can you please clarify how this issue is related to using my plugin?

    Thread Starter itoshkova

    (@itoshkova)

    First I created template in Loco for parent theme and translated the string there.

    After that I followed the steps in the article you provided on your website:
    Child themes

    You recommend using this code to load my translation files:

    function twentyseventeen_child_setup() {
        $path = get_stylesheet_directory().'/languages';
        load_child_theme_textdomain( 'twentyseventeen-child', $path );
    }
    add_action( 'after_setup_theme', 'twentyseventeen_child_setup' );

    When i used this code – the translations from the parent theme disappear.

    Plugin Author Tim W

    (@timwhitlock)

    Just because I offer some tips on coding in my help pages does not mean I am here to provide support for coding problems.

    Loading a separate child theme text domain cannot stop your parent theme from working, as long as you have not modified the parent theme or any of its files.

    First I created template in Loco for parent theme and translated the string there

    This sounds like you’re modifying the parent theme. As per the guide you link to, child themes are separate. You should leave the parent theme alone.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Loading child and parent tempale’ is closed to new replies.