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

Add optional translation config #459

Closed
PintTheDragon opened this issue Mar 13, 2021 · 3 comments · Fixed by #460
Closed

Add optional translation config #459

PintTheDragon opened this issue Mar 13, 2021 · 3 comments · Fixed by #460
Labels
enhancement New feature or request regarding-api

Comments

@PintTheDragon
Copy link
Member

Adding the ability to translate messages can be very helpful to a lot of plugins, but will clutter up the config significantly. This is why I propose there be a separate config for translations, that plugins are not required to use. Before, I'd like to define what might go inside of the translation config, and what can be left out of it:

Messages used inside of plugins should go inside of the translation config. These messages help certain plugin features, but are not a feature themselves.
Custom broadcast/hint messages should be inside of the plugin config. These exist as plugin features on their own, and shouldn't be with the other translations. There are very few of these types of messages, so they won't clutter the config and won't get mixed up with the other translations.

Translations can be implemented as follows:

IPlugin/Plugin is given a new property, of type ITranslation, which is default to null.
A new interface called ITranslation, similar to IConfig is created, although it does not include is_enabled.
Where the config manager loads configs, it also loads translations from a separate translations file, ignoring plugins that have null translations.

This should be an easy-to-implement feature, as most of what is required already exists in the config manager, and will make translating plugins much easier.

@joker-119 joker-119 added enhancement New feature or request regarding-api labels Mar 13, 2021
@joker-119 joker-119 linked a pull request Mar 13, 2021 that will close this issue
@iRebbok
Copy link
Contributor

iRebbok commented Mar 19, 2021

What kind of messages should plugins use from the translation config if not custom broadcasts? Log.Warn/Log.Error?

@joker-119
Copy link
Contributor

It'd basically be any language localization options the plugin dev wants to support, such as changing broadcasts/hints, console messages, etc.

@PintTheDragon
Copy link
Member Author

Not sure why this issue didn't close automatically when the PR got merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request regarding-api
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants