Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-177172

Dash in villager/trader UI is hardcoded / untranslatable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20.2 Pre-release 1
    • 1.15.2, 20w14a, 20w15a, 20w16a, 20w17a, 20w18a, 20w19a, 20w20a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 4, 1.16 Pre-release 5, 1.16 Pre-release 6, 1.16 Pre-release 7, 1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 21w05a, 21w06a, 21w07a, 21w08a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w16a, 21w17a, 21w18a, 21w19a, 21w20a, 1.17 Pre-release 1, 1.17 Pre-release 2, 1.17 Pre-release 3, 1.17 Pre-release 4, 1.17 Release Candidate 1, 1.17, 1.17.1 Pre-release 1, 1.17.1 Pre-release 2, 1.17.1 Pre-release 3, 21w37a, 21w38a, 21w40a, 21w41a, 21w42a, 21w43a, 21w44a, 1.18 Pre-release 1, 1.18 Pre-release 4, 1.18 Release Candidate 3, 1.18, 1.18.1 Release Candidate 2, 1.18.1, 22w03a, 22w05a, 22w06a, 22w07a, 1.18.2 Pre-release 2, 1.18.2 Pre-release 3, 1.18.2 Release Candidate 1, 1.18.2, 22w11a, 22w13a, 22w15a, 22w17a, 22w18a, 22w19a, 1.19 Pre-release 1, 1.19 Pre-release 2, 1.19 Pre-release 3, 1.19, 1.19.1 Pre-release 2, 1.19.1 Release Candidate 2, 1.19.2, 22w44a, 1.19.4 Pre-release 3, 1.19.4, 23w12a, 23w13a, 23w18a, 1.20 Pre-release 1, 1.20 Pre-release 4, 1.20 Pre-release 5, 1.20 Pre-release 6, 1.20 Pre-release 7, 1.20 Release Candidate 1, 1.20, 1.20.1 Release Candidate 1, 1.20.1, 23w31a, 23w32a, 23w33a
    • Confirmed
    • Internationalisation, Text
    • Low

      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.

            slicedlime [Mojang] slicedlime
            cultist_o Kyle Cuthbert
            Votes:
            18 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: