Description
openedon Apr 18, 2023
Or, to phrase it another way, Component
s sent as messages to the server console (FabricServerAudiences#console()
) are not rendered through the GlobalTranslator, but instead are rendered just as their language key. This differs from the behavior of other platforms like Paper and Sponge 7 that do perform this rendering.
MinecraftServer server = /* ... */;
FabricServerAudiences adventure = FabricServerAudiences.of(server);
TranslationRegistry registry = TranslationRegistry.create(Key.key("kyori", "test"));
registry.defaultLocale(Locale.ROOT);
registry.register("kyori.test", Locale.ROOT, new MessageFormat("Hello, world!"));
adventure.console().sendMessage(Component.translatable("kyori.test"));
// Expected output: "Hello, world!"
// Actual output: "kyori.test"
I did poke around at the library code but I'm not sure what's causing this. Implementation looks pretty similar to Paper's and I don't immediately see any logical errors. Could be related to using the mod as jar-in-jar but then, the global translator works for other purposes like sending actual chat messages to players, so 🤷🏻♀️
Using adventure 4.13.1, adventure-platform-fabric 5.8.0, fabric-api 0.78.0+1.19.4, & fabric-server-mc.1.19.4-loader.0.14.19-launcher.0.11.2.jar