Tagged: x
-
AuthorPosts
-
September 15, 2016 at 8:05 am #1176544
Rich HParticipantI swear that all the text was translated and with an update some things got reverted back to english. Everything in the PO MO files is translated but its not showing on the front end.
I found this bit of code in the forums, and it worked for Comments, but not the other terms.
add_filter('ngettext', 'translate_text' ); function translate_text($translated) { $translated = str_ireplace('Comment', 'Commentaire', $translated); $translated = str_ireplace('Comments', 'Commentaire', $translated); $translated = str_ireplace('Submit', 'Soumettre', $translated); $translated = str_ireplace('Search', 'Recherche', $translated); return $translated; }https://designinterieur.com/le-design-un-investissement-rentable/ The search box on the top right, and Submit at the bottom.
Thanks.
September 15, 2016 at 8:47 am #1176625
DarshanaModeratorHi 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 credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
September 15, 2016 at 9:59 am #1176721
Rich HParticipantThis reply has been marked as private.September 15, 2016 at 6:39 pm #1177338
RadModeratorHi there,
Please try this
add_filter('gettext', 'translate_text', 20, 3 ); function translate_text($translated_text, $text, $domain) { $translations = array ( 'Comment' => 'Commentaire', 'Comments' => 'Commentaire', 'Submit' => 'Soumettre', 'Search' => 'Recherche' ); return isset( $translations[ $text ] ) ? $translations[ $text ] : $translated_text; }Hope this helps.
September 16, 2016 at 8:05 am #1178139
Rich HParticipantPartially there, the ‘comments’ does not translate with the above code, but the other 2 do.
September 16, 2016 at 5:46 pm #1178721
RadModeratorHi there,
Please try this,
add_filter('gettext', 'translate_text', 20, 3 ); function translate_text($translated_text, $text, $domain) { $translations = array ( 'Comment' => 'Commentaire', 'Comments' => 'Commentaire', '%s Comment' => '%s Commentaire', '%s Comments' => '%s Commentaire', 'Submit' => 'Soumettre', 'Search' => 'Recherche' ); return isset( $translations[ $text ] ) ? $translations[ $text ] : $translated_text; }Cheers!
September 19, 2016 at 8:02 am #1181340
Rich HParticipantStill no 🙁 Doesn’t translate comments.
September 19, 2016 at 8:10 am #1181355
ThaiModeratorHi There,
Please keep your code and also add the following code:
add_filter('ngettext', 'x_translate_comments' , 20, 3); function x_translate_comments( $translated_text, $single, $plural ) { $translation = array( '%s Comment' => '%s Commentaire', '%s Comments' => '%s Commentaire' ); if( isset( $translation[$single] ) ) { return $translation[$single]; } if( isset( $translation[$plural] ) ) { return $translation[$plural]; } return $translated_text; }Hope it helps 🙂
September 19, 2016 at 10:12 am #1181548
Rich HParticipantAWESOME, thanks.
September 19, 2016 at 10:18 am #1181557
RahulModeratorGlad we were able to help you out!
If you have anything further to ask, let us know. We’d be happy to assist you with anything.
Thanks for using the X.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1176544 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
