Code Monkey home page Code Monkey logo

Comments (24)

Cabu avatar Cabu commented on June 11, 2024 1

See #142

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@SteniMariyaThomas
Hello friend, please give me more error information! Whether the version is 5.8.3 or not?
translators_20230919

from translators.

SteniMariyaThomas avatar SteniMariyaThomas commented on June 11, 2024

@UlionTse Yes the version is 5.8.3. Issue exists in previous version also

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@SteniMariyaThomas Try ts.get_languages('google'). Whether you made a high-frequency request, or first request shows error?

from translators.

ManuelSchneid3r avatar ManuelSchneid3r commented on June 11, 2024
>>> import translators as ts
>>> ts.get_languages('google')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.11/site-packages/translators/server.py", line 5204, in get_languages
    _ = self._test_translate(_ts=translator)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/translators/server.py", line 5188, in _test_translate
    result = self.translators_dict[_ts](
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/translators/server.py", line 104, in _wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/translators/server.py", line 261, in _wrapper
    return func(*args, **{**kwargs, **{'query_text': query_text}})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/translators/server.py", line 599, in google_api
    from_language, to_language = self.check_language(from_language, to_language, self.language_map, output_zh=self.output_zh)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/translators/server.py", line 174, in check_language
    raise TranslatorError('Unsupported to_language[{}] in {}.'.format(to_language, sorted(language_map.keys())))
translators.server.TranslatorError: Unsupported to_language[en] in [].

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@ManuelSchneid3r Bro, you should update version, v5.8.5 shouldn't show errors like yours.

from translators.

ManuelSchneid3r avatar ManuelSchneid3r commented on June 11, 2024
>>> ts.__version__
'5.8.5'
>>> ts.get_languages('google')
{'auto': 'en', 'zh-CN': 'en', 'en': 'zh-CN'}

from translators.

SteniMariyaThomas avatar SteniMariyaThomas commented on June 11, 2024

@SteniMariyaThomas Hello friend, please give me more error information! Whether the version is 5.8.3 or not? translators_20230919

Its 5.8.3

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@ManuelSchneid3r Why? Which country or region are you in? Is it because Google offers different services in different regions?
translators20230927

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@ManuelSchneid3r Can you send me your host_html about https://translate.google.com, my email is [email protected], thanks.

from translators.

SteniMariyaThomas avatar SteniMariyaThomas commented on June 11, 2024

@SteniMariyaThomas Try ts.get_languages('google'). Whether you made a high-frequency request, or first request shows error?

both cases

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@ManuelSchneid3r Why? Which country or region are you in? Is it because Google offers different services in different regions? translators20230927

@SteniMariyaThomas Same question.

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@ManuelSchneid3r Can you send me your host_html about https://translate.google.com, my email is [email protected], thanks.

@SteniMariyaThomas Both helps.

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@SteniMariyaThomas Try ts.get_languages('google'). Whether you made a high-frequency request, or first request shows error?

both cases

@ManuelSchneid3r high-frequency request, and you?

from translators.

ManuelSchneid3r avatar ManuelSchneid3r commented on June 11, 2024

Nope, single request from python shell

from translators.

ManuelSchneid3r avatar ManuelSchneid3r commented on June 11, 2024

@ManuelSchneid3r Can you send me your host_html about https://translate.google.com, my email is [email protected], thanks.

How can I obtain the host_html? You mean the website source code?

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@ManuelSchneid3r Can you send me your host_html about https://translate.google.com, my email is [email protected], thanks.

How can I obtain the host_html? You mean the website source code?

@ManuelSchneid3r Yeah.

from translators.

ManuelSchneid3r avatar ManuelSchneid3r commented on June 11, 2024

Google Übersetzer.html.zip

from translators.

ManuelSchneid3r avatar ManuelSchneid3r commented on June 11, 2024

btw bavaria backend was chosen (germany)

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@ManuelSchneid3r
Thanks for your html, bro.
But look at this, you can get_languages('google').
translators20230930v2

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

#142 Same reason?

from translators.

ManuelSchneid3r avatar ManuelSchneid3r commented on June 11, 2024

I dont know where the problem stems from, but its still …


>>> import translators as ts
>>> ts.__version__
'5.8.5'
>>> ts.get_languages('google')
{'auto': 'en', 'zh-CN': 'en', 'en': 'zh-CN'}

from translators.

UlionTse avatar UlionTse commented on June 11, 2024

@ManuelSchneid3r @Cabu Bros, please pip install --upgrade translators==5.8.6.

from translators.

ManuelSchneid3r avatar ManuelSchneid3r commented on June 11, 2024

works, ty 👍

from translators.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.