WordPress.org

Forums

Awesome Weather Widget
[resolved] Translation (11 posts)

  1. aprop
    Member
    Posted 1 year ago #

    Hi and congrat for the plugin, it's one of the most easy and beauty ones i have seen.

    I would like to translate the front end language to a language that's not in the Api openweathermap.org, so i would like to translate the "some clouds" to my language (catalan).
    Is there any way to do it?

    Also it would be great to translate the "some clouds" to a icon. That could be a solution.

    Thanks

    http://wordpress.org/plugins/awesome-weather/

  2. Hal Gatewood
    Member
    Plugin Author

    Posted 1 year ago #

    I'm fairly new to the translation of plugins world, but from what I am learning this plugin can help you with it: http://wordpress.org/plugins/qtranslate/

    I hope to play around with it soon so I can answer your questions about translation better.

    Hal

  3. aprop
    Member
    Posted 1 year ago #

    Qtranslate is not useful for translating the plugin.
    In my experience qtranslate is great for all the text that I have to publish, but not for the php coded.

    would be great to have a personalizable text area were i can replace the "some clouds" string with the text I wanna show. It s not only translate it, it can be used to personalize it. "be happy its a sunny day" instead of sunny day" :)

  4. Hal Gatewood
    Member
    Plugin Author

    Posted 1 year ago #

    The "some clouds" text is not part of this plugin. That text is returned from the free weather data provided from OpenWeatherMaps. So they would have to translate it on their end.

  5. aprop
    Member
    Posted 1 year ago #

    So there's no way to translate it?

  6. Hal Gatewood
    Member
    Plugin Author

    Posted 1 year ago #

    Not an easy way at this time.

  7. rosso711
    Member
    Posted 1 year ago #

    you can translate most stuff with WPML

  8. Radiolover
    Member
    Posted 1 year ago #

    I solved the problem easily!

    1.
    Added new variable $desc and added in file awesome-weather.php on line about 230 (after the code COLOR OF WIDGET):

    $desc = $today->weather[0]->description;
    if($desc == "light shower snow") $desc = __('light shower snow', 'awesome-weather');
    if($desc == "shower snow") $desc = __('shower snow', 'awesome-weather');
    ....
    and so on

    2.
    Replaced
    <div class=\"awe_desc\">{$today->weather[0]->description}</div>
    on
    <div class=\"awe_desc\">".$desc." </div>

    3.
    And he added, in a translation of the description file

    #: awesome-weather.php
    msgid "light shower snow"
    msgstr "your language translate"
    .....
    In the language file you translate as desired description for the weather.

    Use it! ))

  9. aprop
    Member
    Posted 1 year ago #

    Can you explain better the point 3?
    Thanks.

  10. Radiolover
    Member
    Posted 1 year ago #

    In this phrase in quotes description of weather that gets script parsing weather. I found a few sample phrases and ordered them to file first. That's it. I could find (with translation into Russian):
    /languages/awesome-weather-en_EN.po

    #: awesome-weather.php:305
    msgid "light shower snow"
    msgstr "легкий снежок"

    #: awesome-weather.php:305
    msgid "overcast clouds"
    msgstr "переменная облачность"

    #: awesome-weather.php:305
    msgid "scattered clouds"
    msgstr "рассеянные облака"

    #: awesome-weather.php:305
    msgid "light snow"
    msgstr "легкий снежок"

    #: awesome-weather.php:305
    msgid "broken clouds"
    msgstr "облачно"

    #: awesome-weather.php:305
    msgid "sky is clear"
    msgstr "небо чистое"

    #: awesome-weather.php:305
    msgid "few clouds"
    msgstr "небольшая обачность"

    #: awesome-weather.php:305
    msgid "light rain"
    msgstr "легкий дождик"

    #: awesome-weather.php:305
    msgid "moderate rain"
    msgstr "умеренный дождь"

    #: awesome-weather.php:305
    msgid "snow"
    msgstr "снег"

    #: awesome-weather.php:305
    msgid "haze"
    msgstr "дымка"

    #: awesome-weather.php:305
    msgid "heavy intensity rain"
    msgstr "сильный дождь"

    you have to replace the text between each row msgstr "" symbols on your

  11. Hal Gatewood
    Member
    Plugin Author

    Posted 1 year ago #

    Just a note. The PRO version is fully translatable at this time:

    http://halgatewood.com/downloads/awesome-weather-widget-pro/

    However it doesn't use the same .pot file as the free version, so you would have to retranslate the new PRO .pot file.

    The weather descriptions are based of the WP_LANG variable in your wp-config.php file. I hope to make the FREE version completely translatable in the coming months as well.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Awesome Weather Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic