Not translating all woocommerce strings
-
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)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Not translating all woocommerce strings’ is closed to new replies.