Gunpowder-MC / GunpowderUtilities

MIT License
3 stars 0 forks source link

Refactor with TranslatedText #16

Closed yhr0x43 closed 3 years ago

yhr0x43 commented 3 years ago

Referring to #92, translations support.

yhr0x43 commented 3 years ago

Yes, I have test this in the dev environment, can confirm all texts works so far. For translateTextForPlayer, there could be something like a sendMessage util function that combines translation and sending which takes one ServerPlayerEntity as argument, but I think just use what I have here is totally acceptable.

yhr0x43 commented 3 years ago

I just see that the tps command can benefit from using the translated support of Text builder. I will see what I can do with that.

yhr0x43 commented 3 years ago

tps localization finished. All current messages are tested working in the development environment. This is ready for review.

yhr0x43 commented 3 years ago

Both U.S. English and Chinese work when tested on a release fabric server. But for any other language it just sends the translation key out, is that intended? I have attached the result of running /tps with my client language set to en_us, zh_cn, en_gb 2021-03-06_22-35 2021-03-06_22-35_1 2021-03-06_22-36

Martmists-GH commented 3 years ago

But for any other language it just sends the translation key out, is that intended? It's supposed to default back to en_US, looks like that's a bug I'll have to fix in the framework.

Other than that it looks good to me, maybe @ItsIlya can review it as well.