Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter W-P-Zar

    (@carbashop)

    Hi W-P-Zar, I’ll need to check that every instance of “is a required field” has been given WordPress Translation support, it’s likely not all of them have been. We can fix this together via a minor Plugin update

    Hi W-P-Zar, yes I can see that the ‘is a required field’ is done a few different ways and at least one of them is done wrong so I’ll get that fixed now and include it in a minor Plugin update due in the next 24 hours ??

    Thread Starter W-P-Zar

    (@carbashop)

    hi!
    thanks
    I have solved this way

    add_filter( 'woocommerce_add_error', function( $message ) {
        $message = str_replace("is a required field","es un campo requerido",$message );
        return $message;
    });

    Hi W-P-Zar, that would do it in the interim! ??

    We’re using the woocommerce-checkout-manager text domain throughout the Plugin so if you can take a moment once the next Plugin update is out to check over the Spanish translation I’d be very, very happy!

    https://translate.www.ads-software.com/projects/wp-plugins/woocommerce-checkout-manager

    Hi, thanks for the plugin.

    I have the same problem with translations.
    W-P-Zar: Where I can put that code?
    Thank you

    Hi Socialbeings, I’ll make a change to the required notice so that it can be also overridden by a WordPress Filter. The next update goes out tomorrow and I can drop a PHP snippet for your WordPress Theme once it’s out ??

    Thread Starter W-P-Zar

    (@carbashop)

    Socialbeings
    in functions.php
    or in your own plugin functions

    add_filter( 'woocommerce_add_error', function( $message ) {
        $message = str_replace("is a required field","es un campo requerido",$message );
        return $message;
    });

    sorry for my english

    Visser Labs It is appreciated

    Thanks W-P-Zar, that will replace the text of all WooCommerce error notices and should be added to your Theme’s functions.php file. ??

    Thank you very much you both for your quick response.
    A greeting.

    Thread Starter W-P-Zar

    (@carbashop)

    yes!! Visser Labs
    I said
    insert the code into a “my own plugin”

    <?php
    /*
    Plugin Name: MyFunctions
    Plugin URI: https://mydomain.com/
    Description: Plugin para liberar de funciones el fichero <code>functions.php</code> y activarlo a placer (o no) .
    Version: 1.0
    Author: nameautor
    Author URI: https://mydomain.com/
    License: GPLv2 o posterior
    */
    
    ////////////////////// change is a required field //////////////////////
    add_filter( 'woocommerce_add_error', function( $message ) {
        $message = str_replace("is a required field","es un campo requerido",$message );
        return $message;
    });
    
    ?>

    and install in wp

    sorry for my english

    Hi W-P-Zar, thanks for that, it will help others! ??

    Just a laymans explanation of what’s going on above:

    You are using the ‘woocommerce_add_error’ WordPress Filter within WooCommerce to replace ‘is a required field’ with your override then passing the value back to WooCommerce which displays the error notice

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘not work translate’ is closed to new replies.