Open
Reported for: WPML String Translation 3.2.18
Overview of the issue
Emails sent to customers after updating the status of an order in the back end may include texts in mixed languages, even when the relevant strings have been correctly translated.
(This can occur when the admin user updating the order has a particular language set in their user profile which is different than the language the customer placed the order in.)
Workaround
As a temporary workaround you can edit the String Translation file wp-content/plugins/wpml-string-translation/classes/TranslateWpmlString.php
Be sure to have a current backup before making any changes.
Locate the definition of the private function loadTextDomain and update it like so:
private function loadTextDomain( $domain, $locale ) { if ( ! isset( $GLOBALS['l10n'][ $domain ] ) && ! isset( $GLOBALS['l10n_unloaded'][ $domain ] ) && ! isset( self::$loadedDomains[ $locale ][ $domain ] ) ) { load_textdomain( $domain, $this->fileManager->getFilepath( $domain, $locale ), $locale ); self::$loadedDomains[ $locale ][ $domain ] = true; } }
I also changed this – not working
Hello there,
If this workaround doesn’t help, it may be a different situation. Please, start a chat in our support forum, in that way one of our specialists will take care of your case.
Regards
We changed all the admin-users languages (in their profile) to the “Site default” setting.
This seemed to work.
Hi Dennis,
Thanks for the tip. Our devs are working on improving the switch language logic. We will keep this erratum updated.