This package is intended to be a generic package to be used by a Bukkit plugin to provide localization support. The routines here are heavily borrowed from Hidendra's LWC and refactored to be generic in nature such that you should be able to copy these classes into your own project and be up and running with robust internationalization (i18n) with low effort.
Below is included a usage example to get you started.
In your plugin onEnable method, you would instantiate a Locale object like so:
Then to use your new locale using the utility method defined above:
This would locate the localized string with the key "MESSAGE_YOU_DIED" and replace any occurrence of "%killer%" in that string with the killer's name.
Setting up your language files is a matter of including a "lang" directory in your JAR
file with your language definitions, like so:
(the "lwc" prefix in this case matches to the pluginBaseName arg supplied to LocaleConfig)
An example of such a file might look like so:
Note that these classes provide the admin the ability to provide their own language override files in the "plugins/MyPlugin/locale/" directory. In the simplest case, the admin could just name it "plugin.properties" (where plugin is the name of your prefix, ie. "lwc") and any messages found in there will override the ones from the language pack in the JAR file.