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

The ellipsis used to truncate inputs within command syntax help is untranslatable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.18.1, 1.18.2 Release Candidate 1, 1.18.2, 1.19 Pre-release 1, 1.19, 22w24a, 1.19.1, 1.19.2, 22w43a, 22w45a, 1.19.3, 1.19.4, 1.20.1, 1.20.4, 23w51b
    • Confirmed
    • Internationalisation
    • Low
    • Platform

      The Bug:

      The "..." symbol that exists before truncated inputs within command syntax help is untranslatable and is missing a translation key.

      Every language has its own rules that it follows. This ranges from spelling words differently, to using different punctuation under certain circumstances. Throughout the game, different languages can have symbols translated differently, therefore leading me to believe that this is a valid internationalization problem. For example, take the "options.controls" translatable text component which reads "Controls..." in English (US), and "按鍵設定⋯⋯" in Chinese Traditional, Hong Kong. As you can see the periods/full stops used within the Chinese Traditional, Hong Kong translation are completely different from the ones used in the English (US) translation. With this piece of knowledge in mind, some languages may interpret the use of the "..." symbol differently.

      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 ellipsis used to truncate inputs within command syntax help is untranslatable.

      Observed Behavior:

      The ellipsis used to truncate inputs within command syntax help is untranslatable.

      Expected Behavior:

      The ellipsis used to truncate inputs within command syntax help would be translatable.

      Code Analysis:

      Code analysis by Avoma can be found below.

      The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.

      net.minecraft.commands.Commands.java
      public class Commands {
         ...
         public int performCommand(CommandSourceStack $css, String $s) {
            ...
            try {
               try {
                  return this.dispatcher.execute(stringreader, $css);
               } catch (CommandRuntimeException commandruntimeexception) {
                  ...
               } catch (CommandSyntaxException commandsyntaxexception) {
                  ...
                  if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
                     int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
                     MutableComponent mutablecomponent1 = (new TextComponent("")).withStyle(ChatFormatting.GRAY).withStyle((p_82134_) -> {
                        return p_82134_.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, $s));
                     });
                     if (j > 10) {
                        mutablecomponent1.append("...");
                     }
                     ...

      If we look at the above class, we can see that the ellipsis used to truncate inputs within command syntax help is hardcoded, and as a result, is untranslatable. This is evident through the following piece of code:

      append("...")

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

              Created:
              Updated:
              CHK: