Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1312653
    Magik Web
    Participant

    We’ve been using WPML and Theme X for a while now since our clients are 99% french.
    We recently noticed that many terms on our own website are not translated properly, see attached files.
    Terms such as “Reply”, “Comments”, etc.

    We’re starting to think that all native Theme X terms are not being translated and we don’t know where to look to get it fixed.
    ICL_LANGUAGE_CODE reports “fr” properly.

    Any hint or checkup would be appreciated.
    Thank you for any feedback!

    #1312660
    Magik Web
    Participant

    1.png was too large, I cropped it.

    #1312661
    Magik Web
    Participant

    Wish I could edit the first post, here is another (more cropped) version. Sorry for the multiposting.

    #1313696
    Christopher
    Moderator

    Hi there,

    Please find and translate strings in x.pot file, please check this link : https://community.theme.co/kb/translation

    Hope it helps.

    #1314079
    Magik Web
    Participant

    Hello Christopher, thank you for the follow-up.
    Even though that doesn’t explain why WPML wouldn’t work properly with Theme X, we gave it a shot to fix the issue.
    Sadly, we didn’t succeed that way, it may be our fault, but we followed the provided tutorial.

    See attached files, let us know if we failed somewhere.

    Looking at the bottom of this page: https://www.magikweb.ca/blogue/comment-choisir-son-hebergement-web still shows “Reply” and “Edit”.

    #1314133
    Christian
    Moderator

    Hey there,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1314229
    Magik Web
    Participant
    This reply has been marked as private.
    #1315261
    Christopher
    Moderator

    Hi there,

    Please create a new folder in child theme directory called ‘languages’. Move both fr_CA.po and fr_CA.mo files to x-child/languages.

    Add following code in child theme’s functions.php file :

    add_action( 'after_setup_theme', 'load_child_language' );
    	function load_child_language() {
    		load_child_theme_textdomain( '__x__', get_stylesheet_directory() . '/languages' );
    }
    

    Hope it helps.

    #1315690
    Magik Web
    Participant

    Hello Christopher,
    We did the suggested changes as shown in the attached files. We specifically translated the string “Read More”.
    It still reads “Read More” in the blog section: https://www.magikweb.ca/blogue

    Thank you for your patience.

    #1316805
    Rad
    Moderator

    Hi there,

    I just checked and the only “Read More” that WPML could see is from Buddypress. Or simply, the translation file isn’t loaded at all. I went ahead and edit your code in child theme to force “Read More” translations, but it throws error on line one

    Parse error: syntax error, unexpected end of file in /home/magikweb/public_html/wp-content/themes/x-child/functions.php on line

    I went ahead and fix the encoding issue. And the translation fix should be like this

    add_filter('gettext', 'x_translate_text' , 20, 3);
    function x_translate_text($translated_text, $text, $domain){
    
    	$translation = array(
    		'Share on Facebook'	=> 'Partager sur Facebook',
    		'Share via Email'	=> 'Partager sur Email',
    		'Share on Google+'	=> 'Partager sur Google+',
    		'Share on LinkedIn'	=> 'Partager sur Linkedin',
    		'Share on Twitter'	=> 'Partager sur Twitter',
    		'Read More'	=> 'Lire la suite'
    	);
    
    	if( isset( $translation[$text] ) ) {
    		return $translation[$text];
    	}
    	return $translated_text;
    }

    Thanks!

    #1317826
    Magik Web
    Participant

    Thank you Rad. We don’t understand why WPML wouldn’t see it.
    Nonetheless, we will do all remaining translations that way when WPML doesn’t find them from now on.

    Have a great day!

    #1318314
    Prasant Rai
    Moderator

    You are most welcome. 🙂

  • <script> jQuery(function($){ $("#no-reply-1312653 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>