Lamp icon indicating copy to clipboard operation
Lamp copied to clipboard

[Feature] Custom message types in Locale/Translator

Open bivashy opened this issue 1 year ago • 1 comments

Description: I've always wanted to utilize the Locale feature to offer users multi-language messages. However, there's a primary issue: it doesn't support custom message types, such as Component. Due to this limitation, we cannot send clickable/hoverable messages to our BukkitCommandActor.

Solution: We could create another interface that extends LocaleReader called LocaleReaderTransmitter, which would implement the LocaleReaderTransmitter#sendToActor(CommandActor) method.

Alternatives I've Considered: I've tried using CommandExceptionAdapter and BukkitExceptionAdapter, but I'm not happy with that approach. That's because replyLocalized or errorLocalized still utilize the LocaleReader that only supports strings.

bivashy avatar Oct 18 '23 11:10 bivashy

Hmm, the implementation is indeed quite limited. Have you considered ResponseHandlers though? I'll see if I could scrape a simple API for getting that job done.

Revxrsal avatar Nov 16 '23 14:11 Revxrsal

Addressed in v4. Thanks.

Revxrsal avatar Aug 16 '24 13:08 Revxrsal