CreeperHost / Chickens

A Minecraft Mod
MIT License
5 stars 12 forks source link

[1.20.4] add the chicken egg localization #83

Open Litchiiiiii opened 3 months ago

Litchiiiiii commented 3 months ago

Hi!CreeperHost,I'm a member of the VM-Chinese-translate-group.I want to add the chicken egg localization,just modify some code.

The code in the net/creeperhost/chickens/item/ItemChickenEgg.java -------getName() method

String name = this.getType(itemStack).getEntityName().replace("_", " ") + " egg";
String first = name.substring(0, 1).toUpperCase();
String formatted = first + name.substring(1);
return Component.literal(formatted);     

modify to

 return Component.translatable("entity.chickens."+getType(itemStack).getEntityName()).append(Component.translatable("item.chickens.chicken_egg.egg"));

And add the

"item.chickens.chicken_egg.egg" : " egg"

To en_us.json

I would be grateful if you allow me to submit a PR.

nageih commented 3 months ago

Hardcode that can't be translated doesn't help mod propagation, and as a translator I'd like to improve this.