Attempt to get length of null array error message

Hello guys,

I an a fresh newbie on Kodular and just tried to create blocks to manage translations with json files.
While trying this, I get the “Attempt to get length of null array” error message :confused:

Can you help me please ?
Thanks in advance :slight_smile:

What is the name of your json file ? I believe in the first join block you should put TrekoRando- and not TrekoRando-fr-Tlanslation.json

Also I believe something is wrong in translate procedure , check here

1 Like

The name is “TrekoRando-fr-Translation.json”

Hi @Stefun Welcome to Kodular Community
Are you testing in Companion?
This error is because of FileListFromAssets method.

Are you testing on Companion?

Yes testing from companion
I put my “TrekoRando-fr-Translation.json” into Assets (but not sure how it works actually :sweat_smile:)

Actually, you are right I take the algorythm from this example. And in this example, strings are created with a concatenation of text and an integer. In my case just a string.

Inside my json file :
{ “label1”: “Kodular est magnifique !”, “label2”: “En plus c’est pas très compliqué :)” }

And the whole algorythm is here (I did a mistake while posting the first screenshot) :

Well, this method can not work in Companion
But you can make this method work in Companion here: How to effectively translate your application

Actually, this is from what I made my blocks :confused:
I just changed the way the Translate parameter is built (just a string in my case whereas a string concatenated to an integer, in the example you gave me).

Can you send the translation file?

Yes sure, here it is :
TrekoRando-fr-Translation.zip (238 Bytes)

I have made it manually :innocent:

Some methods of TaifunFile does not work in Companion.

I found the problem, you need to delete it (what is marked in yellow)


-Leave only: TrekoRando

1 Like

This is what I said @Point :slight_smile:

For some reason I did not notice it :thinking:

1 Like

Oops, i’m sorry, actually I changed this part to make some more simple tests (not constructing the filename), and forgot to changed it before posting the image.
The good image is here :

But unfortunatelly, it still leads to the same error message :pensive:

I noticed you sent here a ZIP file containing the json file Did you add the ZIP file to the assets?

no of course, it is directly the .json file in the assets (zip was created to be allowed to upload it :wink:)

I don’t think you are interested in reading my posts.
Read it at least once and if it works then let me know.