Skip Navigation

Open

Reported for: WPML String Translation 3.2.18

Topic Tags: Bug, WCML

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;
		}
	}

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>