Hello.
I’m getting really tired of endless translations problems with WooCommerce.
My setup:
Staging page is http://nyr.rsimport.is
Translation files for WooCommerce in these folders on the server:
/wp-content/languages/plugins (woocommerce-admin-is_IS.po and .mo and woocommerce-is_IS.po and .mo)
/wp-content/languages/themes (x-is_IS.po and .mo)
/wp-content/languages/woocommerce (woocommerce-admin-is_IS.po and .mo and woocommerce-is_IS.po and .mo)
/wp-content/themes/x-child/framework/lang (woocommerce-admin-is_IS.po and .mo and woocommerce-is_IS.po and .mo)
/wp-content/themes/x-child/languages (woocommerce-admin-is_IS.po and .mo and woocommerce-is_IS.po and .mo)
I also have a function in functions.php in my child theme where I directly translate some strings
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ð!'
);
if( isset( $translation[$text] ) ) {
return $translation[$text];
}
return $translated_text;
}
Everything in the WP system is set to Icelandic and in the beginning WooCommerce was in Icelandic in the back- and frontend of the site.
Suddenly this changed a few days ago. The backend is now in English and some strings are in English also on the site itself.
If you add a product to the cart and then view the cart, at the bottom where the price is the word Shipping is always in English !!! This is making me crazy…
Also when you view a product category (http://nyr.rsimport.is/voruflokkur/garmin/sportid/hlaupid/ for example) you can see that the drop down for sorting is in English also.
My client has now complained about the backend being in English so I need that fixed as well.
Please help me with this ASAP.