Tagged: x
-
AuthorPosts
-
March 1, 2017 at 3:10 am #1389953
gretarParticipantHello
I have a site, http://www.jotunn.is and when displaying cross sells I can not translate this text You May Be Interested In…
I have this function in my child theme functions.php but it does not work
add_filter('gettext', 'x_translate_text' , 20, 3); add_filter('ngettext', 'x_translate_text' , 20, 3); function x_translate_text ( $translated_text, $text, $domain ) { $translation = array ( '%s has been added to your cart.' => '%s er kominn í körfuna þína.', 'Your cart is currently empty.' => 'Karfan þín er tóm eins og er', 'Return To Shop' => 'Fara aftur í vefverslun', '%s have been added to your cart.' => '%s eru komin í körfuna þína.', 'You are now logged in as <strong>%s</strong>' => 'Þú ert núna skráð/ur inn sem <strong>%s</strong>', 'View Cart' => 'Skoða körfu', '%s removed. %sUndo?%s' => '%s fjarlægt úr körfunni þinni. %sSækja vöru aftur í körfu?%s', 'Postcode / ZIP' => 'Póstnúmer', 'Clear' => 'Hreinsa', 'Related Products' => 'Tengdar vörur', 'You May Be Interested In…' => 'Þú gætir einnig haft áhuga á…', 'Apply Coupon' => 'Nota afsláttarkóða' ); if( isset( $translation[$text] ) ) { return $translation[$text]; } return $translated_text; }Can I get some help on this ?
March 1, 2017 at 4:59 am #1390053
ChristianModeratorHey there,
Please follow this translation instruction https://community.theme.co/kb/translation/
Thanks.
March 1, 2017 at 6:20 am #1390149
gretarParticipantI have everything translated in PoEdit files but this string is not in the language files and that is why I have this function in functions.php to translate extra strings not found in the language files for the theme. I have a child theme where the language files are stored so they are not overwritten when the theme is updated.
So please help me with this function or tell me where exactly I can translate this string and also have it so that it does not get overwritten in the next update.
March 1, 2017 at 7:47 am #1390266
ChristianModeratorThat string is available in
wp-content\themes\x\framework\lang\x.potasYou May Be Interested In…(see attachment)Try replacing
You May Be Interested In…in your code with the proper stringYou May Be Interested In…Thanks.
March 1, 2017 at 7:49 am #1390268
gretarParticipantThanks ! the … was exactly what I was missing.
March 1, 2017 at 9:04 am #1390364
ChristianModeratorYou’re welcome.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1389953 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
