Localization (SOLVED)

Hi! How can I write to gui text node in non-english language(the one that’s sys.get_sys_info().language)? debugging with print(“ыаавв”) prints junk as well as gui.set_text(gui.get_node(“text4”), “ббббб”).

What charactera do you have in your font?

Here’s a test with the Gentium font that contains Cyrillic characters.

Font setup with “extra characters” set. Alternatively you can set “all_chars” to true but that will include everything from the TTF/OTF font. If you only need the Cyrillic alphabet it’s much more memory efficient to add the characters to “extra characters”.

GUI with the following code:

function init(self)
	gui.set_text(gui.get_node("text"), "ыааввббббб")
end

And the result:

5 Likes

Furthermore:

print("ыааввббббб")

This is my console:

Maybe you have a font set in the editor that does not support Cyrillic?

1 Like

Thank you a lot! I didn’t realize that extra_characters should be updated, I thought that having appropriate font wold be enough.

1 Like