How to translate language from clicking from a list viewer?

How do you translate the language from clicking from a list viewer?

1 Like

Can you explain more clearly or give more details?

1 Like

So when the user clicks the list viewer item, it sets the language so users can translate from that language.

1 Like

See this demo project
https://x.thunkable.com/projectPage/60a013d7aed6ad0012a487bf

1 Like

Thanks @muneer but don’t really get what’s happening here.

1 Like

Tell me which part you want me to explain and I’ll try my best to make it clearer.

2 Likes

How does the objects and the list things work? I’m a noob, so I don’t know much.

1 Like

This block of the code is to make the list of available languages and once the user selects one the list becomes only the selected language

The InitializeLang function is to create the objects of all components that I want to have difference languages for and for each component it gives the the text is different languages.

Whenever the user selects another language from the list the function changeLang changes the text in the components to the text of the selected language.

This part of the object will store the selected language so that the next time the user uses the app it opens with the lastly selected language.
image

The object is a stored variable so it will be stored on the user’s phone and will not be deleted when the app is closed.

Hope this makes it clear.

2 Likes

WOW! Thanks a lot @muneer.

Hope you don’t mind me asking more questions.

1 Like

Ask whatever you want and I’ll try to answer whatever I know.

1 Like

Thanks

Hi @muneer,
What is the difference between set property and create object?

1 Like

The create object is used to create/construct a new object from scratch and assign keys (properties) to the object and optionally assign values to the properties.

The created object can then be saved as stored variable or in a table or in Firebase.

When it is the time to change the value of any property in the object you will use set property. Which is used for existing object to change/update the value of certain properties inside the object.

Thanks

1 Like

@muneer, what does this do?(from my project)

1 Like

I was just testing

1 Like

Not much.

When you select any item from the list this block will run and do the following:
If the variable Language is not yet assigned then it will create an object and assign it to the variable
Otherwise it will do nothing.

Please note that for the object to be created the first time you need to initialize the variable Language and assign it null.

1 Like

Oh ok. Thanks.

1 Like

But how do I make it function.

1 Like

Please explain better what you want so I can suggest you what to do.