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

The hyphen used within boss bars for raids is untranslatable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20.2 Pre-release 1
    • 1.19, 22w24a, 1.19.1 Pre-release 1, 1.19.1 Pre-release 2, 1.19.1 Pre-release 5, 1.19.1 Release Candidate 2, 1.19.1, 1.19.2, 22w43a, 22w45a, 1.19.3, 1.19.4, 1.20.1
    • Community Consensus
    • Internationalisation
    • Low

      The Bug:

      The "-" symbol used within boss bars for raids is untranslatable and is missing a translation key.

      Steps to Reproduce:

      1. Attempt to search for the existence of this string by using this search filter on the official Minecraft crowdin project.
      2. Take note as to whether or not the hyphen used within boss bars for raids is untranslatable.

      Observed Behavior:

      The hyphen used within boss bars for raids is untranslatable.

      Expected Behavior:

      The hyphen used within boss bars for raids would be translatable.

      Code Analysis:

      Code analysis by Avoma can be found below.

      The following is based on a decompiled version of Minecraft 22w24a using Mojang mappings.

      net.minecraft.world.entity.raid.Raid.java
      public class Raid {
         ...
         private static final Component RAID_BAR_VICTORY_COMPONENT = RAID_NAME_COMPONENT.copy().append(" - ").append(VICTORY);
         private static final Component RAID_BAR_DEFEAT_COMPONENT = RAID_NAME_COMPONENT.copy().append(" - ").append(DEFEAT);
         ...
         public void tick() {
            ...
            if (this.status == RaidStatus.ONGOING) {
               ...
               if (this.ticksActive % 20L == 0L) {
                  ...
                  if (n2 > 0) {
                     if (n2 <= 2) {
                        this.raidEvent.setName(RAID_NAME_COMPONENT.copy().append(" - ").append(Component.translatable(RAIDERS_REMAINING, n2)));
                  } else {
                     ...

      If we look at the above class, we can see that the hyphen used within boss bars for raids is hardcoded, and as a result, is untranslatable. This is evident through the following pieces of code:

      ... append(" - ").append(VICTORY);
      ... append(" - ").append(DEFEAT);
      ... append(" - ").append(Component.translatable(RAIDERS_REMAINING, n2)));

            slicedlime [Mojang] slicedlime
            Avoma [Mod] Avoma
            Votes:
            5 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: