Skip to content

weather.current.sky_text languages #13

Description

@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

Activity

  1. Magnarks commented on Aug 24, 2021

    @Magnarks

    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 :(

  2. Fantantonio commented on Aug 24, 2021

    @Fantantonio
    Author

    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

  3. null8626 commented on Aug 25, 2021

    @null8626
    Owner

    @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

  4. Magnarks commented on Aug 25, 2021

    @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

    @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>

  5. Fantantonio commented on Aug 25, 2021

    @Fantantonio
    Author

    It may be related to this issue: ssut/py-googletrans#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions