-
Bug
-
Resolution: Unresolved
-
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, 22w43a, 22w45a, 1.19.3, 1.19.4, 1.20.1, 1.20.2, 1.21
-
Confirmed
-
Internationalisation
-
Low
-
Platform
The Bug:
Units of statistics within the statistics menu, those being "km", "m", "cm", "y", "d", "h", "m", and "s", are all missing translation keys, therefore making them untranslatable.
Steps to Reproduce:
- Attempt to search for the existence of any of these strings by using the appropriate search filters on the official Minecraft crowdin project.
- Take note as to whether or not units of statistics within the statistics menu are untranslatable.
Observed Behavior:
Units of statistics within the statistics menu are untranslatable.
Expected Behavior:
Units of statistics within the statistics menu 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.stats.StatFormatter.java
public interface StatFormatter { ... public static final StatFormatter DISTANCE = n -> { ... if (d2 > 0.5) { return DECIMAL_FORMAT.format(d2) + " km"; } if (d > 0.5) { return DECIMAL_FORMAT.format(d) + " m"; } return n + " cm"; }; public static final StatFormatter TIME = n -> { ... if (d5 > 0.5) { return DECIMAL_FORMAT.format(d5) + " y"; } if (d4 > 0.5) { return DECIMAL_FORMAT.format(d4) + " d"; } if (d3 > 0.5) { return DECIMAL_FORMAT.format(d3) + " h"; } if (d2 > 0.5) { return DECIMAL_FORMAT.format(d2) + " m"; } return d + " s"; }; ...
If we look at the above class, we can see that units of statistics within the statistics menu are hardcoded, and as a result, are untranslatable.