question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

get_translations is not working

See original GitHub issue

When I am passing a list with source and target it shows:

Traceback (most recent call last):
  File "/home/shafquat/DuolingoWordList/venv/lib/python3.7/site-packages/duolingo.py", line 230, in get_translations
    return request.json()
  File "/home/shafquat/DuolingoWordList/venv/lib/python3.7/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "get_vocab.py", line 15, in <module>
    meaning = lingo.get_translations(wordstrings, source='ar', target='en')
  File "/home/shafquat/DuolingoWordList/venv/lib/python3.7/site-packages/duolingo.py", line 232, in get_translations
    raise Exception('Could not get translations')
Exception: Could not get translations

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
SpangleLabscommented, Jan 29, 2020

It’s still working on my branch [which is in PR]: https://travis-ci.org/joshcoales/Duolingo/builds/639460517 Have you provided both a username and password to the Duolingo constructor? It no longer works with just username

EDIT: oh, just seen your message in another thread, which implies you will have given password. That’s odd then.

0reactions
SpangleLabscommented, Oct 22, 2020

Fixed in 0.5.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngx-translate's getTranslation function doesn't listen to ...
The problem is, that getTranslation doesn't seem to update the Observable on translations.next() and continues using the translations that ...
Read more >
this.currentLoader.getTranslation is not a function #186 - GitHub
I'm trying to familiarize myself with this package. I loaded ng2-translate with the code available in the documentation with some changes ...
Read more >
ngx-translate Documentation - CodeAndWeb
This invokes the current loader to retrieve the translations if the language is not yet loaded. Calling use uses the loader to retrieve...
Read more >
How to translate your Angular app with ngx-translate
1. Add ngx-translate to your Angular application 2. Set up the TranslateService in your app.module.ts 3. Create your main language translation file (in...
Read more >
getTranslation() should throw an exception when an ... - Drupal
Problem/Motivation ContentEntityInterface::getTranslation() returns a new translation if the specified language is valid but there's no ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found