I want to build a multilanguage app but i am facing issues

@TIMAI2
actually what i want in my app is that
i have created a screen "settings" and i want that when a user wants to change the language of the app they can chose the language from the spinner in the screen and it should translate the whole app at once
but the issue i am facing is that it changes the language of that screen only
i want that after changing the language in the settings the app should be in that language until it is changed again
i hope you are able to understand my issue and would help me to resolve it

@TIMAI2
i want to change the language of all screens just by selecting from one screen

Then do as Taifun suggested....

@TIMAI2
actually i am not clear with what Taifun said
it would be great if you could brief more about how to store language in TinyDB

Okay then look at this simple AIA I quickly made. Do make sure the namespace on the tinyDB is the same on both screens.

Translator.aia (3.9 KB)

1 Like

And here is a version that uses lists and the tinydb, so you have to do all the translations before hand, but then they are contained in the app, no need to call Yandex. I have done it in "longhand" so you can see what is going on, but this could be improved.

TranslateAcrossScreens.aia (6.9 KB)

2 Likes

@Xtendera & @TIMAI2
thank you !!

Hey!!
can anybody suggest me some ideas for my buttons
they look just like a picture :confused: :confused:
not giving a look of button
your ideas are most welcome :blush: :upside_down_face:

really need them :slightly_smiling_face:
it would be very great!!

@Xtendera and @TIMAI2
i did according to your code but i don't know where i am doing it wrong but it is not working :worried: :worried:
i applied it to two of my screens
Uploading: blocks (1).png...

@Xtendera
@TIMAI2
@Taifun

In your first set of blocks, your are trying to set a list of translations to labels. Yandex is returning a string that looks like a list, so this will not work. You will need a web component for the json text decode block to turn the string back into a list, like this:

In your second set of blocks you are trying to set the Visible property of the title with the translation.

image

Change your blocks!

@TIMAI2
hey!i have made /the changes but it is not working

Not very helpful.....

Try using DO IT to see what IS working and where it breaks.
Run through your blocks from start to finish to find the problem.

Worst case, post an aia project here.

I am concerned that excessive use of Yandex may cause you problems, therefore if you have a fixed list of translations the method I provided, or one like it, may be a better option in the long run.

@TIMAI2
now i am totally confused and i don't have much time as i am doing it for a competition and the submission date is nearing
i might have made some silly mistakes in the coding as i am just a beginner
therefore i am sharing the .aia file
but i don't want to share it publicly so can i send you personally?

You have been provided with two working examples in previous posts. Look again at how they work.

Simplify, do the translation for just one thing, on one screen, and get that working, then you can develop on from there.


@TIMAI2
here i am doing it for one label only but it is not working :sweat_smile: :slightly_frowning_face: