Tagged: x
-
AuthorPosts
-
June 21, 2016 at 7:59 pm #1053553
Magik WebParticipantWe successfully translated 90% of the website to french, but can’t find the proper strings to translate the last few things from the blog section. We tried through WPML as seen in the attached files, but it didn’t budge the bottom of posts.
How would you go at it?
June 22, 2016 at 2:03 am #1053859
ChristopherModeratorHi there,
Please add this in child theme’s functions.php file:
add_filter('gettext', 'x_translate_text' , 20, 3); function x_translate_text ( $translated_text, $text, $domain ) { $translation = array ( 'Share on Facebook' => 'Partager sure Facebook', 'Share via Email' => 'Partager sure Email', 'Share on Google+' => 'Partager sure Google+' 'Share on Linkedin' => 'Partager sure Linkedin' 'Share on Twitter' => 'Partager sure Twitter' ); if( isset( $translation[$text] ) ) { return $translation[$text]; } return $translated_text;In regards with comment area provide us with URL.
Hope it helps.
June 22, 2016 at 8:08 am #1054253
Magik WebParticipantI will try this as soon as I can, thank you very much for your efficient support.
The URL to see the comment section is the following: https://v2.magikweb.ca/blogue/10-facons-davoir-un-site-web-securitaireJune 22, 2016 at 8:51 am #1054322
ChristopherModeratorHi there,
Please add following code in Customize -> Custom -> JavaScript :
(function($){ $('html[lang=fr-FR] #reply-title.comment-reply-title').text('Your Text Here'); $('html[lang=fr-FR] .comment-notes').text('Your Text Here'); $('html[lang=fr-FR] .comment-form-author label').text('Your Text Here *'); $('html[lang=fr-FR] .comment-form-email label').text('Your Text Here *'); $('html[lang=fr-FR] .comment-form-url label').text('Your Text Here'); $('html[lang=fr-FR] .comment-form-comment label').text('Your Text Here'); })(jQuery)Hope that helps.
June 29, 2016 at 12:28 pm #1065198
Magik WebParticipantFor the “Share via” translation, the provided code worked! Here it is with the syntax fixes.
/* Overrides a few strings for translation (WPML doesn't support them) */ 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' ); if( isset( $translation[$text] ) ) { return $translation[$text]; } return $translated_text; }We tried the jQuery fix for the comment section, but it has a few issues.
(function($){ $('html[lang=fr-FR] #reply-title.comment-reply-title').text('Laissez un commentaire'); $('html[lang=fr-FR] .comment-notes').text('1?'); $('html[lang=fr-FR] .comment-form-author label').text('2?'); $('html[lang=fr-FR] .comment-form-email label').text('3?'); $('html[lang=fr-FR] .comment-form-url label').text('4?'); $('html[lang=fr-FR] .comment-form-comment label').text('Commentaire'); })(jQuery)- Since it’s fixed on the client side, will SEO robots register it properly?
- It seems like there’s a few missing strings such as the “Reply” (see attached file)
Thank you for any follow up! 🙂
June 29, 2016 at 2:00 pm #1065339
DarshanaModeratorHi there,
As you have pointed out, jQuery solution may tend to occur such SEO related issues. However you should be able to find those strings within your x.pot file and you can translate them using PoEdit as mentioned here on our guide (https://community.theme.co/kb/translation/).
Thanks!
June 30, 2016 at 10:15 am #1066803
Magik WebParticipantThe issue is resolved, after playing in WPML and changing the language code, the strings were applied properly. Possibly a bug of WPML not detecting the theme’s strings.
Thank you for your help!
June 30, 2016 at 11:58 am #1066957
Prasant RaiModeratorHappy to hear that. Feel free to ask us again. Have a great day! 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1053553 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
