erikzimmermann / TradeSystem

A highly customizable, free and open-source Minecraft plugin for trading between players.
https://www.spigotmc.org/resources/trade-system-custom-layouts.58434/
MIT License
79 stars 48 forks source link

(feature request) Split locales into separate language files #70

Closed arboriginal closed 5 years ago

arboriginal commented 5 years ago

Hello,

Just discover your plugin, seems to work fine (I'll test deeper and report you problems if any) but I saw the localisation could be much better:

This will help localise your plugin in other languages. It's IMHO cleaner than everything in a single file for admins when there are more than a few sentences. And users could share and contribute their independent languages files easier.

To illustrate what I mean, you can check how Citizens2 manage locales files for example: https://github.com/CitizensDev/Citizens2/tree/master/main/src/main/resources

You can for example in your reloadConfig() read getConfig().getString("Language"), then load the appropriate file in a list, or something like that. I've already did this king of implementation, I could try to find where it is in my chaos of not finished codes if needed :-)

But this is a suggestion and not a priority ;) Thanks for sharing this plugin with the community!

(*) I think it's better to use ISO code for language filenames, but it's a detail. Edit: (replaced "files" by "filenames" in this sentence to be more clear).

Edit: Here is an example of a separate lang file for french language. (fell free to reuse it if you want, it is yours!)

erikzimmermann commented 5 years ago

Thanks I will use this next time ;)

One question: Why ISO and not UTF_8? I changed that UTF_8 to add symbols

arboriginal commented 5 years ago

In fact, I talk about ISO 3166-2 (a norm / standard) not about the ISO-XXXXX related to encoding. :)

The purpose of ISO 3166-2 is to establish an international standard of short and unique alphanumeric codes to represent the relevant administrative (...) of all countries (...).

And sorry, I've just realised I put the french link... here is the english one: https://en.wikipedia.org/wiki/ISO_3166-2

And the german one, because your are: https://de.wikipedia.org/wiki/ISO_3166-2

erikzimmermann commented 5 years ago

Ok, thanks. I'll take a look into it later.