mirror of
https://github.com/SunNetservers/Launchpad.git
synced 2024-12-05 01:43:15 +01:00
Makes the language selectable
This commit is contained in:
parent
d65f288dc1
commit
13f3de32fa
@ -28,6 +28,7 @@ public final class Launchpad extends JavaPlugin {
|
||||
|
||||
private static Launchpad instance;
|
||||
private LaunchpadConfiguration launchpadConfiguration;
|
||||
private Translator translator;
|
||||
private StringFormatter stringFormatter;
|
||||
|
||||
/**
|
||||
@ -45,6 +46,7 @@ public final class Launchpad extends JavaPlugin {
|
||||
public void reload() {
|
||||
reloadConfig();
|
||||
this.getConfiguration().load(this.getConfig());
|
||||
this.translator.loadLanguages(this.getDataFolder(), "en", getConfig().getString("language", "en"));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,7 +85,8 @@ public final class Launchpad extends JavaPlugin {
|
||||
Translator translator = new Translator();
|
||||
translator.registerMessageCategory(LaunchpadMessage.ERROR_PLAYER_ONLY);
|
||||
translator.setColorConversion(ColorConversion.RGB);
|
||||
translator.loadLanguages(this.getDataFolder(), "en", "en");
|
||||
translator.loadLanguages(this.getDataFolder(), "en", getConfig().getString("language", "en"));
|
||||
this.translator = translator;
|
||||
this.stringFormatter = new StringFormatter(this.getDescription().getName(), translator);
|
||||
this.stringFormatter.setColorConversion(ColorConversion.RGB);
|
||||
this.stringFormatter.setNamePrefix("#FFE34C[");
|
||||
|
@ -1,3 +1,5 @@
|
||||
# The chosen language for Launchpad. You can use "en" or any custom language specified in strings.yml
|
||||
language: en
|
||||
launchpad:
|
||||
# A list of all materials automatically enabled as a launch-pad. Use +PRESSURE_PLATES for all pressure plates, or
|
||||
# +WOODEN_PRESSURE_PLATES for all wooden pressure plates.
|
||||
|
Loading…
Reference in New Issue
Block a user