Woocommerce emails text string translation only works in some emails
-
I have an issue where text strings in my modified child-theme templates, are not translated in some specific Woocommerce emails. For example the following string is placed in my child-theme/woocommerce/emails/email-addresses.php:
<h3><?php _e( ‘Order date:’, ‘kalium-child’ ); ?></h3> Translates as it should to Swedish for “customer completed order emails” but doesn’t translate in “new order (to store)” or “customer processing order”.
The strange thing is that the pluging “Woo preview emails” shows the string translated correctly in all emails, BUT “WP mail logging” shows that the string was not translated in the processing email going to the customer as well as the new order to the store. The completed order email was translated though.
Everything is done in my childtheme.
I am loading the style.css for kalium-child theme, as well as loading translations with:add_action( ‘wp_enqueue_scripts’, ‘enqueue_childtheme_scripts’, 100 ); function enqueue_childtheme_scripts() { wp_enqueue_style( ‘kalium-child’, get_stylesheet_directory_uri() . ‘/style.css’ ); } in style.css I have declared the new text domain with: Text Domain: kalium-child Loading translations via add_action(‘after_setup_theme’, ‘kalium_child_theme_setup’); function kalium_child_theme_setup(){load_child_theme_textdomain(‘kalium-child’, get_stylesheet_directory_uri() . ‘/languages’); }
Translation done with Loco translate
I can’t find how to fix this..Please if anyone have any idea.
Thanks
Martin
- The topic ‘Woocommerce emails text string translation only works in some emails’ is closed to new replies.