Resource Utilities - How to use the new component

language
xml
json
resource
how-to-use
#1

Hello koders!
In this guide I will show you how to use the new resource utilities component which can be found in the “Utilieties” category.

The component is really easy to use. Create your own json file with all your strings. Upload it… DONE.

Okay… Maybe that’s a bit too fast.
The image below will show you all steps you need to do for a “perfect” solution.

strings.json (238 Bytes)
ResourceGuide.aia (2,6 KB)

The JSON file must have a valid format, like the following one

{
     	"de_string1": "Hallo",
     	"en_string1": "Hello",
     	"es_string1": "Hola",
     	"de_string2": "Welt!",
     	"en_string2": "World!",
     	"es_string2": "Mundo!"
}

The blocks:
Use this block if you want to use your resources from a file which is stored in the assets folder of your app.
blocks%20(1)
blocks%20(2)
Use this block if you want to use your resources from any file path like external storage or online file.

The ’resource Name’ is like in the example json file something like that:
de_string1 and the content of this resource is Hallo

blocks2

The ‘if Resource Not Found Use’ is nothing else as a default text which is later used if the block can not find the given ‘resource Name’.


Why should you use this component?
The main problem in app development is the static/fixed text for components like labels.
An English user will not understand German text, for example.

If the app developer provides more languages, it is easier to use a app outside of the country.


Have much fun with this new component!

22 Likes
Component String.xml can be used for multi language app?
Language String like Android Studio
Language selection when app starts
Change Language In Any App
[Multilanguage] What's the best method to build an app with different languages?
[Multilanguage] What's the best method to build an app with different languages?
#2

Nice tutorial. :+1:

2 Likes
(walya_express) #3

Nice …:blush:

1 Like
(Kleyber Derick) #4

Very good, @Mika

1 Like
(Cian) #5

All the information and detail needed to make a multilingual app.

Nice job Mika.

1 Like
(SVasco) #6

I’m getting this error:

The operation select list item cannot accept the arguments: , [There was a problem to get the string ‘pt_NothingFound’. Make sure on your side is all correct.], [2]

I follow the tutorial and I cant find the cause of this error!

Any help?

Note: I’m using Companion!

#7

Show the blocks you made and the strings.json file.

(SVasco) #8

6e98109653ff0d35b461d3b27e1924f8

1cc6545d54820bf0da56f9dfd446e170

#9

What if you use the blocks in the first post of this topic?

1 Like
(SVasco) #10

I made a test with the same blocks of the first post!
Don’t work either!

I also used the ResourceGuide.aia , and the same problem occurs!

(FábioESantos) #11

I don’t know if yours is the same case, but the first time I tried to use the component somehow I believed that I could use any name for the json file instead of strings.json, and then the procedure didn’t work until I used the correct file name.

1 Like