1 minute estimated read time

Localization

Below is an example on how to use the vital-localization module in your plugin.

Get translated text for a player:

VitalLocalizationModule.Spigot.t(myPlayer, "my.resource.key.name", anArrayOfPossibleParametersForYourResourceKey);

Get translated text without a player:

VitalLocalizationModule.Spigot.t(Locale.ENGLISH, "my.resource.key.name", anArrayOfPossibleParametersForYourResourceKey);

Set the language of a player:

VitalLocalizationModule.Spigot.setLocale(myPlayer, Locale.ENGLISH);

Updating a locale for a Spigot player will automatically also update his entire inventory and update all items from vital-items that are named with a resource key in their info annotation.

Found an issue?

Help us improve the documentation by reporting typos, missing information, or anything confusing.

Don't worry, we will auto-fill most of the annoying fields.

Create GitHub issue

This site and the Vital framework were built with ❤️ by Mike Neumann