The Bug
The dash / separator between the villager's profession and level is untranslatable in the trade GUI.
Among other things, this means resource packs are unable to alter this part of the interface. This is particularly jarring with packs that recolour text.
Expected Result
The dash / separator would be translatable.
Note:
Even better: "<profession> - <career level>" should be translatable (%s - %s), so that languages can change the word order and spacing if needed
Code analysis (tentative)
net.minecraft.client.gui.screens.inventory.MerchantScreen.java (Mojang mappings, 1.18, variable renaming)
...
private static final Component LEVEL_SEPARATOR = new TextComponent(" - ");
...
protected void renderLabels(PoseStack poseStack, int a, int b) {
int traderLevel = ((MerchantMenu)this.menu).getTraderLevel();
if (traderLevel > 0 && traderLevel <= 5 && ((MerchantMenu)this.menu).showProgressBar()) {
MutableComponent traderLabel = this.title.copy().append(LEVEL_SEPARATOR).append(new TranslatableComponent("merchant.level." + traderLevel));
...
}
...
}
...
LEVEL_SEPARATOR
should be a TranslatableComponent
instead of a hardcoded TextComponent
.
Linked issues
relates to 1
Attachments
Comments


What you mean with this issue?

I mean:
Most in-game text is "translatable", which is to say: There are text files (language files), which tell the game what word to put there. So if you set your language to Russian, the text in the screenshot would say "Картограф - Новичок" instead of "Cartographer - Novice". You can make your own language files for your own language if it isn't supported, or you just want to change a couple things. Maybe for a resource pack that changes hoes to scythes, you could change the translation to "wooden scythe". You can even change the colour in these files, so the text at the top of the trade GUI would look blue for example, instead of Grey.
Now the problem: "Cartographer" can be translated (just by changing "merchant.level.1" to whatever you want in the file), and "Novice" can be translated ("entity.minecraft.villager.cartographer"). The dash that separates them however, cannot be.
What this means: If for some reason, a language used hyphens diferently, they would be unable to change this part of the text. Furthermore, if you want to make the text in the trade UI green, there would be no way to change the hyphen, and it would say "Cartographer - Novice" (The colour thing can be important for resource packs that change the colour of this GUI, as dark grey might not be as visible.)

Can confirm.
Can confirm in 1.18.1.

Just a note for Mojang so that they can fix it properly: the complete string "<profession> - <career level>" should be translatable (%s - %s), so that languages can change the word order or spacing if needed. You might want to write that in the OP.
Can confirm in 1.19.
Can confirm in 1.19.2.
Would LOVE to see this fixed. You should probably reword this and say that the dash in the villager GUI is hardcoded