Resource Utilities - How to use the new component

Another option is how to make languages ​​in your application. You have a choice: phone system language, Russian, English, German. (as an example). After closing the application, the choice is saved, the next time you start the language will be the same.


Lang_test.aia (6.3 KB)

strings.json

{
“ru_string1”: “Привет, текст на русском”,
“en_string1”: “Hello, text in English”,
“de_string1”: “Hallo, deutscher Text”,
“ru_string2”: “Выберете язык:”,
“en_string2”: “Choose your language:”,
“de_string2”: “Wählen Sie Ihre Sprache:”
}

1 Like

I work much more efficiently, I will create aia and send it to you

With this method all you have to do is add the translation file to the application and this is:


translation.aia (35 .2 KB)
translation.apk (4 .8 MB)
(I created two translation files, one in English and one in Hebrew. If the language is not one of the two, the language you choose will be English)
I used this extension: App Inventor Extensions: File | Pura Vida Apps

2 Likes

I also created this topic that will explain a little better how to translate the application

Thanks, thanks to you I was able to significantly optimize the blocks. The application has remained the same: Choosing a language from the presented ones, writing to the memory of your choice. :star_struck: :star_struck: :star_struck: :+1:


Now the number of “* .json” files depends on the number of languages ​​in the application

1 Like

Thanks! Glad I helped you​:smiley:.
But you can still optimize your blocks

You make me look for new solutions in blocks) :upside_down_face: I optimized the blocks again and added functionality. Suddenly someone will come in handy. Now you can select the language as before, but if the system language is selected, and the application does not have translation lines, then the default language is English.

2 Likes

This can all happen automatically with my method, I simply rename the translation files to the language code of the translation file, then the application will automatically check if there is the translation file with the user’s language (the name of the translation file) and then the application will be translated into the received language (If the user’s language is not the language you will be given, it will be English). I explained it better here: How to effectively translate your application
If you still don’t understand, you can send me your aia and I did it for you

Whenever i run the code iam getting "THere was a problem to get the string

You should check your json file if the format is really valid.
I dont think it is because of the " inside your html text.

Check json with json validator search for online

Iam Not expert in Json.Can You Help Me How is It Possible

Just copy json and paste in this site and click validate json its shows it right or any error

Open new thread if you have any problem.
Keep clean this is guide

excellent example, I adapted my translation system to yours and it works perfect, only in one screen I eliminated 100 blocks, when changing from my algorithm to yours, before I used lists.

thanks to you Mika also for the guide and the resource.

1 Like

I’m glad my explanation helped you​:smiley:

1 Like

LINKS NOT WORKING RENEW LINKS

THANK YOU

:upside_down_face:

Which links are you talking about?
And I think everything is well-explained in the topic. You can easily implement it in your app if you follow the guide.

json and AIA files do not work

This string-resource is a good solution. But in About Screen I need multiple-line and \n is not working.
What is the line-breaker in json string?

Nice tutorial…