Hello
I have been searching for some time where I can translate the text: I have read and agree to the website terms and conditions *
My site is https://www.garminbudin.is and you need to add a product to the cart and go to checkout to see this string.
I have translation files in /wp-content/languages/plugins and the text is translated there but nothing changes. I also have this in my functions.php file in the child theme:
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.' => '%s fjarlægt úr körfunni þinni.',
'Undo?' => 'Sækja vöru aftur í körfu?',
'Postcode / ZIP' => 'Póstnúmer',
'Clear' => 'Hreinsa',
'Related Products' => 'Tengdar vörur',
'You may be interested in…' => 'Þú gætir einnig haft áhuga á…',
'Shipping costs will be calculated once you have provided your address.' => 'Sendingarkostnaður er reiknaður út þegar þú hefur skilgreint heimilisfang í næsta skrefi.',
'Billing details' => 'Upplýsingar um greiðanda.',
'Order notes' => 'Athugasemdir með pöntun.',
'Shipping' => 'Sendingarmáti.',
'Notes on your order, e.g. special notes concerning delivery.' => 'Hér getur þú sett inn nánari upplýsingar ef þú vilt.',
'Apply Coupon' => 'Nota afsláttarkóða',
'View cart' => 'Skoða körfu',
'Cart totals' => 'Karfan',
'Update cart' => 'Uppfæra körfu',
'Shipping' => 'Sendingarmáti',
'Proceed to checkout' => 'Ganga frá greiðslu',
'Product categories' => 'Vöruflokkur',
'Search products...' => 'Leita að vörum',
'Apartment, suite, unit etc. (optional)' => 'Íbúðanúmer eða aðrar upplýsingar, valkvæmt',
'House number and street name' => 'Heiti götu og húsnúmer',
'Be the first to review “%s”' => 'Vertu fyrst/ur til að skrifa umsögn um “%s”',
'Product' => 'Heiti vöru',
'Price' => 'Verð',
'Quantity' => 'Magn',
'Total' => 'Samtals',
'Available on backorder' => 'Í boði sem biðpöntun',
'Coupon code' => 'Afsláttarkóði',
'Subtotal' => 'Samtals í körfu',
'Shipping' => 'Sendingarkostnaður',
'Add to cart' => 'Setja í körfu',
'Categories:' => 'Vöruflokkar',
'Category:' => 'Vöruflokkur',
'Description' => 'Lýsing',
'Sale!' => 'Tilboð!',
'I have read and agree to the website <a href="%s" target="_blank" class="woocommerce-terms-and-conditions-link">terms and conditions</a> *' => 'Ég hef lesið og samþykki <a href="%s" target="_blank" class="woocommerce-terms-and-conditions-link">skilmála vefsíðunnar</a> *'
);
if( isset( $translation[$text] ) ) {
return $translation[$text];
}
return $translated_text;
}
But nothing changes on the site itself. Can you help me with this ?