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
Can you help me please ?
Thanks in advance
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
Can you help me please ?
Thanks in advance
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
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 )
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
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?
Some methods of TaifunFile does not work in Companion.
For some reason I did not notice it
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
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 )
I don’t think you are interested in reading my posts.
Read it at least once and if it works then let me know.