79 lines
2.6 KiB
Java
79 lines
2.6 KiB
Java
package net.t2code.lib.Spigot.system.languages;
|
|
|
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
import net.t2code.lib.Spigot.system.Main;
|
|
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
public class LanguagesCreate {
|
|
static Plugin plugin = Main.plugin;
|
|
|
|
public static void langCreate() {
|
|
send.debug(plugin,"§4Language files are created / updated...");
|
|
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
|
|
/**
|
|
*
|
|
* ENGLISH
|
|
*
|
|
*/
|
|
|
|
File messagesEN = new File(Main.getPath(), "languages/english_messages.yml");
|
|
YamlConfiguration yamlConfigurationEN = YamlConfiguration.loadConfiguration(messagesEN);
|
|
|
|
Config.set("Plugin.VaultNotSetUp", MSG.EN_VaultNotSetUp, yamlConfigurationEN);
|
|
Config.set("Plugin.SoundNotFound", MSG.EN_SoundNotFound, yamlConfigurationEN);
|
|
|
|
try {
|
|
yamlConfigurationEN.save(messagesEN);
|
|
} catch (IOException e) {
|
|
send.warning(Main.plugin,e.getMessage());
|
|
e.printStackTrace();
|
|
}
|
|
|
|
/**
|
|
*
|
|
* GERMAN
|
|
*
|
|
*/
|
|
|
|
File messagesDE = new File(Main.getPath(), "languages/german_messages.yml");
|
|
YamlConfiguration yamlConfigurationDE = YamlConfiguration.loadConfiguration(messagesDE);
|
|
|
|
Config.set("Plugin.VaultNotSetUp", MSG.DE_VaultNotSetUp, yamlConfigurationDE);
|
|
Config.set("Plugin.SoundNotFound", MSG.DE_SoundNotFound, yamlConfigurationDE);
|
|
|
|
try {
|
|
yamlConfigurationDE.save(messagesDE);
|
|
} catch (IOException e) {
|
|
send.warning(Main.plugin,e.getMessage());
|
|
e.printStackTrace();
|
|
}
|
|
|
|
/**
|
|
*
|
|
* norwegian
|
|
*
|
|
*/
|
|
|
|
File messagesNO = new File(Main.getPath(), "languages/norwegian_messages.yml");
|
|
YamlConfiguration yamlConfigurationNO = YamlConfiguration.loadConfiguration(messagesNO);
|
|
|
|
Config.set("Plugin.VaultNotSetUp", MSG.NO_VaultNotSetUp, yamlConfigurationNO);
|
|
Config.set("Plugin.SoundNotFound", MSG.NO_SoundNotFound, yamlConfigurationNO);
|
|
|
|
try {
|
|
yamlConfigurationNO.save(messagesNO);
|
|
} catch (IOException e) {
|
|
send.warning(Main.plugin,e.getMessage());
|
|
e.printStackTrace();
|
|
}
|
|
|
|
send.console(Main.prefix + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
}
|
|
}
|