Pass text to Google Translate app or bypass app and go to browser

196 Views Asked by At

I'm creating a language deck in Anki where I have added a link to Google translate so that the user will get the sentence being learned translated into their language of choice.

On desktop, the link opens fine and the target language is automatically selected based on the last time Google Translate website was used. However, on Ankidroid the Google Translate app opens instead. That would be fine as well, but it's not working properly, since the sentence is not being used as input for the translation, and I only get the app open, but blank.

I'm using this:

<a href="https://translate.google.com/?sl=en&text={{text:Sentence}}">

But when the app opens it doesn't take the text from the Anki field as a query. I also tried using DeepL instead, since not having the app would open the browser directly, but it seems when I leave the target language blank in the URL it defaults to English, instead of using the user's default or device language.

Does anyone know of a way to either, using Google Translate, open the app and automatically get the text translated or to bypass the app so that it opens in the default web browser and works as a normal URL? Or to use DeepL and make it automatically choose the target language?

I know I could disable "open supported links" on the android settings to avoid the app opening Google Translate, but the people who are going to use the deck are mostly not able to do this on their own, so I need a different solution.

Thanks in advance!

(I'm on latest AD and Android 13)

0

There are 0 best solutions below