Translator not working properly (in the emulator)

I got a translator over here with a list picker to pick languages and I got the code set up like so but every time I pick a language and translate on the emulator I always get "Error fetching translation". So what am I doing wrong?

1 Like

Translator is working OK here.

Simplify, and just test the Translator component (no listpicker, no TextToSpeech)

Check you have internet access

I tried it by simplifying and it works but the one I posted doesn't work.

How are you testing? AI2 emulator? I do not think texttospeech works there.

Text2Speech works on emulator for me but even the text box is saying "Error fetching translator"

This works OK for me on my chromebook

This code snippet works with Companion and a device. It does not work in the MIT emulator eliciting an error message.

It appears Translate does not work with the emulator (TextToSpeech.Speak does work but does not with get translation). Try using a real Android.


Is the error message something like this?

If so I will try on the device and get back.

The Speak says the words "Error setting (or fetching) translation " using the emulator but translates correctly on a device. :slight_smile: There isn't any error message on the code snippet I supply. The code needs the Label to be set to get translation, then it shows the message you display.

To translate to Spanish, the language code isn't Spanish but "es" (no quotes).

Yes I set that here.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.