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

  • Resolved David Garcia Watkins



    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:

    $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

    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:

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


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author 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,

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