• Resolved resunoiz

    (@resunoiz)


    Hi, I have this problem from a long time and more than a theme.
    I now have this site build with storefront and the string “is a required field” given in error messages in checkout is not trnslated.
    Opening woocommerce-it_IT.po and woocommerce-it_IT.mo, the string

    %s is a required field
    is correctly translated with
    è un campo obbligatorio
    in italian.

    The woocommerce file class-wc-checkout.php contains the string that has to be translated:

    				if ( $validate_fieldset && $required && '' === $data[ $key ] ) {
    					/* translators: %s: field name */
    					$errors->add( 'required-field', apply_filters( 'woocommerce_checkout_required_field_notice', sprintf( __( '<strong>%s is a required field.</strong>', 'woocommerce' ), '<strong>' . esc_html( $field_label ) . '</strong>' ), $field_label ), array( 'id' => $key ) );
    				}

    but…nothing. traslation doesn’t show on frontend.

    I had this problem with other strings starting with “%” in woocommerce and I found some solutions to avoid it, overriding templates etc. But with this file in woocommerce\includes it can’t be done.

    Any suggestion?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    Just to check: How are you managing those translations? Is that through a plugin like https://wordpress.org/plugins/loco-translate/ or are you manually loading those translation files to a directory? If it’s the latter, which directory are you using and are the permissions configured correctly?

    Thread Starter resunoiz

    (@resunoiz)

    Hi RK, I load my translation edit with Poedit via ftp in /website/wp-content/languages/woocommerce, I avoid as possible using plugins to make simple things.
    Permissions are 755, the problem is not with all words but only with some, particularly the ones with ‘%”

    Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    > Hi RK, I load my translation edit with Poedit via ftp in /website/wp-content/languages/woocommerce, I avoid as possible using plugins to make simple things.
    Permissions are 755, the problem is not with all words but only with some, particularly the ones with ‘%”

    I can relate. You can use Loco Translate to use the search function and template synchronisation which works pretty well. Afterwards you can deinstall Loco Translate. The plugin does not need to be active for the language file to load.

    > Any suggestion?

    I like using this https://wordpress.org/plugins/real-time-find-and-replace/ for when __ is not available (I know. Yet another plugin, but it works 1A).

    Kind regards,

    Thread Starter resunoiz

    (@resunoiz)

    I know that plug, tried it, is always my “last chance” after modifiyng templates and so on. then, I already tried it and…it doesn’t work for that messages. Maybe because they’re generated while the page loads some datas after the load (they0re error messages for a wrong input).

    Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    Hey there,

    Another thing I’d like to mention: if your theme is overriding WooCommerce default template, then the text used in the custom templates from your theme will be used instead of the WooCommerce default strings, meaning that in that case, you need to edit those strings within the translation file from the theme and NOT from WooCommerce 😉

    Thread Starter resunoiz

    (@resunoiz)

    those strings are not overrided from the theme 🙂

    Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    >those strings are not overrided from the theme

    Ok, but as I said, it’s worth mentioning it since it’s a common issue.

    Remi Corson

    (@corsonr)

    Automattic Happiness Engineer

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘“is a required field” not translated.’ is closed to new replies.