Open 5HT2 opened 4 years ago
You might have already thought of this, but if it's easier to modify the Minecraft locale files, it might be better to splice into them and add community translations there. The I18n module already works pretty well.
I'd rather not do that. Preferably we would have a json file with the translation keys in the kami-blue/assets repository so it can be updated without updating the mod.
The only issue is with the current implementation of everything, most strings are hardcoded and I'm not sure how translation keys really work either, especially with users having the ability to rename modules.
I'll probably remove the module renaming functionality in the refactor/rewrite
branch to simplify things.
I would like to automatically detect the language based on Minecraft settings when you first start it up and then have the ability to manually changed it, once this is implemented.
Ah quite fair, that is better.
From what I can tell the translation keys are in the source language and are tied to strings which are prepared with StringFormatter in mind. The translators would probably need to be given a quick lesson or guide as to how string formatting works if we followed that method.
The minecraft implementation seems to load all key/value pairs for the current locale into a HashMap, so maybe something could be started there. It is a royal pain to update everything from hard coded strings though...
Yea. I assuming you would replace module names with like module.name.aura
and descriptions with module.description.aura
etc
I'm thinking we load the english translation into a hashmap, then we replace each key with the selected language if the key is available, so there's an English fallback language if it's not fully translated to the other language.
The code for that would only be like 1 for loop in kotlin, idk about java because java syntax is ew and why more verbose
I think the only hard part is initial implementation and actually replacing every single stupid string
It's also one for loop in java, but yes kotlin good as I've come to learn.
That implementation does seem very good, better than my own idea of having each translation locale start in english and change over time.
You could always just say any person who ports over more than 100/200+ strings competently gets a code 🐒 cape.
Hah yea. It would be a really annoying refactor.
Blocked by #790
This is something that would be very very long term, a way for people to translate the client as a community. Something like variables used in the GUI, which would turn into a String based on the current Minecraft language (obviously not rewriting the entire command system as well).
Maybe something to keep in mind for #790