Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Retrieve Translations from Duolingo #61

Closed
JASchilz opened this issue Dec 4, 2022 · 4 comments
Closed

Unable to Retrieve Translations from Duolingo #61

JASchilz opened this issue Dec 4, 2022 · 4 comments

Comments

@JASchilz
Copy link
Owner

JASchilz commented Dec 4, 2022

Problem

This plugin can no longer automatically provide translations for users' vocabularies, because Duolingo has shut down the services that the plugin used to provide this feature.

At this time, my recommendation is for users to edit in the translations to their cards on their first review.

I recognize that:

  • while this is probably a fine workflow for users who are learning from Duolingo and making flash cards in small batches
  • it's probably a more difficult workflow for users who are importing a large number of vocabulary items from Duolingo.

Background

Around November 11th, 2022, Duolingo turned off the endpoint that the https://github.com/KartikTalwar/Duolingo library was using to provide translations. See KartikTalwar/Duolingo#125 for more information.

I maintain the AnkiSyncDuolingo plugin, but I am not myself an expert in communicating with the Duolingo servers. I've been relying on third party libraries and API documents to provide this functionality. However, in my searches so far no one has come up with alternate code or APIs to provide this functionality.

Possible Solutions

The following ideas aren't mutually exclusive.

Wait for someone to come up with an alternate way of getting translations from Duolingo.

I'll keep my eye on the linked issue in KartikTalwar's Duolingo library, and other similar projects. If someone comes up with a new way to retrieve translations from Duolingo, then I'll integrate it.

Use Another Service/API For Translations

This one doesn't look feasible to me. The reason that we were able to get translations from Duolingo is because we were relying on the customer/service relationship between the user and Duolingo: the user signed in with their account, and was getting translations from Duolingo based on their relationship with Duolingo.

From my light research, it seems like any other service that the plugin might use would require the user to sign up with a service and potentially pay money.

Just Drop Translation as a Feature

The plugin just might have to effectively drop translation as a feature, saying: "the plugin doesn't have a feasible means to provide translations; that's not a feature of the plugin."

Support User-Provided Tips/Workflows/Tools For Translation

Users might find other Anki plugins, workflows, tips, or tools that help them translate the cards that they import from Duolingo. This plugin could offer some means of sharing those tips/tools among the user community.

As a start, if any users have tips/tools for translating their cards, they can comment on this issue.

Next Steps

I will:

  • Release a new version of the plugin that can create cards from new vocabulary words without providing translations.
  • Draw attention in my release and documentation to this issue.
  • Wait another 3 months to see if other programmers have found a way to retrieve translations from Duolingo.
  • If after 3 months other programmers have not found a way to retrieve translations from Duolingo, I will:
    • Officially drop translations as a feature of this plugin.
    • Find a suitable way for the user community to share any workflow/tips/hints/tools they have found for adding translations.
@JASchilz JASchilz changed the title Unable to Retrieve Translations from Duoling Unable to Retrieve Translations from Duolingo Dec 4, 2022
@JASchilz JASchilz pinned this issue Dec 4, 2022
@rcw5
Copy link

rcw5 commented Dec 5, 2022

I've found a manual workaround using Google Translate. It's a bit of a hassle to set up, but the translations can be done in bulk so it's something you could run in batches maybe once or twice a week:

  1. Run AnkiSync to import new words into an empty deck
  2. Export the Notes (Notes -> Export Notes) as plain text
  3. In Excel, import the text file as UTF-8 encoded tab-separated data (via Data -> Get Data -> From Text)
  4. From here you now have a list of words which can be pasted into Google Translate in one go. Just select the entire column of words and paste into the website

image

  1. Review the Google Translate results. When happy, select all the translated words then paste them into Excel (replacing the entire "Provide the translation for..." column)
  2. Save the Excel file as a UTF-8 CSV file (from File -> Save As)
  3. Import into Anki via File -> Import, being sure to select Update existing notes with first field matches

After the import runs you should see a message indicating that x notes updated

There are a few gotchas here, especially around file encoding which can cause accents to get mangled either on export or import, but until a fully automated method is available this is much faster than translating everything manually.

@swa72
Copy link

swa72 commented Dec 9, 2022

@rcw5 actually https://ankiweb.net/shared/info/1536291224 does pretty much the same job (inside Anki) without Excel mess ;-)
Pull from duolingo, Install Google Translate extension, mark words and all translations are populated automagically.

@mattmartin89
Copy link

@rcw5 actually https://ankiweb.net/shared/info/1536291224 does pretty much the same job (inside Anki) without Excel mess ;-) Pull from duolingo, Install Google Translate extension, mark words and all translations are populated automagically.

Props to @rcw5 and @swa72 for this easy workaround. These are my Google Translate add-on settings for @swa72's method.

Screen Shot 2023-01-07 at 2 35 53 PM

@JASchilz
Copy link
Owner Author

JASchilz commented Jul 7, 2024

This is actually resolved by a recent fix for #76 .

@JASchilz JASchilz closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants