Good afternoon, at the moment I am trying to learn how to use the defglot module, but even looking at the example project I am not able to implement the work of the module in my own code. Please help me to find my mistake.
require "main.translations"
function init(self)
{...}
local defglot = require("defglot.defglot")
defglot.language = "en" -- if you do not define the language DefGlot will attempt to use OS lang
defglot.language_list.en = "en" -- add one or more langauges to in use language list
defglot.locale_data = "en" -- this is the locale data
defglot.init() -- you must init DefGlot so that it can ensure proper setup
defglot.set_text(gui.get_node("upgrade/text"), "UPGRADE")
If you don’t use GUI templates, you have to directly point to the text node. However, that also means you would need to uniquely name all text nodes if you have multiple.