But there is a problem: Chinese and Japanese text cannot wrap correctly.
However, this issue can be worked around by manually inserting ‘\n’ in json file.
Or you can try the solutions below, but I do not recommend them.
I found the best solution is manually inserting ‘\n’ in json file, especially when you use defold-lang extension. Otherwise, it will not only waste a lot of time but also make the code logic much more complicated.
I found the best solution is manually inserting ‘\n’ in json file, especially when you use defold-lang extension. Otherwise, it will not only waste a lot of time but also make the code logic much more complicated.
Actually, I use GUI text in this example. But Chinese and Japanese text can’t wrap correctly, if I don’t insert ‘\n’. I put the text in a JSON file just to make multilingual translation and switching easier. In the end, it is still read from the JSON file and then set to the GUI text.