How do you show language names but use language codes in ListPicker?

Yes, Text Box 2 is supposed to contain the text I want to translate. I was using another method, but the method in these images was advised to me by someone here, so I don't know if it's wrong or not. Do you advise me to remove Text Box 2 from the ListPicker AfterPicking list? Then what?

Brother, I copied the method as I was told. The entire translation block was copied from the person above, if you see it.

Thank you, brother. Your method is the only one that worked out of all the methods that people gave me here. However, a simple problem occurred, which is that the translation happens automatically when I choose the language from the list. However, I want to make a dedicated button for translation, and when I click on it, it translates. With your method, I don’t know how. Can you tell me?

This is what happens when you don't rename components in the Designer to name their purpose:
https://www.google.com/search?q=three+stooges+drink+paint&ie=UTF-8#fpstate=ive&vld=cid:1c6660cb,vid:iVw4yM-MxUU,st:0

The cups are your text boxes.

Even a Power User can be fooled into drinking paint if the cup isn't labelled.

Hey my friend just one question to end the problem I am very sorry to bother you, I tried another method and it actually worked but it has one problem which is that the translation only happens when you click on the languages list and choose the language automatically and I do not want this I want it only when the person clicks on a button dedicated to translation and I do not know how to do it in this way of blocks I will send you a picture specifying which blocks + I learned later that this happens because the translation block is in the ListPicker and I removed


it

image

The whole purpose of the List Picker is to set the circled global variable to the proper code for when the translation is requested.

So what do I put inside ListPicker, You're telling me to put something and I don't understand. I'm so sorry I really bothered you a lot today

Like so ?

To be honest, you don't actually have to do anything in the afterPicking event, you could just use ListPicker1.Selection as thing in the Button2.Click event.

and for using a Dictionary:

Hello, I tried your modification in the method above, which is not the dictionary method, and it did not work despite your modifications. I am sorry for bothering you all day and asking a lot of questions, and I do not know if I am the problem or what? But you can not respond to me, as I asked you a lot all day and bothered you as well, so you can not respond to me. Thank you.


It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thank you, I work on a phone, not a computer. These are all the blocks I use in this application.



Here is your first error... you got confused about your variable names. . A better name for Languages would be listLanguages so you already can see in the variable name that it is a list

Taifun

And here is you second error... again a variable confusion...

Why not using Listpicker1.Selectionindex to get the index instead? No need to use the index in list block...

Taifun

What should I remove and add here? I understand that it is a mistake, but what should be removed and replaced?

Well, it looks like you do not really understand what you are doing...in this case it is a good idea to go one step back and do the tutorials

Unfortunately I do not understand what you are talking about. Are you talking about error 1 or 2?

Try this:

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Our Tutorials! to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

I know that I am a beginner, but my time is limited and I want to finish this project very quickly. I do not have time to learn from scratch. I am forced to do this because I am a student. I mean the second mistake. What am I supposed to do، and thank you for your advice and response to me .

Listpicker1 SelectionIndex is already the index you are looking for, isn't it?

Taifun

Yes

There are important life skills to be learned from coding...

  • How to anticipate the results of your actions
  • The habit of reading what you wright with a critical eye
  • How to expect the unexpected
  • How to see patterns of connection

Do not waste this opportunity.

1 Like