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

Dash in villager/trader UI is hardcoded / untranslatable

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • 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
    • None
    • Plausible
    • Text

    Description

      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.

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cultist_o Kyle Cuthbert
            Votes:
            11 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              CHK: