To fix the issue on your local WordPress installation, you can use a filter function to intercept WooCommerce when it fetches any translated string and replace the exiting string with a string of your choice.
Here’s an example of a filter function:
/* Fix incorrect WooCommerce translations. */
function replace_incorrect_translations( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Ich bin froh!' :
$translated_text = __( 'Ich bin ernst.', 'woocommerce' );
break;
case 'Ich bin traurig.' :
$translated_text = __( 'Ich bin ernst.', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'replace_incorrect_translations', 20, 3 );
You need to place the function above inside your child theme’s functions.php
file.
-
This reply was modified 5 months, 1 week ago by
elaborate.
-
This reply was modified 5 months, 1 week ago by
elaborate.