mojira.dev
MC-235396

Lang files load in all namespaces, but translation keys aren't namespaced

I thought I reported this before, but guess not.

Translation keys aren't namespaced (minecraft: in front), but load from all namespaces in a resource pack.

Steps to reproduce:

  1. Create an empty resource pack.

  2. Add the file assests/testing_namespace/lang/en_us.json with the contents being

    {"test_string": "Test string showing"}

    and the file assests/minecraft/lang/en_us.json with the contents being

    {"minecraft_string": "Test string showing"}
  3. Enable the resource pack

  4. Use the commands

    /tellraw @s {"translate":"testing_namespace:test_string"}
    /tellraw @s {"translate":"minecraft:minecraft_string"}
    /tellraw @s {"translate":"test_string"}
    /tellraw @s {"translate":"minecraft_string"}

    Observe how the last two (without namespaces) show "Test string showing", and not the others.

    All but "test_string" without the namespace should show the text instead.

The fix for this should be to add the namespace to translation keys, and disallow the colon to be used in the translation keys. (Though it would be best to adapt translation keys to use the namespaced ID standard of [a-z0-9_.-] characters only.)

This would additionally help with mod compatibility, to prevent 2 mods adding strings from clashing.

When changed, the namespace will no longer need to be provided in the strings themselves (for blocks, items, entities, effects and enchantments), as it just selects the minecraft namespace string then.

Comments 3

Another "fun" side effect of this: Translation keys that are in the language file in another namespace's folder are overriding Vanilla ones so there is no way to guarantee that your own translations will never conflict with the game.

I support the solution of just adding namespace support to language keys.

More accurately, later-loaded files' strings overwrite earlier loaded files' strings.

Thank you for your report!
After consideration, the issue is being closed as Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit The official Minecraft feedback site or visit the Minecraft Feedback Discord server.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

user-f2760

[Mod] turbo

(Unassigned)

Confirmed

(Unassigned)

1.17.1, 21w39a, 1.18.1, 1.18.2, 22w11a, ..., 1.19.4, 23w17a, 1.20.1, 1.20.2, 23w43b

Retrieved