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

The percentage symbol used within all volume sound sliders is untranslatable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • 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, 22w45a, 1.19.3, 1.19.4, 1.20.1
    • Community Consensus
    • Internationalisation
    • Low

      The Bug:

      The "%" symbol used within all volume sound sliders is untranslatable and is missing a translation key. Every other slider throughout the game has the "%" symbol correctly translatable, therefore introducing an inconsistency.

      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 percentage symbol used within all volume sound sliders is untranslatable.

      Observed Behavior:

      The percentage symbol used within all volume sound sliders is untranslatable.

      Expected Behavior:

      The percentage symbol used within all volume sound sliders 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.client.gui.components.VolumeSlider.java
      public class VolumeSlider extends AbstractOptionSliderButton {
         ...
         @Override
         protected void updateMessage() {
            Component component = (float)this.value == (float)this.getYImage(false) ? CommonComponents.OPTION_OFF : Component.literal((int)(this.value * 100.0) + "%");
            this.setMessage(Component.translatable("soundCategory." + this.source.getName()).append(": ").append(component));
         }
         ...

      If we look at the above class, we can see that the percentage symbol used within all volume sound sliders is hardcoded, and as a result, is untranslatable. This is evident through the following piece of code:

      ... (this.value * 100.0) + "%");

            Unassigned Unassigned
            Avoma [Mod] Avoma
            Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: