Paul2708 / simple-commands

An (even more) simplified and intuitive command framework for Spigot.
MIT License
14 stars 2 forks source link

Map language provider #65

Closed Paul2708 closed 4 years ago

Paul2708 commented 4 years ago

Description

At the moment the default language provider is LocaleLanguageProvider. So if you want to send a message via language provider you must declare the message in a message resource file. If you want to test your code fast, it may be annoying. So the idea is to declare the messages in the code instead of files.

Usage

Implementation idea There is already an interface for LanguageProvider. It could take a Map<String, String> that maps the key to the message. In addition the message could also contain object parameters and color codes.

Alternatives

An alternative would be #54, but it comes with some issues. The default command arguments hold message resource keys for false usage for example. An identity language provider would return the keys like argument.boolean.invalid instead of a fancy message.

cerus commented 4 years ago

I'll take care of this if that's okay for you. cc @Paul2708

Paul2708 commented 4 years ago

I didn't expect any further interest in this project. I'm glad you want to take this issue. Thanks :heart: Edit: I cannot assign you via mobile app, I will do it later.

cerus commented 4 years ago

One hand washes the other.

;)

cerus commented 4 years ago

Just made a pr: #68

Paul2708 commented 4 years ago

Closed in #68