• Resolved anetak

    (@anetak)


    Hello,
    I am running a multi language website, having finally translated the whole website to english and Bulgarian language, I came to testing the emails. And I see big issues here which I do not know how to solve.

    I am using Polylang, woo-poly-integration, woocommerce bookings and product vendors plugins. Every string from each email is translated either in polylang strings or through loco translate. The problem is that I am receiving either emails with mixed strings or some in Bulgarian and then some in English.

    Example
    1.New order done in Bulgarian
    Customer receives email in Bulgarian
    Vendor receives email with mixed strings Bulgarian and English (the language set for the user is Bulgarian)
    Admin receives email in Bulgarian

    2.Order status changed to ‘processing’
    Customer receives email in Bulgarian
    Vendor receives email in English
    Admin receives email in English

    3.Order status changed to ‘cancelled’
    Customer -no email
    Vendor receives email in English
    Admin – no email

    4.Order status changed to ‘completed’
    Customer receives email in Bulgarian
    Vendor = no email
    Admin receives email in English

    5.Booking status changed to ‘confirmed’
    Customer receives email in English
    Vendor = no email
    Admin – no email

    6.Booking status changed to ‘cancelled’
    Customer receives email in English
    Vendor receives email in English
    Admin receives email in English

    And so on. I am looking for consistency – if the order is made in Bulgarian – all the emails sent to the customer to be in Bulgarian. If the vendor (user) language is set to Bulgarian all the emails they get to be in Bulgarian.

    Please help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor jomo

    (@jonathanmoorebcsorg)

    This plugin only handles emails for the woocommerce plugin itself.
    – this does not include vendor emails, I assume you are using another plugin for this
    – this does not include bookings, I assume you are using another plugin for this

    Also, when switching languages, this plugin only reloads the translation files for the woocommerce plugin and this plugin so any other plugins providing strings would also need their text domain reloaded.

    [Also, woocommerce has changed some of their default strings for email subjects and titles, meaning this plugin isn’t translating some of the default strings – I have checked in a fix for this in github.]

    I have added and translated additional emails, this is quite possible to do but this free plugin only supports the out-of-the box features, other plugins would need to implement their own support or you would need to implement the compatibility layer for it..

    Thread Starter anetak

    (@anetak)

    Thank you for the answer. I am really struggling here to get this working and I will appreciate your help.

    Can you please let me know if the language set for the user account is ever used for the language of the emails?
    As far as I can understand the logic is: If the email is order related, send it in the language of the order, otherwise send it in the language defined in the admin panel. Is the language set for the user taken into account for emails and when?

    The emails for woocommerce bookings and product vendors (plugins) do become part of the woocommerce emails as you can see them in the admin panel in woocommerse -> settings -> emails
    If you can give me a hint or have some example how I can add them to your code, I will greatly appreciate it.

    Plugin Contributor jomo

    (@jonathanmoorebcsorg)

    this plugin only handles those emails added by the woocommerce plugin itself, it does not do a generic handling of all emails added to woocommerce. The emails it does handle are all translated (even the ones sent to the shop: the idea is that the shop should be able to provide customer service in the order language, and the shop email is translatable too so you can route orders in different languages to different customer service addresses).

    The implementation in this plugin is not particularly generic/extensible, though some hooks have been added, you would have to write code similar to Emails.php, see:
    https://github.com/hyyan/woo-poly-integration/blob/master/src/Hyyan/WPI/Emails.php
    Or indeed you are more than welcome to refactor Emails.php and submit a pull request.

    Ok here is some example code which shows first the use of woopoly filters to unload and load additional text domains for plugins which are adding texts to the emails, then adds translated subject and title for a custom shipping email.
    https://gist.github.com/Jon007/5b90e78289899bc28e9c39c12ef56e60

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Emails translation issues’ is closed to new replies.