How to add Google Translate to ANKI

Werner Krag's Avatar

Werner Krag

27 Jun, 2020 12:33 PM

Hi there,
I would like to add GOOGLE TRANSLATE (speech / pronounciation only) to my Spanish ANKI deck.
What is the proper way to do this?
I know it is "somehow" TTS but can't seem to get it working properly.
I am on ANKI 2.19.

Thanks.
Werner

  1. 1 Posted by kelciour on 28 Jun, 2020 02:27 PM

    kelciour's Avatar

    Either install the AwesomeTTS add-on or gTTS add-on - https://ankiweb.net/shared/info/391644525

    But since you're on Anki 2.1.19, the only option is AwesomeTTS, either with on-the-fly playback or from the card browser.

  2. 2 Posted by Werner Krag on 28 Jun, 2020 03:11 PM

    Werner Krag's Avatar

    Thank you for your answer.
    I appreciate it.

    I installed awesome TTS.
    I have my Spanish on the backside of all cards (front side is German (my
    native tongue).
    Selected "backside" on the appearing menu for TTS.

    BUT: the pronounciation is awful. It does not sound like Spanish at all.
    It sounds like German.
    Is there a better solution?

    Thanks.

    Werner

    On 28.06.2020 16:27, kelciour wrote:

  3. 3 Posted by Werner Krag on 28 Jun, 2020 03:25 PM

    Werner Krag's Avatar

    I got to work now. I needed to select the SPANISH pronoounciation.
    It is working with good pronounciation now.

    BUT: Some cards DO play the sound, some not.
    Do I need to add awsome TTS to every single card or can I have that as a
    general rule for all cards (backside)?

    Thanks.

    Werner

    On 28.06.2020 17:11, Werner Krag wrote:

  4. 4 Posted by kelciour on 28 Jun, 2020 03:49 PM

    kelciour's Avatar

    If you used the add-on from the card browser to batch generate the audio files and there were no errors, maybe the field that contains the audio wasn't added to the card template.

    1. Edit the card and check that the field contains [sound:...] tag.
    2. Click Cards... button to open the card template and check that the same field can be found in the Front or Back Template. And, if necessary, add it by typing {{Field Name}} or using Add Field button.
  5. 5 Posted by Werner Krag on 30 Jun, 2020 08:18 AM

    Werner Krag's Avatar

    It is working now, BUT:

    every time a card is produced, it is adding the text of the backside of
    the card again.
    In other words:
    Every time I review a card, the sound is played (good) but the text of
    the card is somehow added again.
    Therefore a card after reviewing it several times, looks like this:

    Hola, que tal?
    Hola, que tal?
    Hola, que tal?

    and so forth.

    On 28.06.2020 17:49, kelciour wrote:

  6. 6 Posted by kelciour on 30 Jun, 2020 09:11 AM

    kelciour's Avatar

    Can you show the card template window?

    If the same text appeared only a few times, it'd be easy to solve by removing extra {{Field}} from the card template, i.e. something similar to https://anki.tenderapp.com/kb/problems/extra-characters-appearing-o..., but I guess this case is different since the text is being dinamically added on every review.

    Maybe there's another add-on that is buggy but I'm not aware of any add-ons that can produce such results.

    Long story short, it might be easier to solve if I could see the card template.

  7. 7 Posted by Werner Krag on 05 Jul, 2020 01:26 PM

    Werner Krag's Avatar

    Thank you for your help.
    Sorry, I am late to answer but I was out of town.

    Well, I still can't get it to do what I want.

    The front side is no problem, I am just giving the German sentence.
    The back side is more complicated:

    I have the Spanish translation, BUT also sometimes remarks to help me
    remember the word(s) or a sentence.
    This could be a mnemonic, a little story or just another word to help me
    remember.

    Therefore would I would like to do is something like this:
    -----------------------------------------------
    Front: Heute ist das Wetter gut

    Back: Hoy, hace buen tiempo.
    Remarks: "Tiempo" = Wetter oder Zeit
    ------------------------------------------------
    The last line will give me some additional hints for learning.
    Sometimes this will be just one line, sometimes 2 or more lines (if it
    is a story)

    Naturally, I ONLY want the pronunciation of the first line of the
    backside: "Hoy hace buen tiempo".

    Can this be done?

    Thanks.

    Werner

    On 30.06.2020 11:11, kelciour wrote:

  8. 8 Posted by kelciour on 05 Jul, 2020 04:48 PM

    kelciour's Avatar

    Yes, this can be done.

    1. It's not clear from the message, maybe the field already exists, but in addition to the Front and Back field create a new field called "Remarks".

    2. Update the card template and add {{Remarks}} to the Back Template.

    3. Use the card browser to browse through all your notes and manually cut remarks from the Back field and paste them in the Remarks field.

    This way the Back field and pronunciation won't contain remarks, but remarks will be still visible on the card template.

    I've attached two pictures for the first two steps.

    It might be possible to split the Back field automatically by the first line, but it's complicated. Without looking at the notes and the underlying HTML, I can only provide a general solution, that might work for some notes or not work at all. It'll be in the next message.

  9. 9 Posted by kelciour on 05 Jul, 2020 05:59 PM

    kelciour's Avatar

    To try to split the Back field automatically

    1. Try the script in a new Anki profile at first.

      1.1. File - Export to export your entire collection

      https://docs.ankiweb.net/#/files?id=backups

      1.2. File - Switch Profile - create a new profile and import your exported collection.

    2. Press Ctrl + Shift + J or (Cmd + Shift + J on Mac) to open the Debug Console.

      https://docs.ankiweb.net/#/misc?id=debug-console

    3. Copy-paste the whole text file from the link in the Debug Console.

      https://gist.githubusercontent.com/kelciour/e3cd14d3dbca122482249c8...

    4. Open the card browser and search for notes that you want to be processed by the script, for example, by clicking on a deck.

    5. Copy the search string from the card browser, go back to the Debug Console and paste it in BROWSER_SEARCH_QUERY instead of deck:Default.

    6. Press Ctrl+Enter or Cmd+Enter to run the script.

    The script will create 2 new fields, one for the copy of the Back field and one for the new field with the remarks, then will try to split the Back field. After it's finished working, maybe in a few seconds, go back to the card browser and check a few notes. If it's okay, rerun the script in your main Anki profile.

  10. 10 Posted by Werner Krag on 05 Jul, 2020 09:17 PM

    Werner Krag's Avatar

    Thanks a lot!
    i will try this now.

    Werner

    On 05.07.2020 18:48, kelciour wrote:

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac