python-weather icon indicating copy to clipboard operation
python-weather copied to clipboard

weather.current.sky_text languages

Open Fantantonio opened this issue 3 years ago • 5 comments

Is it possible to change the sky_text language output? I was thinking that maybe is a feature of the API the library is utilizing and could be a great improvement if not yet implemented.

As for now I am translating to italian the result with "googletrans":

from googletrans import Translator
...
translator = Translator()
translator.translate(weather.current.sky_text, dest="it", src="en").text

A built in way to get directly the translated words would be much better

Fantantonio avatar Jul 20 '21 19:07 Fantantonio

Is it possible to change the sky_text language output? I was thinking that maybe is a feature of the API the library is utilizing and could be a great improvement if not yet implemented.

As for now I am translating to italian the result with "googletrans":

from googletrans import Translator
...
translator = Translator()
translator.translate(weather.current.sky_text, dest="it", src="en").text

A built in way to get directly the translated words would be much better

Not work for me :(

Magnarks avatar Aug 24 '21 01:08 Magnarks

Not work for me :(

At least explain what the problem is... If it's something due to googletrans package you should open an issue on that repo

Fantantonio avatar Aug 24 '21 06:08 Fantantonio

@Magnarks that kind of problem should work by reinstalling googletrans with pip install googletrans==4.0.0-rc1

feel free to read this stackoverflow post: https://stackoverflow.com/questions/52455774/googletrans-stopped-working-with-error-nonetype-object-has-no-attribute-group

null8626 avatar Aug 25 '21 01:08 null8626

Not work for me :(

At least explain what the problem is... If it's something due to googletrans package you should open an issue on that repo

@Magnarks that kind of problem should work by reinstalling googletrans with pip install googletrans==4.0.0-rc1

feel free to read this stackoverflow post: https://stackoverflow.com/questions/52455774/googletrans-stopped-working-with-error-nonetype-object-has-no-attribute-group

Ok i try install again googletrans but i have the same problem, is this

Traceback (most recent call last): File "c:\Users\diego\Documents\Python\AsistentedeVoz.py", line 188, in bucle.run_until_complete(Clima()) File "C:\Users\diego\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "c:\Users\diego\Documents\Python\AsistentedeVoz.py", line 100, in Clima traducir.translate(text=clima.current.sky_text, dest="es", src="en").text File "C:\Users\diego\AppData\Local\Programs\Python\Python39\lib\site-packages\googletrans\client.py", line 222, in translate translated_parts = list(map(lambda part: TranslatedPart(part[0], part[1] if len(part) >= 2 else []), parsed[1][0][0][5])) TypeError: 'NoneType' object is not iterable Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x000001767953A1F0> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x0000017678EF0760>, 186910.015)]'] connector: <aiohttp.connector.TCPConnector object at 0x000001767953A460>

Magnarks avatar Aug 25 '21 01:08 Magnarks

It may be related to this issue: https://github.com/ssut/py-googletrans/issues/278

This is something you should ask in the relative GitHub repo! You'll have replies from people that work on that package and you would help them to make it better.

Fantantonio avatar Aug 25 '21 07:08 Fantantonio