Tagged: x
-
AuthorPosts
-
November 26, 2016 at 5:23 am #1271393
warhostParticipantHey,
I set up a WC Shop on my X-Theme page. I enabled cross- and up-sells. The headings for both of these were not translated initially, then I checked all WC/X related .po files and it was translated there. Still, in the browser it showed up in english. Now, I added a filter for the up-sells on the product page, like such:
add_filter(‘gettext’, ‘translate_like’);
add_filter(‘ngettext’, ‘translate_like’);
function translate_like($translated) {
$translated = str_ireplace(‘You may also like…’, ‘Das könnte dir auch gefallen…’, $translated);
return $translated;
}——- EDIT:
Fixed it, for everyone who checks this later, do this:
Add another line for every line you want to translate, should work.add_filter(‘gettext’, ‘translate_like’);
add_filter(‘ngettext’, ‘translate_like’);
function translate_like($translated) {
$translated = str_ireplace(‘You may also like…’, ‘Das könnte dir auch gefallen…’, $translated);
$translated = str_ireplace(‘$translated = str_ireplace(‘You may also like…’, ‘Das könnte dir auch gefallen…’, $translated);return $translated;
}November 26, 2016 at 5:43 am #1271406
ChristopherModeratorThanks for sharing.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1271393 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
