How to localization text-box
Posted: Fri Feb 23, 2018 1:42 pm
I would like the text for text-box to be stored in file ru.cfg which is located in the sceanario folder myScenario\locale\ru\ru.cfg
File contents ru.cfg:
events.on_player_created play this function:
And I get this error
When local info-text = "hello" That it works as it should. But how do I localize this text?
File contents ru.cfg:
Code: Select all
[msg]
plase=hello
Code: Select all
function try(player)
local infotext = {"msg.plase"} --What's wrong with this?
local frame = player.gui.center.add { type = "frame", name = "info_panel"}
frame.style.top_padding = 10
frame.style.left_padding = 10
frame.style.right_padding = 700
frame.style.bottom_padding = 10
local info_table = frame.add { type = "table", column_count = 1, name = "info_table" }
local text_box = info_table.add { type = "text-box", text = infotext, name = "text_box" }
text_box.read_only = true
text_box.selectable = true
text_box.word_wrap = false
text_box.style.right_padding = 100
text_box.style.top_padding = 0
text_box.style.left_padding = 0
text_box.style.bottom_padding = 0
end