Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanna contribute to this plugin, I saw the plugin lacks the multi lang support so I added it with minor buxfixes.
Multi lang support, it does consists from TranslationManager.java wich is basically class that handles the multi lang support. It does get load in Lunamatic.class with language name specified in config.yml under "lang". If the plugin fails to find the translation file it would disable the plugin and gives the server operator some trouble shooting tips. The plugin would get disabled even if the translation version missmatches with the version provided in Lanamatic.class. Then the translation token could be accessed with
translationManager.getTranslation("example")
In order to be synced with theLunamatic lang, on each access for token the translationManager needs to match the current TranslationManager instance.
Improved
/luna reload
. It does now reload all variables from config.yml, even the language. It does display warning message when executed, that something can go wrong and it should be used only while testing. Because it does reset the TranslationManager instance, the TranslationManager refferences cannot be final!Fixed that
getComponentLogger
didn't output any text. Instead that I usedgetServer().getConsoleSender().sendMessagee()
. It does use ChatColor witch is deprecated. I will take look on it in future. But for now it does work.Allowed so users can use it on another version of Paper, but they are encouraged to do NOT do that, and it could behave unexpectedly or even crash. (Because some plugins work on newer versions)
Removed
world
fromdisabledWorlds
in default config.yml. It is little bit confusing that main world isn't enabled by default.How to add more languages?
Only translated .yml file needs to be placed into the src/main/resources/translations
I introduced only two langs files for start (Czech and English)
While translating, the lang_ver needs to be set accordingly to the lang_ver that is defined i Lunamatic.class
Everything on loading of the server was tested
Translations were tested
/luna reload was tested
20 mins test was performed and there wasn't any issue present.
24h test (I would try it today, while pushing it on my server for my friends)