Support » Plugin: WooCommerce Multilingual - run WooCommerce with WPML » Email translation issues

  • Hi there,

    I’m the developer of a popular plugin to adapt WooCommerce to the german market (https://wordpress.org/plugins/woocommerce-germanized/). I’m very often facing issues with WPML and specifically with WooCommerce Multilingual as the translation options for third party developers seem to be “hacky” and error prone and not well documented (at least for Woo specific things).

    Currently I’m trying to fix email translation. There seems to be an error within the way strings (specifically those for payment gateways) are translated within emails. Here are the steps to reproduce the issue:

    1. Create an order in a language differing from your base language
    2. Resend order details email in WP-Admin

    The result is that payment instructions are not translated to the language chosen by the user (buyer). All other strings within the email are translated correctly. The problem seems to be that WCML_Currencies_Payment_Gateways::add_hooks initializes the Woo payment gateways on load so that dynamically switching the language within the emails doesn’t change the string translation for the gateways.
    Furthermore the current language is set to a fixed value in WCML_WC_Gateways which will prevent any dynamic translation.

    The problem with the bug is, that every third party developer who (re)sends custom (order) emails from non-checkout-endpoints will face this issue as the refresh_email_lang method in WCML_Emails won’t work as expected.

    Just a general hint: Maybe it would be good to move plugin development to GitHub so that other developers can submit pull requests and issues to improve this plugin and it’s compatibility.

    Another issue: You are adding some nice filters to allow email field translations in the Woo settings (e.g. wcml_emails_options_to_translate in WCML_Emails). The problem is that you are checking the section name in $_GET in line 530. Every plugin author who uses prefixes for their Email classes (which is expected from a plugin developer) will miss out as this only works for core email classes. Maybe you could add another filter for the section name?

    Cheers,
    Dennis

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author sergey.r

    (@sergeyr-1)

    Hello Vendidero,
    Thanks for reporting this problem I’ll check and escalate to our queue, also will add asked filter for section name.

    About pull requests, you always can suggest your fixes here or in our forum on wpml.org.

    Thanks!

    Plugin Author sergey.r

    (@sergeyr-1)

    Hello Vendidero,
    I have added wcml_emails_section_name_to_translate filter for section name to next WCML 4.6.6 version

    Also about missing string translations can you please tell me which Gateway are you using and which details are not translated? Because I have tested on Bacs gateway and string displays correctly to me.

    Hi Sergey,

    that’s great!

    I’ve tried that with the BACS gateway (the instructions are not translated when the email is resend from admin screen). To reproduce the issue you might need to switch your admin profile language to a language differing from the language specified by the customer for the order.

    Cheers

    Plugin Author sergey.r

    (@sergeyr-1)

    Can you please open a ticket on our support on wpml.org site so we can ask to get a copy of your tests site because I still can’t reproduce it locally

    https://clip2net.com/s/43eOGly

    https://clip2net.com/s/43eOH3h

    Hi sergey,

    what’s missing in your examples are the payment gateway instructions e.g.

    “Please transfer the order amount to our bank account”

    The instructions should be added to the order confirmation email. Please add instructions to the BACS gateway and try again.

    To reproduce:
    1. Add instructions to the BACS payment gateway
    2. Create an order in a language differing from your admin language
    3. Resend order details when editing the order as admin
    4. See the email – the gateway instructions are not translated

    Cheers

    Plugin Support George Botsev

    (@botzev)

    Hello and thank you for reporting this case.
    My colleague Sergey is vacation this week, however I have reproduced the problem and escalated the issue to our developers.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.