MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

I18n support stopped working

Open phoenix-the-uncreative opened this issue 1 year ago • 4 comments
trafficstars

Minecraft Development for IntelliJ plugin version

1.6.11

IntelliJ version

2023.2.5

Operating System

Windows 11

Target platform

Minecraft Forge

Description of the bug

Previously, when I called to I18n#format, the plugin would notify me if I used a key that does not exist and I could easily add it to the language file from the context menu.

Since 1.6.11, this doesn't work: I can't go to existing keys with ctrl+click, calls to I18n#format are no longer folded into the English translation and I can only create new keys when I write a string and manually select it to use the context menu action "Convert string literal to translation".

I've rolled back to 1.6.10 and it works again.

phoenix-the-uncreative avatar Nov 28 '23 20:11 phoenix-the-uncreative

We changed how I18n methods are identified by the plugin, it now uses a custom annotation and we use external annotations to attach it to existing known classes, looks like some were missed during the migration.

If someone wishes to contribute missing methods here is an example

You can add them locally in your project too using the appropriate intention in the editor.

RedNesto avatar Nov 28 '23 20:11 RedNesto

You didn't specify which Minecraft version you were using, but I didn't include MCP mappings during the migration, so it might be that.

Earthcomputer avatar Nov 28 '23 21:11 Earthcomputer

You didn't specify which Minecraft version you were using, but I didn't include MCP mappings during the migration, so it might be that.

That might be it, yeah. I'm using 1.16.5 with MCP mappings.

phoenix-the-uncreative avatar Nov 29 '23 03:11 phoenix-the-uncreative

I added the annotations myself, #2197

phoenix-the-uncreative avatar Jan 06 '24 16:01 phoenix-the-uncreative