How to add additional javascript translation to translated page

[ad_1]

Hi,

When I translate a page from English to Spanish some translation is not great. I have added the following to functions.php to correct the mistake but it doesn’t work for translated pages.

function replace_text($text) {
	$text = str_ireplace('es comodidad, seguridad, seguridad', 'es comodidad, seguridad, certidumbre', $text);

return $text;
};
add_filter(‘the_content’, ‘replace_text’);
add_action(‘get_footer’, ‘replace_text’);`
`
The function above works great for the written pages but does not work for translated pages.

I tried adding the code to the bottom of the GTranslate plugin in “Widget code (for advanced users)” section but still it won’t work.

I don’t know if this is because the function is running before GTranslate has finished the page translation or why it wont work.

I don’t want to use the multisite option as it’s just too much work, can you help please.

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer