Translate "Do not show again" in Content Dock

Hello,

How can I translate the “Do not show again” message in Content Dock ?

I’ve copied content-dock.php in my child theme in the folder /home/neowebsite/public_html/wp-content/themes/pro-child/plugins/tco-content-dock/views/site/

I’ve then changed the line 95 with <input type="checkbox" id="tco_content_dock_do_not_show" value="1" /> <?php _e( 'Ne plus afficher', '__e__' ); ?>

But it doesn’t translate the text. What did I do wrong?

Thanks,
Antoine

Hello Antoine,

Hope you’re well today.

Since you are trying to translate a specific text on the site, Please install and activate the child theme and login through FTP then edit the functions.php then add this code:

// Translate Strings
add_filter( 'gettext', 'translate_x_strings', 20, 3 );

function translate_x_strings( $translated_text, $text, $domain ) {

        switch ( $translated_text ) {

            case 'Do not show again' :

                $translated_text = __( 'Ne plus afficher', '__x__' );
                break;

        }

    return $translated_text;
}

You might also want to check our KB article about Translations:

Hope this helps.

Thank you. I tried to modify the file of the plugin in the child theme directly though. If you could tell me what I’ve done wrong which explains why it’s not working I would appreciate it.

Hi Antoine,

That extension doesn’t allow child theme override.

Please remove the file you have added in your child theme and follow the instructions provided by my colleague.

Thanks

I understand, thank you.

You’re most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.