Translation Error - Invalid Parameter: Text

I’m pretty new to Thunkable and I’ve been going through David Wolber’s book on it and doing the lessons. I’m working on a translation app. Basically, it is supposed to work by you speaking into the phone and it will translate what you say on the fly into Spanish and then display it on the screen. If you say the word “cat” or “dog”, it is supposed to display a picture of a cat or dog on the screen too.

I’ve laid out the blocks as in the book and gone through them repeatedly, but I can’t get the program to function properly. Sometimes the translation works. Other times, it returns at error that reads “Invalid parameter: text”. And I don’t seem to be able to get the pictures to load under any circumstances. You can find the project here: Thunkable

I’ve done enough reading to know that some people have had trouble with the Yandex API key working but I’m really not sure if that’s the problem here since I don’t seem to be able to duplicate the issue with any consistency. Any help would be much appreciated.

Thank you in advance.

Hi @jim.malmberg38, welcome to Thunkable!

When I check the value of the green error block, I get this result about 1/4 of the time I speak a word or phrase:

1110/The operation couldn't be completed.
(kAFAssistantErrorDomain error 1110.)

I’m not sure what that error means and I haven’t found anything online about it. My best guess is that that error is returned when there is no sound detected. Hopefully, someone else will read this and have an idea about how to resolve it.

1 Like

Thank you for taking a look. Really appreciate it. I’m just not able to duplicate the error with any consistency. The only thing that seems to be consistent is that the pictures won’t load, and I really don’t understand that.

The images aren’t working because you’re setting the TranslateLabel to the green result block value but you’re then checking the EnglishLabel’s text to see if it matches the picture you want. You need to use the same label for both.

Another way to do this is to use the partial result block as follows (this does show the images for me):

I realize, I messed up the translated work display in that screenshot so you’ll have to adjust it for what you need.

2 Likes

Thanks for your help on this. I really appreciate it.

I do see what you mean on the pictures. Correct me if I’m wrong here but my take-away on this is that when I’m doing something like this, the block that I’m checking needs to be referenced with a block of the same type… meaning that if I’m checking the “partial result” that’s what I have to look at rather than the label that is displaying the “partial result”. Is that correct?

I’m still getting an error though when I say the word “cat” that I don’t understand. When I say “dog” the picture shows up just fine, But when I say “cat”, this is what I get.

I’ve done some more experimenting around with this and here is what I’ve run into. Hoping you can point me in the right direction here.

As I said in the last post, when I say “dog”, the picture loads, but it isn’t consistent. Sometimes it will also give me the invalid parameter screen. When I say “cat”, it always gives me the invalid parameter screen.

I’ve tried rearranging the blocks so that the blocks responsible for “cat” are on top of those for “dog” but the results are the same.

But if I do a longer sentence that includes the word “cat”, it seems to translate just fine.

I also tried setting up the blocks a little differently, with if, else if, else, where the final else made the picture invisible. That didn’t work for either the cat or the dog.

I’m wondering if this is an issue with the Yandex translator rather than the blocks themselves. Any thoughts? I don’t want to get stuck on this if it isn’t something I can fix, but if it is something I’m doing, I want to understand it.

Thanks!

Can you post a new link to your project?

Here it is: Thunkable

I think I figured out what the issue is. It seems like if I speak the word “cat” too quickly, it doesn’t recognize the word and returns the “invalid parameter” screen. But if I take my time pronouncing the word, it works.