Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Cristian Kirk

    (@cristian-kirk)

    Very nice Hal, thank you so much.

    Now I’ll have to write a new workaround to add my own translations cause the ones from the API are not very good. ??

    Thread Starter Cristian Kirk

    (@cristian-kirk)

    I’ve just made a quick, temporal repair for anyone wanting to fix the translation. I’ve added a switch on the php file. Now, I’m completely sure it’s not the best solution at all, but I don’t know how to add the translation to the language files, I think I could do it, but it’d take me more time to understand how it works. So, this solution is simple, a little rudimentary, but it works.

    This goes right after the opening conditional of $show_stats.

    $ck_weather_description = "";
    switch ($today->weather[0]->description) {
       case "broken clouds":
             $ck_weather_description = "Nubosidad variable"; break;
       case "light rain":
             $ck_weather_description = "LLovizna"; break;
       case "moderate rain":
             $ck_weather_description = "Lluvia moderada"; break;
        default:
            $ck_weather_description=$today->weather[0]->description;
    }

    And then replace this line:
    <div class=\"awe_desc\">{$today->weather[0]->description}</div>
    with this one:
    <div class=\"awe_desc\">" . $ck_weather_description . "</div>

    I don’t have a list of all weather descriptions, so I’m just adding them as they appear on the widget.

    Thread Starter Cristian Kirk

    (@cristian-kirk)

    I’m using spanish.

    https://oi61.tinypic.com/2hy1rc.jpg

    Just like you see in the picture, everything works fine except for that first line.

Viewing 3 replies - 1 through 3 (of 3 total)