Resource Utilities - How to use the new component

Just use the example aia. Install it on a real device. Test it
"I told you before , the tutorial cannot be downloaded by me (in Firefox and in Chrome).

I read the tutorial more than once but still it was not clear enough, otherwise I would not pose a question. And I have not read a warning about using it only in APK and not in development.
But thanks for the advice anyway.

1 Like

And is your json format valide?
I mean so you use “…” for text?

I try it myself again when I have time

I just replicated this project however, something is funky with it

Resources File From Path should accept this as apk
bild

ResourceUtilitiesTest.aia (4.3 KB)
strings.json (299 Bytes)

1 Like

I used " but a word processor editor changed it in “ and ”

With the TaifunTools extension this is my solution, you do not have to bother changing resource asset during development and with building apk.

I have tested it, both in companion and in apk. It works. :slight_smile:

1 Like

But still, path are broken and should be fixed

bild

1 Like

still 4 blok are broken . can anyone set it in aia file ?

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