refactor: language rework
This commit is contained in:
parent
b838bc173a
commit
14b4916a67
12 changed files with 156 additions and 114 deletions
|
@ -96,7 +96,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.seeseemelk</groupId>
|
<groupId>com.github.seeseemelk</groupId>
|
||||||
<artifactId>MockBukkit-v1.19</artifactId>
|
<artifactId>MockBukkit-v1.19</artifactId>
|
||||||
<version>2.143.0</version>
|
<version>2.29.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- MariaDB JDBC Driver -->
|
<!-- MariaDB JDBC Driver -->
|
||||||
|
|
|
@ -9,7 +9,8 @@ import net.artelnatif.nicko.config.NickoConfiguration;
|
||||||
import net.artelnatif.nicko.event.PlayerJoinListener;
|
import net.artelnatif.nicko.event.PlayerJoinListener;
|
||||||
import net.artelnatif.nicko.event.PlayerQuitListener;
|
import net.artelnatif.nicko.event.PlayerQuitListener;
|
||||||
import net.artelnatif.nicko.gui.items.main.ExitDoorItem;
|
import net.artelnatif.nicko.gui.items.main.ExitDoorItem;
|
||||||
import net.artelnatif.nicko.i18n.LocaleManager;
|
import net.artelnatif.nicko.i18n.Locale;
|
||||||
|
import net.artelnatif.nicko.i18n.LocaleFileManager;
|
||||||
import net.artelnatif.nicko.impl.Internals;
|
import net.artelnatif.nicko.impl.Internals;
|
||||||
import net.artelnatif.nicko.impl.InternalsProvider;
|
import net.artelnatif.nicko.impl.InternalsProvider;
|
||||||
import net.artelnatif.nicko.mojang.MojangAPI;
|
import net.artelnatif.nicko.mojang.MojangAPI;
|
||||||
|
@ -34,7 +35,7 @@ public class NickoBukkit extends JavaPlugin {
|
||||||
private NickoConfiguration config;
|
private NickoConfiguration config;
|
||||||
private MojangAPI mojangAPI;
|
private MojangAPI mojangAPI;
|
||||||
private PlayerDataStore dataStore;
|
private PlayerDataStore dataStore;
|
||||||
private LocaleManager localeManager;
|
private LocaleFileManager localeFileManager;
|
||||||
|
|
||||||
public NickoBukkit() { this.unitTesting = false; }
|
public NickoBukkit() { this.unitTesting = false; }
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ public class NickoBukkit extends JavaPlugin {
|
||||||
dataStore.getStorage().setError(false);
|
dataStore.getStorage().setError(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.isBungeecordEnabled()) {
|
if (config.isBungeecordSupport()) {
|
||||||
getServer().getMessenger().unregisterIncomingPluginChannel(this);
|
getServer().getMessenger().unregisterIncomingPluginChannel(this);
|
||||||
getServer().getMessenger().unregisterOutgoingPluginChannel(this);
|
getServer().getMessenger().unregisterOutgoingPluginChannel(this);
|
||||||
}
|
}
|
||||||
|
@ -103,9 +104,14 @@ public class NickoBukkit extends JavaPlugin {
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
config = new NickoConfiguration(this);
|
config = new NickoConfiguration(this);
|
||||||
|
|
||||||
localeManager = new LocaleManager(this);
|
localeFileManager = new LocaleFileManager();
|
||||||
localeManager.findFallbackLocale();
|
if (config.isCustomLocale()) {
|
||||||
localeManager.installCustomLanguageFile();
|
if (localeFileManager.dumpFromLocale(Locale.ENGLISH)) {
|
||||||
|
getLogger().info("Successfully dumped English locale to lang.yml!");
|
||||||
|
} else {
|
||||||
|
getLogger().warning("Failed to dump English locale to lang.yml! Custom Locale usage will be disabled.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final PluginCommand command = getCommand("nicko");
|
final PluginCommand command = getCommand("nicko");
|
||||||
if (command != null) {
|
if (command != null) {
|
||||||
|
@ -131,7 +137,7 @@ public class NickoBukkit extends JavaPlugin {
|
||||||
|
|
||||||
final ServerUtils serverUtils = new ServerUtils(this);
|
final ServerUtils serverUtils = new ServerUtils(this);
|
||||||
serverUtils.checkSpigotBungeeCordHook();
|
serverUtils.checkSpigotBungeeCordHook();
|
||||||
if (config.isBungeecordEnabled()) {
|
if (config.isBungeecordSupport()) {
|
||||||
if (serverUtils.checkBungeeCordHook()) {
|
if (serverUtils.checkBungeeCordHook()) {
|
||||||
getLogger().info("Enabling BungeeCord support...");
|
getLogger().info("Enabling BungeeCord support...");
|
||||||
getServer().getMessenger().registerIncomingPluginChannel(this, NickoBungee.NICKO_PLUGIN_CHANNEL_UPDATE, new PluginMessageHandler());
|
getServer().getMessenger().registerIncomingPluginChannel(this, NickoBungee.NICKO_PLUGIN_CHANNEL_UPDATE, new PluginMessageHandler());
|
||||||
|
@ -154,8 +160,8 @@ public class NickoBukkit extends JavaPlugin {
|
||||||
|
|
||||||
public PlayerDataStore getDataStore() { return dataStore; }
|
public PlayerDataStore getDataStore() { return dataStore; }
|
||||||
|
|
||||||
public LocaleManager getLocaleManager() {
|
public LocaleFileManager getLocaleFileManager() {
|
||||||
return localeManager;
|
return localeFileManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isUnitTesting() {
|
public boolean isUnitTesting() {
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class AnvilManager {
|
||||||
if (!actionResult.isError()) {
|
if (!actionResult.isError()) {
|
||||||
player.sendMessage(I18N.translate(player, I18NDict.Event.DISGUISE_SUCCESS));
|
player.sendMessage(I18N.translate(player, I18NDict.Event.DISGUISE_SUCCESS));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(I18N.translate(player, I18NDict.Event.DISGUISE_FAIL, I18N.translateFlat(player, actionResult.getErrorMessage())));
|
player.sendMessage(I18N.translate(player, I18NDict.Event.DISGUISE_FAIL, I18N.translateWithoutPrefix(player, actionResult.getErrorMessage())));
|
||||||
}
|
}
|
||||||
return AnvilGUI.Response.close();
|
return AnvilGUI.Response.close();
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public class AnvilManager {
|
||||||
if (!actionResult.isError()) {
|
if (!actionResult.isError()) {
|
||||||
player.sendMessage(I18N.translate(player, I18NDict.Event.DISGUISE_SUCCESS));
|
player.sendMessage(I18N.translate(player, I18NDict.Event.DISGUISE_SUCCESS));
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(I18N.translate(player, I18NDict.Event.DISGUISE_FAIL, I18N.translateFlat(player, actionResult.getErrorMessage())));
|
player.sendMessage(I18N.translate(player, I18NDict.Event.DISGUISE_FAIL, I18N.translateWithoutPrefix(player, actionResult.getErrorMessage())));
|
||||||
}
|
}
|
||||||
return AnvilGUI.Response.close();
|
return AnvilGUI.Response.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||||
public class NickoConfiguration {
|
public class NickoConfiguration {
|
||||||
private final NickoBukkit nicko;
|
private final NickoBukkit nicko;
|
||||||
private String prefix;
|
private String prefix;
|
||||||
private String fallbackLocale;
|
|
||||||
|
|
||||||
private Boolean bungeecordSupport;
|
private Boolean bungeecordSupport;
|
||||||
private Boolean localStorage;
|
private Boolean localStorage;
|
||||||
|
@ -19,13 +18,22 @@ public class NickoConfiguration {
|
||||||
this.nicko = nicko;
|
this.nicko = nicko;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//.............
|
||||||
|
// SECTION ACCESSORS
|
||||||
|
//.............
|
||||||
|
|
||||||
public ConfigurationSection getBungeecordSection() { return getConfig().getConfigurationSection("bungeecord"); }
|
public ConfigurationSection getBungeecordSection() { return getConfig().getConfigurationSection("bungeecord"); }
|
||||||
|
|
||||||
public ConfigurationSection getStorageSection() { return getConfig().getConfigurationSection("storage"); }
|
// Unused for now
|
||||||
|
public ConfigurationSection getRedisSection() { return getBungeecordSection().getConfigurationSection("redis"); }
|
||||||
|
|
||||||
public ConfigurationSection getLocaleSection() { return getConfig().getConfigurationSection("locale"); }
|
public ConfigurationSection getLocaleSection() { return getConfig().getConfigurationSection("locale"); }
|
||||||
|
|
||||||
public ConfigurationSection getRedisSection() { return getBungeecordSection().getConfigurationSection("redis"); }
|
public ConfigurationSection getStorageSection() { return getConfig().getConfigurationSection("storage"); }
|
||||||
|
|
||||||
|
//.............
|
||||||
|
// GLOBAL
|
||||||
|
//.............
|
||||||
|
|
||||||
public String getPrefix() {
|
public String getPrefix() {
|
||||||
if (prefix == null) {
|
if (prefix == null) {
|
||||||
|
@ -34,33 +42,11 @@ public class NickoConfiguration {
|
||||||
return prefix;
|
return prefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrefix(String prefix) {
|
//.............
|
||||||
this.prefix = prefix;
|
// BUNGEECORD
|
||||||
}
|
//.............
|
||||||
|
|
||||||
public String getFallbackLocale() {
|
public boolean isBungeecordSupport() {
|
||||||
if (fallbackLocale == null) {
|
|
||||||
return fallbackLocale = getLocaleSection().getString("fallback");
|
|
||||||
}
|
|
||||||
return fallbackLocale;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFallbackLocale(String fallbackLocale) {
|
|
||||||
this.fallbackLocale = fallbackLocale;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCustomLocaleEnabled() {
|
|
||||||
if (customLocale == null) {
|
|
||||||
return customLocale = getStorageSection().getBoolean("local");
|
|
||||||
}
|
|
||||||
return customLocale;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustomLocaleEnabled(Boolean localStorage) {
|
|
||||||
this.localStorage = localStorage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isBungeecordEnabled() {
|
|
||||||
if (bungeecordSupport == null) {
|
if (bungeecordSupport == null) {
|
||||||
return bungeecordSupport = getBungeecordSection().getBoolean("enabled");
|
return bungeecordSupport = getBungeecordSection().getBoolean("enabled");
|
||||||
}
|
}
|
||||||
|
@ -71,6 +57,25 @@ public class NickoConfiguration {
|
||||||
this.bungeecordSupport = bungeecordSupport;
|
this.bungeecordSupport = bungeecordSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//.............
|
||||||
|
// LOCALE
|
||||||
|
//.............
|
||||||
|
|
||||||
|
public boolean isCustomLocale() {
|
||||||
|
if (customLocale == null) {
|
||||||
|
return customLocale = getLocaleSection().getBoolean("use_custom_locale");
|
||||||
|
}
|
||||||
|
return customLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomLocale(boolean customLocale) {
|
||||||
|
this.customLocale = customLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
//.............
|
||||||
|
// STORAGE
|
||||||
|
//.............
|
||||||
|
|
||||||
public boolean isLocalStorage() {
|
public boolean isLocalStorage() {
|
||||||
if (localStorage == null) {
|
if (localStorage == null) {
|
||||||
return localStorage = getStorageSection().getBoolean("local");
|
return localStorage = getStorageSection().getBoolean("local");
|
||||||
|
@ -78,7 +83,7 @@ public class NickoConfiguration {
|
||||||
return localStorage;
|
return localStorage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLocalStorage(Boolean localStorage) {
|
public void setLocalStorage(boolean localStorage) {
|
||||||
this.localStorage = localStorage;
|
this.localStorage = localStorage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,35 +2,28 @@ package net.artelnatif.nicko.i18n;
|
||||||
|
|
||||||
import net.artelnatif.nicko.NickoBukkit;
|
import net.artelnatif.nicko.NickoBukkit;
|
||||||
import net.artelnatif.nicko.disguise.NickoProfile;
|
import net.artelnatif.nicko.disguise.NickoProfile;
|
||||||
import org.apache.commons.lang3.LocaleUtils;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.ResourceBundle;
|
|
||||||
|
|
||||||
public class I18N {
|
public class I18N {
|
||||||
private final static MessageFormat formatter = new MessageFormat("");
|
private final static MessageFormat formatter = new MessageFormat("");
|
||||||
|
private static final Yaml yaml = new Yaml();
|
||||||
|
|
||||||
private static Locale getLocale(Player player) {
|
private static Locale getLocale(Player player) {
|
||||||
final NickoBukkit instance = NickoBukkit.getInstance();
|
final NickoBukkit instance = NickoBukkit.getInstance();
|
||||||
try {
|
try {
|
||||||
final Optional<NickoProfile> profile = instance.getDataStore().getData(player.getUniqueId());
|
final Optional<NickoProfile> profile = instance.getDataStore().getData(player.getUniqueId());
|
||||||
if (profile.isEmpty()) {
|
return profile.isEmpty() ? Locale.FALLBACK_LOCALE : profile.get().getLocale();
|
||||||
return Locale.ENGLISH;
|
|
||||||
} else {
|
|
||||||
return profile.get().getLocale();
|
|
||||||
}
|
|
||||||
} catch (IllegalArgumentException exception) {
|
} catch (IllegalArgumentException exception) {
|
||||||
instance.getLogger().severe("Invalid locale provided by " + player.getName() + ", defaulting to " + LocaleManager.getFallback().getCode() + ".");
|
instance.getLogger().severe("Invalid locale provided by " + player.getName() + ", defaulting to " + Locale.FALLBACK_LOCALE.getCode() + ".");
|
||||||
return LocaleManager.getFallback();
|
return Locale.FALLBACK_LOCALE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ResourceBundle getBundle(java.util.Locale locale) {
|
|
||||||
return ResourceBundle.getBundle("locale", locale);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String translate(Player player, I18NDict key, Object... arguments) {
|
public static String translate(Player player, I18NDict key, Object... arguments) {
|
||||||
final NickoBukkit instance = NickoBukkit.getInstance();
|
final NickoBukkit instance = NickoBukkit.getInstance();
|
||||||
final String translation = findTranslation(player, key);
|
final String translation = findTranslation(player, key);
|
||||||
|
@ -43,7 +36,7 @@ public class I18N {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String translateFlat(Player player, I18NDict key, Object... arguments) {
|
public static String translateWithoutPrefix(Player player, I18NDict key, Object... arguments) {
|
||||||
final String translation = findTranslation(player, key);
|
final String translation = findTranslation(player, key);
|
||||||
try {
|
try {
|
||||||
formatter.applyPattern(translation);
|
formatter.applyPattern(translation);
|
||||||
|
@ -53,15 +46,15 @@ public class I18N {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static String findTranslation(Player player, I18NDict key) {
|
private static String findTranslation(Player player, I18NDict key) {
|
||||||
final NickoBukkit instance = NickoBukkit.getInstance();
|
final NickoBukkit instance = NickoBukkit.getInstance();
|
||||||
final Locale locale = getLocale(player);
|
final Locale locale = getLocale(player);
|
||||||
String translation;
|
String translation;
|
||||||
if (locale == Locale.CUSTOM) {
|
if (locale == Locale.CUSTOM) {
|
||||||
translation = instance.getLocaleManager().getCustomLanguageFile().getProperty(key.key(), key.key());
|
translation = instance.getLocaleFileManager().getFromFile(key.key());
|
||||||
} else {
|
} else {
|
||||||
translation = getBundle(LocaleUtils.toLocale(locale.getCode())).getString(key.key());
|
final HashMap<String, String> values = yaml.load(I18N.class.getResourceAsStream(locale.getCode() + ".yml"));
|
||||||
|
translation = values.getOrDefault(key.key(), key.key());
|
||||||
}
|
}
|
||||||
|
|
||||||
return translation;
|
return translation;
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package net.artelnatif.nicko.i18n;
|
package net.artelnatif.nicko.i18n;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public enum Locale implements Serializable {
|
public enum Locale implements Serializable {
|
||||||
ENGLISH("en", "English"),
|
ENGLISH("en", "English"),
|
||||||
FRENCH("fr", "Français"),
|
FRENCH("fr", "Français"),
|
||||||
CUSTOM("custom", "Server Custom");
|
CUSTOM("custom", "Server Custom");
|
||||||
|
|
||||||
private static HashMap<String, Locale> locales;
|
public static final Locale FALLBACK_LOCALE = ENGLISH;
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private transient final String name;
|
private transient final String name;
|
||||||
|
@ -18,21 +17,6 @@ public enum Locale implements Serializable {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HashMap<String, Locale> getLocales() {
|
|
||||||
if (locales == null) {
|
|
||||||
return locales = new HashMap<>() {{
|
|
||||||
for (Locale value : Locale.values()) {
|
|
||||||
put(value.getCode(), value);
|
|
||||||
}
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
return locales;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Locale fromCode(String code) {
|
|
||||||
return getLocales().getOrDefault(code, LocaleManager.getFallback());
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package net.artelnatif.nicko.i18n;
|
||||||
|
|
||||||
|
import net.artelnatif.nicko.NickoBukkit;
|
||||||
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public class LocaleFileManager {
|
||||||
|
private final Yaml yaml = new Yaml();
|
||||||
|
private final File folder = new File(NickoBukkit.getInstance().getDataFolder() + "/lang/");
|
||||||
|
private final File file = new File(folder, "lang.yml");
|
||||||
|
|
||||||
|
private HashMap<String, String> data = new HashMap<>();
|
||||||
|
|
||||||
|
public boolean loadValues() {
|
||||||
|
if (!file.exists()) return false;
|
||||||
|
try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {
|
||||||
|
data = yaml.load(inputStream);
|
||||||
|
return true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromFile(String key) {
|
||||||
|
if (!file.exists() || data.isEmpty()) return key;
|
||||||
|
return data.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean dumpFromLocale(Locale locale) {
|
||||||
|
if (locale == Locale.CUSTOM) return true;
|
||||||
|
if (file.exists()) return true;
|
||||||
|
final HashMap<String, String> values = yaml.load(this.getClass().getResourceAsStream(locale.getCode() + ".yml"));
|
||||||
|
try {
|
||||||
|
if (file.createNewFile()) {
|
||||||
|
try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
|
||||||
|
yaml.dump(values, writer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} catch (IOException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,7 +14,7 @@ public class ServerUtils {
|
||||||
public void checkSpigotBungeeCordHook() {
|
public void checkSpigotBungeeCordHook() {
|
||||||
final Server server = instance.getServer();
|
final Server server = instance.getServer();
|
||||||
final YamlConfiguration config = server.spigot().getConfig();
|
final YamlConfiguration config = server.spigot().getConfig();
|
||||||
if (config.getConfigurationSection("settings").getBoolean("bungeecord") && instance.getNickoConfig().isBungeecordEnabled()) {
|
if (config.getConfigurationSection("settings").getBoolean("bungeecord") && instance.getNickoConfig().isBungeecordSupport()) {
|
||||||
instance.getLogger().severe("Hummm. Your server is hooked to BungeeCord, but it seems");
|
instance.getLogger().severe("Hummm. Your server is hooked to BungeeCord, but it seems");
|
||||||
instance.getLogger().severe("that BungeeCord support is not enabled inside Nicko.");
|
instance.getLogger().severe("that BungeeCord support is not enabled inside Nicko.");
|
||||||
instance.getLogger().severe("If this is intentional, you can safely ignore this message.");
|
instance.getLogger().severe("If this is intentional, you can safely ignore this message.");
|
||||||
|
|
|
@ -14,13 +14,9 @@ bungeecord:
|
||||||
|
|
||||||
# Localisation:
|
# Localisation:
|
||||||
locale:
|
locale:
|
||||||
# By default, Nicko tries to get the locale from the player's preferences.
|
# Nicko will copy the English locale as "lang.yml"
|
||||||
# If that fails, the locale fallback is the one provided by this option.
|
|
||||||
# Accepted values: fr (French), en (English), custom (Custom language file).
|
|
||||||
fallback: "en"
|
|
||||||
# Nicko will copy the English locale as "custom.yml"
|
|
||||||
# and will use the translations in that file when "Server Custom"
|
# and will use the translations in that file when "Server Custom"
|
||||||
# is selected as the player's locale/default locale.
|
# is selected as the player's locale.
|
||||||
use_custom_locale: false
|
use_custom_locale: false
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
event.previous_skin_applied.success=§aYour previous active disguise has been applied back.
|
admin:
|
||||||
event.previous_skin_applied.fail=§cFailed to apply your previous disguise back. §7§o({0})
|
custom_language_reload_fail: "§cFailed to reload the custom language file!"
|
||||||
event.disguise.success=§aDisguise applied!
|
custom_language_reload_success: "§aReloaded custom language file."
|
||||||
event.disguise.fail=§cUnable to apply your disguise. §7§o({0})
|
error:
|
||||||
event.undisguise.success=§aDisguise removed.
|
couldnt_get_name_from_mojang: "Failed to get username from Mojang"
|
||||||
event.undisguise.fail=§cUnable to remove your disguise. It will be set back to default on your next login. Sorry!
|
couldnt_get_skin_from_cache: "Failed to get skin from cache"
|
||||||
event.undisguise.notactive=§cYou do not have an active disguise.
|
couldnt_get_skin_from_mojang: "Failed to get skin from Mojang"
|
||||||
error.player_offline=§c{0} §fis offline, please try again.
|
generic: "Unknown error"
|
||||||
error.generic=Unknown error
|
invalid_username: "§cThe specified username is not a valid Minecraft username."
|
||||||
error.couldnt_get_name_from_mojang=Failed to get username from Mojang
|
player_offline: "§c{0} §fis offline, please try again."
|
||||||
error.couldnt_get_skin_from_mojang=Failed to get skin from Mojang
|
event:
|
||||||
error.couldnt_get_skin_from_cache=Failed to get skin from cache
|
disguise:
|
||||||
error.invalid_username=§cThe specified username is not a valid Minecraft username.
|
fail: "§cUnable to apply your disguise. §7§o({0})"
|
||||||
admin.custom_language_reload_success=§aReloaded custom language file.
|
success: "§aDisguise applied!"
|
||||||
admin.custom_language_reload_fail=§cFailed to reload the custom language file!
|
previous_skin_applied:
|
||||||
|
fail: "§cFailed to apply your previous disguise back. §7§o({0})"
|
||||||
|
success: "§aYour previous active disguise has been applied back."
|
||||||
|
undisguise:
|
||||||
|
fail: "§cUnable to remove your disguise. It will be set back to default on your next login. Sorry!"
|
||||||
|
notactive: "§cYou do not have an active disguise."
|
||||||
|
success: "§aDisguise removed."
|
|
@ -1,15 +1,21 @@
|
||||||
event.previous_skin_applied.success=§aVotre précédent déguisement a été réappliqué.
|
admin:
|
||||||
event.previous_skin_applied.fail=§cImpossible d'appliquer votre déguisement précédent. §7§o({0})
|
custom_language_reload_fail: "§cImpossible de recharger le fichier de langue !"
|
||||||
event.disguise.success=§aDéguisement appliqué !
|
custom_language_reload_success: "§aFichier de langue rechargé."
|
||||||
event.disguise.fail=§cImpossible d'appliquer votre déguisement. §7§o({0})
|
error:
|
||||||
event.undisguise.success=§aDéguisement retiré.
|
couldnt_get_name_from_mojang: "Impossible de récupérer le nom d'utilisateur depuis Mojang"
|
||||||
event.undisguise.fail=§cImpossible de retier votre déguisement. Il sera remis par défaut à votre prochaine reconnexion. Désolé !
|
couldnt_get_skin_from_cache: "Impossible de récupérer le skin depuis le cache"
|
||||||
event.undisguise.notactive=§cVous n'avez pas de déguisement.
|
couldnt_get_skin_from_mojang: "Impossible de récupérer le skin depuis Mojang"
|
||||||
error.player_offline=§c{0} §fest hors-ligne, veuillez réessayer.
|
generic: "Erreur inconnue"
|
||||||
error.generic=Erreur inconnue
|
invalid_username: "§cLe pseudo spécifié n'est pas un pseudo Minecraft valide."
|
||||||
error.couldnt_get_name_from_mojang=Impossible de récupérer le nom d'utilisateur depuis Mojang
|
player_offline: "§c{0} §fest hors-ligne, veuillez réessayer."
|
||||||
error.couldnt_get_skin_from_mojang=Impossible de récupérer le skin depuis Mojang
|
event:
|
||||||
error.couldnt_get_skin_from_cache=Impossible de récupérer le skin depuis le cache
|
disguise:
|
||||||
error.invalid_username=§cLe pseudo spécifié n'est pas un pseudo Minecraft valide.
|
fail: "§cImpossible d'appliquer votre déguisement. §7§o({0})"
|
||||||
admin.custom_language_reload_success=§aFichier de langue rechargé.
|
success: "§aDéguisement appliqué !"
|
||||||
admin.custom_language_reload_fail=§cImpossible de recharger le fichier de langue !
|
previous_skin_applied:
|
||||||
|
fail: "§cImpossible d'appliquer votre déguisement précédent. §7§o({0})"
|
||||||
|
success: "§aVotre précédent déguisement a été réappliqué."
|
||||||
|
undisguise:
|
||||||
|
fail: "§cImpossible de retier votre déguisement. Il sera remis par défaut à votre prochaine reconnexion. Désolé !"
|
||||||
|
notactive: "§cVous n'avez pas de déguisement."
|
||||||
|
success: "§aDéguisement retiré."
|
|
@ -31,7 +31,7 @@ public class SQLStorageTest {
|
||||||
@DisplayName("Create SQL Tables")
|
@DisplayName("Create SQL Tables")
|
||||||
public void testSQLTables() {
|
public void testSQLTables() {
|
||||||
|
|
||||||
final PlayerMock playerMock = server.addPlayer("Aro");
|
final PlayerMock playerMock = server.addPlayer();
|
||||||
final Optional<NickoProfile> data = plugin.getDataStore().getData(playerMock.getUniqueId());
|
final Optional<NickoProfile> data = plugin.getDataStore().getData(playerMock.getUniqueId());
|
||||||
Assertions.assertTrue(data.isPresent());
|
Assertions.assertTrue(data.isPresent());
|
||||||
Assertions.assertNull(data.get().getSkin());
|
Assertions.assertNull(data.get().getSkin());
|
||||||
|
|
Loading…
Reference in a new issue