Jump to content


zeldoox

Member Since 14 Sep 2014
Offline Last Active 12 Sep 2019 17:41
-----

Posts I've Made

In Topic: Translate weather information on skin

9 August 2016 - 06:55

By trials and errors, modifing the py file it finally works

 

        elif self.type == self.wtext:
            if xweather['ytext']  ==  'AM Clouds/PM Sun':
                info = "AM Nuvole/PM Sole"


In Topic: Translate weather information on skin

8 August 2016 - 12:03

Here it is.

It creates a yweather.xml file in tmp.

 

Here there are part of the iformation that it extracts.

 

<pubDate>Mon, 08 Aug 2016 12:00 PM CEST</pubDate>
<yweather:condition xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="32" date="Mon, 08 Aug 2016 12:00 PM CEST" temp="25" text="Sunny"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="34" date="08 Aug 2016" day="Mon" high="26" low="15" text="Mostly Sunny"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="47" date="09 Aug 2016" day="Tue" high="26" low="17" text="Scattered Thunderstorms"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="47" date="10 Aug 2016" day="Wed" high="22" low="16" text="Scattered Thunderstorms"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="30" date="11 Aug 2016" day="Thu" high="21" low="14" text="Partly Cloudy"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="34" date="12 Aug 2016" day="Fri" high="22" low="14" text="Mostly Sunny"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="32" date="13 Aug 2016" day="Sat" high="24" low="15" text="Sunny"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="34" date="14 Aug 2016" day="Sun" high="25" low="16" text="Mostly Sunny"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="34" date="15 Aug 2016" day="Mon" high="26" low="17" text="Mostly Sunny"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="34" date="16 Aug 2016" day="Tue" high="26" low="18" text="Mostly Sunny"/>
<yweather:forecast xmlns:yweather="http://xml.weather.y....com/ns/rss/1.0" code="30" date="17 Aug 2016" day="Wed" high="25" low="17" text="Partly Cloudy"/>


In Topic: Translate weather information on skin

8 August 2016 - 11:25

I don't know python.

In yweather.py converter i see

 

        elif self.type == self.wtext:
            info = xweather['ytext']

 

I can add to py file something as

 

        if wtext == 'Sunny':
            return _('Soleggiato')
                    else:
            return wtext

 

But it don't work.