I’m trying to add (actually override) the languages array with a new custom (italian-based) language for my mod. The problem is that seems not everything is translated (for istance, some of the pop ups likes Development stages).
Yes, but strange fact is that the language itself works quite well, but if I force the language of the game it will just “half-translate” the text. I think it’s because I force it “too late”. Maybe some objects are already set before running mod’s code
No it’s just a test because I need to change several texts in the game (italian language is actually only a “dummy” language). Anyway I need to force the game to english only.
For technical reasons languages are initialized before mods are loaded. Can you explain a little more what your goal and scenario is? Why are you trying to modify an existing translation?
We might be able to add support for mod-added translations.
I would love to change the Dev phases names and wanted to replace every instance of some words (likes “Training” or “Market”) with something else.
It would be much more clean to do that not by hard-coding that directly inside objects but with the localization mechanism that you created (which is a really powerful feature for modders).
Anyway, if you confirm that I’m not completely idiot but as a matter of fact the behavior of Languages is a bit more complicated then expected, I’m happy and can find an easy workaround
the reason why this doesn’t work currently is that part of the localization adjusts static html, which needs to happen right before the game code loads. By the time mods are loaded and other JS code is executed the HTML parts are already changed. this is the reason why you see some text translated while other parts don’t work.
possible but probably tedious using jQuery. I think it might be better to have separate custom language support, where you could drop in a file into a language folder and then select it through settings (would require a game restart though). we will discuss some options.