client icon indicating copy to clipboard operation
client copied to clipboard

A way for the community to translate the client

Open 5HT2 opened this issue 4 years ago • 7 comments

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

  • [x] Regional decimal format in HUD stuff (mentioned in #1863)

5HT2 avatar May 09 '20 02:05 5HT2

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.

spide-r avatar Aug 15 '20 13:08 spide-r

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.

5HT2 avatar Aug 15 '20 13:08 5HT2

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...

spide-r avatar Aug 15 '20 14:08 spide-r

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

5HT2 avatar Aug 15 '20 14:08 5HT2

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.

spide-r avatar Aug 15 '20 14:08 spide-r

Hah yea. It would be a really annoying refactor.

5HT2 avatar Aug 15 '20 14:08 5HT2

Blocked by #790

5HT2 avatar Dec 29 '20 20:12 5HT2