Closed muggy83 closed 3 years ago
Take a look into it. The provided solution is based on the in-game function, that the strings.lua file in the root directory is parsed and it´s return is interpreted accourding the game-setting of the language. The strings are then global variables in the context of the mod.
I don´t really get the problem fixed, why comboBox:addItem(_("arr_dep_i18n"))
works, but local sortAll = api.gui.comp.ToggleButton.new(api.gui.comp.TextView.new(_("all_i18n")))
not.
looks good so far, as you mentioned minor bug in the window header/tabs. Not sure about the translation "Unbeündelte Zeit" I suggest: "Abfahrts Intervall"or "Tackt Zeit"
Correct, "Unbunch" and "Unbunch Time" is one point we should discuss in German. Your suggestions are definitly better :-)
As I´m a noob to lua (and not an computer scientist, maybe you have an idea, why the the global variables are working in some cases, in some cases not. It reminds me of a problem I had many years ago in C++/CUDA, that some methods/funtions don´t allow variables but fixed stings. In parallel I try find an example in other mods, how they solved the problem.
I played around a little bit with your code and you are right, the function seems to behave very strangely..
It seems like the function returns different results depending on where its called.
I put some prints of the same key in different parts of the code and it gave me differently strings depending on where I put the print statements.
This at least shows that the keys are not the problem, rather where the location where the "" function is called
Defining the strings that are not working globally and using them later seems to solve the problem ;)
Oh really? I thought I have tested that as well. Can you give some lines of code as an example? Then I´ll fix it on my side.
local UIStrings = {
lines = _("lines_i18n"),
...
}
add this on line 21
and change this (Arround line 185):
menu.tabWidget:addTab(api.gui.comp.TextView.new(_("lines_i18n")), wrapper)
to
menu.tabWidget:addTab(api.gui.comp.TextView.new(UIStrings.lines), wrapper)
I added and fixed everything from my side and tested. It should be fine now!
I still got this: see cursor
Thanks, will have a look, might be due to merge conflicts I resolved on this
Also this one with develop branch.
Added i18n Stings in strings.lua Exchanged original strings with global i18n attributes Knows Bugs in the UI generation. Combobox works with internationalized string, the tables and the windows itself not yet.