PlayerEx

PlayerEx

5M Downloads

Missing lang file keys and gui is too small

elhertz opened this issue · 10 comments

commented

Hi.
I'm on the middle of translating your mod and as I tested my translation in-game I noticed a few problems:

  1. Some keys are missing:
    . "Max Health"
    . "Knockback Resistance"
    . "Attack Speed"
    . "Attack Damage"
    . "Armor"
    . "Armor Toughness"
    . "Luck"
    . "Speed"
    . "blocks/s"
    . a second "playerex.attribute.name.skill_points": "Skill Points" but for the tooltip that shows when hovering on "playerex.attribute.name.level": "Level"

I only noticed them because my game is in english (except for the last two ones).

And here's a ss but the client is in spanish. Another good reason to add those missing keys.
example1

  1. The GUI is too cramped. I wish you could add more space in between so things like this don't happen

example2

example3

I had to reduce the length of some lines and it looks really bad in spanish.

  1. This one is a suggestion;
    Add a lang file in the configs folder to enforce the same language on everyone using the modpack.
    Why? I want me and my friends to have a consistent language to talk about attributes and leveling stuff. That involves adding the missing keys I mentioned in (1).
    The spanish localization is awful. If you put 5 people from 5 different spanish speaking countries, you'll end up with 5 different translations for stuff.

Thanks.

commented

Hi there,
You've raised a few points here so I'll try to answer them as best I can:

1). What you've listed are vanilla attributes. For example: when displaying "Attack Speed" on the screen, it uses the Attack Speed attribute localisation provided by vanilla. This is implemented using:

EntityAttribute attribute = EntityAttributes.GENERIC_ATTACK_SPEED; // the attribute
Text text = new TranslatableText(attribute.getTranslationKey()); // the translated text

As you can see, the translation part here is performed by vanilla Minecraft. Now what I think you're actually asking is if I can provide dedicated translation keys seperate from the attribute localisation so that you can make a better fitting translation than the vanilla one? An example for this would be to add "gui.playerex.page.attributes.text.attack_speed". Please correct me if I'm mistaken here.

As for "blocks/s", this is part of "gui.playerex.page.attributes.tooltip.speed": "Movement: %s blocks/s". Do you want to split that translation into seperate pieces for "Movement: %s" and "blocks/s"?

Regarding the tooltip that is displayed when hovering over "Level": the tooltip is comprised of two components, as follows:

  1. "gui.playerex.page.attributes.tooltip.level[0]": "This is your player level. ",
    "gui.playerex.page.attributes.tooltip.level[1]": "It can be increased with xp.",
  2. +1 Skill Points

Point 2 is special; a piece of code loops over all functions associated with the level attribute and lists them on the tooltip. The actual translation is (once again) done by vanilla minecraft using the previous code example.

All the translation keys needed are present. If what you want is to create seperate playerex translation keys instead of the in-built vanilla attribute translation keys then let me know.

2). I appreciate that the gui is pretty small. I specifically wanted it to remain the same size as the survival inventory, and I designed it to work with english-sized words. There's no real easy fix here that I would be totally happy with. I could either make the container wider, or make the font smaller.

Let's say I did make the gui wider or make the font smaller. Next I'd have someone wanting to translate to german and requesting that the gui become even wider or the font even smaller. Or any language that has longer words, for that matter.

That's not to say that I don't want to accommodate my mod for other languages, I do. It's just that this one's a bit tricky to fix.
If you have a specific method in mind that would allow for the full spanish words, I'm all ears.

3). I can appreciate wanting this feature, but this is not really in the scope of this mod. I can totally see its usefulness, but honestly this should be a seperate mod.

Thanks again for writing up such a comprehensive issue request, I'll do my best to work with you towards a solution.

commented

Now what I think you're actually asking is if I can provide dedicated translation keys seperate from the attribute localisation so that you can make a better fitting translation than the vanilla one? An example for this would be to add "gui.playerex.page.attributes.text.attack_speed". Please correct me if I'm mistaken here.

Yes, that's exactly it.

As for "blocks/s", this is part of "gui.playerex.page.attributes.tooltip.speed": "Movement: %s blocks/s". Do you want to split that translation into seperate pieces for "Movement: %s" and "blocks/s"?

Yeah. I don't know what happened there honestly. My bad.

Point 2 is special; a piece of code loops over all functions associated with the level attribute and lists them on the tooltip. The actual translation is (once again) done by vanilla minecraft using the previous code example.

Wow I didn't know about that.
I forgot to explain why I needed something like that, sorry;
I can translate "Skill Points" to "Puntos de Hab." so it fits in the GUI but I wanted it to be "Puntos de Habilidad" when it was in the tooltip cause it wouldn't make sense to shorten "Habilidad" when it was in the tooltip, right? Well that's why I wanted a second "Skill Points" key.

All the translation keys needed are present. If what you want is to create seperate playerex translation keys instead of the in-built vanilla attribute translation keys then let me know.

I'd appreciate that very much. Just for the sake of consistency and also there are some vanilla keys that are too long for the gui.

That's not to say that I don't want to accommodate my mod for other languages, I do. It's just that this one's a bit tricky to fix.
If you have a specific method in mind that would allow for the full spanish words, I'm all ears.

I understand, it's alright. If it is too difficult then I can compromise.

3). I can appreciate wanting this feature, but this is not really in the scope of this mod. I can totally see its usefulness, but honestly this should be a seperate mod.

Oh I think you got me wrong here. I was talking about adding the lang files that are inside of the mod to the client's config folder. But know that I think about it maybe a setting like "language": "es_mx." would be better. What do you think about it?

I thank YOU for taking all my requests in consideration and also taking the time to write everything with so much info and details. I really appreciate that!
Regards.

commented

Those are vanilla attributes. You need to actually have spanish as your selected language in Minecraft when testing. I've just ran your translation with Español (México) and those attributes translated just fine.

commented

Is it possible to add a key for those attributes?

I'm quoting my own message here

Why? I want me and my friends to have a consistent language to talk about attributes and leveling stuff. That involves adding the missing keys I mentioned in (1).
The spanish localization is awful. If you put 5 people from 5 different spanish speaking countries, you'll end up with 5 different translations for stuff.

I understand if it can't be done. You've already did a lot, thanks!

commented

I'm not going to modify vanilla attribute's translation keys.

However, if it's just for you and your friends, there is a way you can add a datapack that will allow you to have your own translation keys for vanilla attributes:

Please see the Overrides section of Data Attributes. You can override vanilla attributes' translation keys using a serverside datapack, and then add the according translations with a clientside resourcepack.

commented

You always fix all my problems, amazing. Thanks!

commented

Hi again,
After some thinking, I've implemented a feature that lets the user change the size of the font, allowing for longer words.

This example shows some of the new text resizing. It can be squished any way, this should let you have longer words whilst allowing the user to individually make sure that nothing overlaps.

I've also made all the displayable text on both the attributes page and combat page have dedicated translation keys.

I'll hopefully be releasing these fixes, among others, fairly soon.

commented

Thats amazing! I'm looking forward to it!

commented

Hopefully fixed some of these concerns in the latest update, 3.0.3.

commented

Thank you!
I've tested my translation with the latest release and noticed that some tooltip attributes didn't get translated:

1
2
3
4