Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1283252
    gretar
    Participant

    Hello

    I have tried to apply changes to the functions.php file in my child theme like this:

    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.' => '<strong>%s</strong> 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.' => '<strong>%s</strong> 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',
    		'Apply Coupon' => 'Nota afsláttarkóða'
    	);
    
    	if( isset( $translation[$text] ) ) {
    	return $translation[$text];
    	}
    
    	return $translated_text;
    }

    to change the text when a user removes an item from the cart. Everything works in this translation except the removed. Undo text. Can you help me fix this ?

    #1283349
    Thai
    Moderator

    Hi There,

    Please try with this:

    '%s removed.' => '%s fjarlægt úr körfunni þinni.',
    'Undo?' => 'Sækja vöru aftur í körfu?'

    Hope it helps 🙂

    #1389957
    gretar
    Participant

    Sorry for the late reply but it works perfectly !

    #1390050
    Thai
    Moderator

    You’re most welcome 🙂

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