Units of statistics within the statistics menu are untranslatable
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 [Mod] 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.
2022-06-18, 04:02 PM
2024-12-09, 02:03 PM
6
3
-