SHsuperCM / CITResewn

Fabric implementation of mcpatcher's cit
MIT License
146 stars 72 forks source link

[Help Needed] Translatable names #356

Closed Disketaa closed 5 months ago

Disketaa commented 7 months ago

Hi! Is there a way to set a localized string to an item name in CIT Resewn?

image Something like this ^

SHsuperCM commented 7 months ago

Does what you had not work? also, send logs just in case there might be an error.

Disketaa commented 7 months ago

image

SHsuperCM commented 7 months ago

Look at the item's nbt and make sure it uses a translatable component, just naming an it "Apple" in an anvil will only change the text to apple, it wont translate after

Disketaa commented 7 months ago

image image

SHsuperCM commented 7 months ago

Interesting, does this work?

nbt.display.Name=[{"translate": "entity.minecraft.cat"}]
Disketaa commented 7 months ago

Yeah, that is working! Thanks a lot! 🔥 But given item with "italic": false or "color": "red" params also should be matched in cit properties Can it somehow be optimized with ** or regex to make it multi-color

image

SHsuperCM commented 5 months ago

Closing as this appears to be resolved but definitely. You should be able to match with a regex and target the translatable component. Check the docs for how to match regex.