Home Looking for theme support? WordPress Themes Free Themes Educenter Translate Customizer strings Reply To: Translate Customizer strings

#5232
kmitz
Participant

I think I figured this out…

This fix requires Loco-translate. The setup is more complicated than a normal plugin. It won’t work at all unless you are willing to hack the theme php files.

The problem is that Educenter is not setup to use Gettext functions for what is set in the theme Customize section. Here’s an example of what you have to do (I use a child theme of Educenter Pro, so my text domain is educenter-pro-child — I named it this when I created my child theme. You might simply have educenter or educenter-pro if you’re not using a child theme):

The first step is create a functions.php file in your child theme. Add this to it (it doesn’t ned to contain anything else):

function educenter_pro_child_setup() {
    load_theme_textdomain( 'educenter-pro-child', get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'educenter_pro_child_setup' );

The next step requires some detective work. You have to find the right line of code to translate. To test, simply comment out a line and refresh your browser to see if it has any effect. My example is in the educenter-pro/section directory. If using a child theme, you need to copy this file to your child theme in the same directory structure, i.e. educenter-pro-child/section/educenter-section.php

Scroll down to line 434 and replace/comment as follows

//$subtitle = get_theme_mod('educenter_pro_services_main_subtitle');
$subtitle = __( get_theme_mod('educenter_pro_services_main_subtitle'), 'educenter-pro-child' );

If you don’t see the translation, make sure you have Loco-translate set up correctly and have translated the appropriate text that’s in the Customize panel.

Make sure and back up your edits if you’re not using a child theme or they will get overwritten whenever you update the theme.

Hope this helps.