Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Locale module #14

Open
Crypnotic opened this issue May 6, 2019 · 3 comments
Open

Refactor Locale module #14

Crypnotic opened this issue May 6, 2019 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Crypnotic
Copy link
Owner

The locale module was written very quickly and sloppily. It needs love and to possibly to be moved out of the module system scope. More to come later...

@Crypnotic
Copy link
Owner Author

Locale has been refactored into a manager outside of the module scope; however, I'm not sure about the static access from StringHelper. I would rather not offload such a task to StringHelper, but more thinking is needed.

@mdcfe
Copy link
Contributor

mdcfe commented May 31, 2019

Essentials(X) currently uses a static method everywhere, I18n.tl, but in the future EssentialsX may change this to support placeholders and per-player locales.

Nucleus uses an instance of a MessageProvider, which is responsible for providing the messages from either a config file or resource bundle. Sending messages is done using methods on MessageProvider. To reduce repetition, it also has helper methods in MessageProviderTrait implemented on listener and command classes as needed. I'm not certain but it looks like Nucleus already supports per-player locale, or at least has the groundwork for it.

@Crypnotic Crypnotic added enhancement New feature or request help wanted Extra attention is needed labels Jun 1, 2019
@Crypnotic
Copy link
Owner Author

I'm kind of fond of the idea of a message provider. I'm kind of torn between adding more classes simply for locale support, and adding the messaging methods to the actual LocaleManager since I would rather is just manage locales rather than proxy messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants