jcdesimp / Landlord

Bukkit land claiming plugin.
MIT License
11 stars 21 forks source link

Localization / Message Customization #13

Closed jcdesimp closed 8 years ago

jcdesimp commented 9 years ago

Rather than using hardcoded strings for messages and words that are shown to players, the messages should be configurable externally via something such as a "message.yml" file.

jamierocks commented 9 years ago

Just use Java's default Properties class

jcdesimp commented 9 years ago

@jamierocks I was just gonna extend Bukkit's YamlConfiguration class. I need to sort out all the hardcoded strings that are already there first, which I've already started to do.

jamierocks commented 9 years ago

YML just doesn't seem like the right thing to use for this.

jcdesimp commented 9 years ago

@jamierocks I want it to be easily configurable by the server owners as well.

jamierocks commented 9 years ago

Properties files are easily configurable? player.quit=%1 has quit the game.

jcdesimp commented 9 years ago

@jamierocks I plan on having the messages sorted in a hierarchical way. Command output, help info... should be logical. There will be a default bundled inside the plugin which will get referenced if the value is not found in the user configurable one.

What advantages do Java properties offer for this? If you can convince me I'll consider it :)

jamierocks commented 9 years ago

Java's properties are just key=value and comments are like # this is a comment So to do it in a hierarchical way you would do:

player events

player.join=%1 has joined the game! player.quit=%1 has quit the game!

server events

server.shutdown=The server is shutting down!

jcdesimp commented 9 years ago

I don't really see how that would make it easier, only more annoying, With yaml I only need to write out a parent node once.