Hi there^^ I want to make an Mod which include all completed translations - but for this i need a if function and i dont know if this will works …
so my idea is to check the user_settings for which language is activate and then use the following overrides (is needed because of different fonts and files)
so my idea was
var json = $.getJSON(“user_settings.json”),
if “language” = “de-De” {
“overrides” :{ …
}
}
if “language” = ru-Ru { …
I don’t think you can use an if statement in json. It’s just a data format. It’s not code in any way.
Also, why do you need it? As long as you have all the language files in the one mod and correctly linked in the manifest, you’ll be able to select any of the languages from in game as you like. Are there a few words here and there that are not fully internationalized? In that case it seems better to just get those bits fixed.
I’m not sure how it’s done, but the only way to set up some conditional overrides would be in the code that reads the json files. Either in lua or the c++ that does that job. That seems really intrusive for a translation mod.
If you need to define the font to use with a specific translation, than that seems best served as a feature request. Being able to do something like “font” : “fonts/my_font” at the start of a translation file instead of having to directly override the games standard font would be nice right?
What other files would you need to override based on which language it is?