Support » Plugin: WCP OpenWeather » WCP OpenWeather & WPML compatibility

  • Resolved David Garcia Watkins

    (@dgwatkins)


    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:

    http://ottopress.com/2012/internationalization-youre-probably-doing-it-wrong/

    Please let me know if you can consider including that fix in WCP OpenWeather.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WebCodin

    (@webcodin)

    Hi David,

    Thank you for your suggestion, however it is a bit not suitable for current realization. In any way, we’ll take in account described issue and try to find more conceptual solution for future plugin releases.

    Thanks for the help!

    Great news,
    Thanks
    David

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WCP OpenWeather & WPML compatibility’ is closed to new replies.