mojira.dev
MC-248847

The comma used to list colors within firework star item tooltips is untranslatable

The Bug:

The "," symbol that exists after every color within firework star item tooltips 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 comma used to list colors within firework star item tooltips is untranslatable.

Observed Behavior:

The comma used to list colors within firework star item tooltips is untranslatable.

Expected Behavior:

The comma used to list colors within firework star item tooltips would be translatable.

Code Analysis:

Code analysis by @unknown can be found below.

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

net.minecraft.world.item.FireworkStarItem.java

public class FireworkStarItem extends Item {
   ...
   private static Component appendColors(MutableComponent $mc, int[] $i) {
      for(int i = 0; i < $i.length; ++i) {
         if (i > 0) {
            $mc.append(", ");
         }
         ...

If we look at the above class, we can see that the comma used to list colors within firework star item tooltips is hardcoded, and as a result, is untranslatable. This is evident through the following piece of code:

append(", ")

Linked issues

Attachments

Comments 3

This is a locale problem, not a translation problem (it should use the list separator from the locale database, although they are not universally available but in that case falling back to comma seems fine).

Can confirm.
It should be whatever the selected language uses as list separator, not the locale database.

There is no language list separator - it's a regional configuration specified in locale.  It is not universally available, so that can create some issues (although a value is typically available from the underlying OS at LOCALE_SLIST or similar).  If you wanted a per-language setting (not sure why, this seems much worse than using the configuration of the local host), you'd have to do something like carve out some PUA space for a custom "list separator" codepoint and have each translation supply it (but again, this would be as unexpected to users as using a comma all the time).

You could use the LC_COLLATE rules, but they've never been as complex as required to really solve the issue.  I'm not sure Mojang really wants "Pink, Lime, and Red", versus "Pink, Lime, Red", or, "Pink, Lime and Red", all of which are variants that you'd get in english switching between en_US and en_UK even (and of course you wouldn't want to redo the sort, as the order does matter for these values).

Avoma

(Unassigned)

Confirmed

Platform

Low

Internationalisation, Text

translatability

1.18.1, 1.18.2 Release Candidate 1, 1.18.2, 1.19 Pre-release 1, 1.19, ..., 1.20.1, 1.20.2, 1.20.3 Pre-Release 2, 1.21, 1.21.4

Retrieved