Home Forums Academy Cart language WooCommerce

Cart language WooCommerce

  • Anamaria

    Hi
    I can’t change the language of the cart (in Romanian language). I install Loco Translate, I follow the steps but…no results.

    Here are the images

    https://i.imgur.com/CZDeJUp.png

    https://i.imgur.com/m6lN8ih.png

    ihor Staff

    Please sign in or register to view replies from the support staff.

    Anamaria

    Hi.
    I found a solution without any plugin.
    I add this in function.php at end:
    add_filter(‘gettext’, ‘translate_strings’);
    add_filter(‘ngettext’, ‘translate_strings’);
    function translate_strings($translated) {
    $translated = str_ireplace(‘Coupon code’, ‘Cod cupon’, $translated);
    $translated = str_ireplace(‘Apply Coupon’, ‘Aplică cupon’, $translated);
    $translated = str_ireplace(‘Update Cart’, ‘Actualizeză coș’, $translated);
    $translated = str_ireplace(‘PRODUCT’, ‘PRODUS’, $translated);
    $translated = str_ireplace(‘PRICE’, ‘PREȚ’, $translated);
    $translated = str_ireplace(‘QUANTITY’, ‘CANTITATE’, $translated);
    $translated = str_ireplace(‘Cart Subtotal’, ‘Subtotal’, $translated);
    $translated = str_ireplace(‘Shipping and Handling’, ‘Transport’, $translated);
    $translated = str_ireplace(‘Cart TOTAL’, ‘Total coș’, $translated);
    $translated = str_ireplace(‘Order TOTAL’, ‘Total comandă’, $translated);
    $translated = str_ireplace(‘Calculate Shipping’, ‘Calculează transport’, $translated);
    $translated = str_ireplace(‘Please use the shipping calculator to see available shipping methods.’, ‘Vă rugăm să utilizați calculatorul pentru a vedea metodele de transport’, $translated);

    return $translated;
    }

    ihor Staff

    Please sign in or register to view replies from the support staff.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.