• 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

Viewing 1 replies (of 1 total)
  • Plugin Author Tim W

    (@timwhitlock)

    If Loco Translate has saved your strings in the kalim-child MO files, then its job is complete. Ensuring the translations are loaded and used correctly is then down to the plugin that makes use of the files.

    If you’re using Loco Translate’s custom (safe) directory then I suggest instead you use WooCommerce’s safe folder instead. This way you don’t even need Loco Translate to be installed after you’ve saved your translation files and can eliminate it as an issue.

    I can’t support you in debugging WooCommerce emails, but your question has been asked many times, so others on this forum may have found a solution.

Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce emails text string translation only works in some emails’ is closed to new replies.