Question Is there a way to translate command completions?

_Iuri

New member
Jan 16, 2022
22
3
3
How can i translate this?

1709061780304.png

I tried using AsyncTabCompleteEvent but the completions method just receive a List<String>, the best that i can do is add a tooltip to the completion. I need to translate it to spanish and portuguese

Thanks for your help! :devilish:
 

Machine Maker

Paper Developer
Staff member
Dec 17, 2021
132
6
19
18
California
The completions are just strings... I'm not sure if I've seen a plugin that tries to handled commands in multiple languages. You would have to add those translations based on the player's locale and then automatically handle that in the logic for handling your commands.
 
  • Like
Reactions: _Iuri

_Iuri

New member
Jan 16, 2022
22
3
3
Ok, knowing that the AsyncTabCompleteEvent contains all the client information needed to translate each completion suggestion seems weird be unable to translate it via TranslatableComponent, but ok, i'm going to handle it by myself
 

electronicboy

Administrator
Staff member
Dec 11, 2021
225
10
38
28
It doesn't return components, however, sending commands/chat to the server is 100% raw strings;

The only thing that can be a component is the tooltips
 
  • Like
Reactions: _Iuri

_Iuri

New member
Jan 16, 2022
22
3
3
It doesn't return components, however, sending commands/chat to the server is 100% raw strings;

The only thing that can be a component is the tooltips
Yeah i know, it does not need to handle all components, just the TranslatableComponent. I will get the player locate language and return him the correct completion language
 
Last edited: