• When creating a shop with WooCommerce, not all strings are found from the plugin, e.g. the name for the privacy policy:

    woocommerce/includes/wc-template-functions.php:947:	$privacy_link    = $privacy_page_id ? '<a href="' . esc_url( get_permalink( $privacy_page_id ) ) . '" class="woocommerce-privacy-policy-link" target="_blank">' . __( 'privacy policy', 'woocommerce' ) . '</a>' : __( 'privacy policy', 'woocommerce' );

    Or the terms and conditions page:

    includes/wc-template-functions.php:948:	$terms_link      = $terms_page_id ? '<a href="' . esc_url( get_permalink( $terms_page_id ) ) . '" class="woocommerce-terms-and-conditions-link" target="_blank">' . __( 'terms and conditions', 'woocommerce' ) . '</a>' : __( 'terms and conditions', 'woocommerce' );

    Somehow not all strings are detected. Is someone else experiencing the same issue?

    My current workaround is following code snippet:

    /**
     * Translate WooCommerce strings
     */
    add_filter( 'gettext', function( $translated, $text, $domain ) {
        if ( $domain === 'woocommerce' ) {
            if( $text === 'terms and conditions' ) {
                $translated = '...';
            }
            if( $text === 'privacy policy' ) {
                $translated = '...';
            }
        }
        return $translated;
    }, PHP_INT_MAX, 3);
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tim W

    (@timwhitlock)

    These strings are present in woocommerce.pot as of the current version (v8.0.3).

    #: includes/wc-template-functions.php:947
    msgid "privacy policy"
    msgstr ""
    
    #: includes/wc-template-functions.php:948
    msgid "terms and conditions"
    msgstr ""

    Any PO in sync with this POT will make these strings editable and viewable in the Loco Translate editor. Are your PO files synced to this POT? If you updated WooCommerce recently, did you sync your PO to pick up new strings?

    Thread Starter Kristiyan Katsarov

    (@katsar0v)

    Hello Tim, I have updated the plugin and also deleted old translations for tests, however after sync they are not picked up.

    Plugin Author Tim W

    (@timwhitlock)

    I have no problem seeing this string in the editor. I don’t know what you are doing differently, but this works with default settings.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Not translating all woocommerce strings’ is closed to new replies.