Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Latest commit

 

History

History
26 lines (20 loc) · 1001 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 1001 Bytes

🌎 LanguageAPI

A simple language api for translating plugins into multiple languages. The messages are saved in json files and the language of a player gets saved in a SQL database.

How to use?

// Registering your plugin
LanguageAPI api = LanguageAPI.registerAPI("YourPluginID");

Every plugin has an ID. The language files for a plugin will be saved in languages/<ID>/<langcode>.json.

// Getting a translated message
api.getMessage("path.to.message", Locale.GERMAN);
api.getMessage("path.to.other.message", player.getUniqueId.toString());

If you want to use Spigot/Velocity exclusive methods, see SpigotAdapter/VelocityAdapter.

If you're running on Spigot you can use the Skript addon this plugin provides.

[the] translated message %path% of %player%
send translated message "path.to.message" of player to player

Gradle Setup based on the CFW/VaroPlugin by Cuuky