WCP OpenWeather & WPML compatibility
-
Hi,
My name is David from the WPML Compatibility team. I’m writing to you about helping to resolve an issue between WPML and WCP OpenWeather.
WPML hooks in gettext to register strings for translations. The problem is that you are using different textdomain each time this line is executed:
theme/metro/classes/Theme.class.php:
$this->setName(__('Metro Theme', 'wcp-openweather-theme-' . $this->getUniqueId()));
This causes several problems:
– The string is registered repeatedly, each time with a different textdomain.
– Its impossible to translate because the textdomain keeps changing.It should be easy to resolve, just change the above line to:
$this->setName(__('Metro Theme', 'wcp-openweather-theme-metro'));
This also happens with the Default theme.
(reported in https://wpml.org/forums/topic/504-gateway-timeout-when-try-to-access-to-string-translation/)
Its not only a problem with WPML, anyone trying to translate this string will have that problem. Please note that WordPress recommends to use strings for textdomains, not functions:
https://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/
Please let me know if you can consider including that fix in WCP OpenWeather.
Thanks!
- The topic ‘WCP OpenWeather & WPML compatibility’ is closed to new replies.