feat(i18n): Updated the localization files (#tf2)
This commit is contained in:
parent
f14457fd8b
commit
ba753deafd
5 changed files with 19 additions and 19 deletions
|
@ -9,7 +9,7 @@ public class I18NDict {
|
||||||
public static final String CACHE = ERROR_KEY + "cache";
|
public static final String CACHE = ERROR_KEY + "cache";
|
||||||
public static final String MOJANG_NAME = ERROR_KEY + "mojang_name";
|
public static final String MOJANG_NAME = ERROR_KEY + "mojang_name";
|
||||||
public static final String MOJANG_SKIN = ERROR_KEY + "mojang_skin";
|
public static final String MOJANG_SKIN = ERROR_KEY + "mojang_skin";
|
||||||
public static final String SQL = ERROR_KEY + "sql";
|
public static final String DATABASE = ERROR_KEY + "database";
|
||||||
public static final String JSON = ERROR_KEY + "json";
|
public static final String JSON = ERROR_KEY + "json";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class PlayerDataStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult saveData(Player player) {
|
public ActionResult saveData(Player player) {
|
||||||
if (storage.isError()) return ActionResult.error(I18NDict.Error.SQL);
|
if (storage.isError()) return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
if (cache.isError()) return ActionResult.error(I18NDict.Error.CACHE);
|
if (cache.isError()) return ActionResult.error(I18NDict.Error.CACHE);
|
||||||
if (!cache.isCached(player.getUniqueId())) return ActionResult.error(I18NDict.Error.CACHE);
|
if (!cache.isCached(player.getUniqueId())) return ActionResult.error(I18NDict.Error.CACHE);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class MariaDBStorage extends Storage {
|
||||||
@Override
|
@Override
|
||||||
public ActionResult store(UUID uuid, NickoProfile profile) {
|
public ActionResult store(UUID uuid, NickoProfile profile) {
|
||||||
final Connection connection = getProvider().getConnection();
|
final Connection connection = getProvider().getConnection();
|
||||||
if (connection == null) return ActionResult.error(I18NDict.Error.SQL);
|
if (connection == null) return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final PreparedStatement statement = isStored(uuid) ?
|
final PreparedStatement statement = isStored(uuid) ?
|
||||||
|
@ -45,7 +45,7 @@ public class MariaDBStorage extends Storage {
|
||||||
return ActionResult.ok();
|
return ActionResult.ok();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.warning("Couldn't send SQL Request: " + e.getMessage());
|
logger.warning("Couldn't send SQL Request: " + e.getMessage());
|
||||||
return ActionResult.error(I18NDict.Error.SQL);
|
return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,17 +103,17 @@ public class MariaDBStorage extends Storage {
|
||||||
@Override
|
@Override
|
||||||
public ActionResult delete(UUID uuid) {
|
public ActionResult delete(UUID uuid) {
|
||||||
final Connection connection = getProvider().getConnection();
|
final Connection connection = getProvider().getConnection();
|
||||||
if (connection == null) return ActionResult.error(I18NDict.Error.SQL);
|
if (connection == null) return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final String sql = "DELETE FROM nicko.DATA WHERE uuid = ?";
|
final String sql = "DELETE FROM nicko.DATA WHERE uuid = ?";
|
||||||
final PreparedStatement statement = connection.prepareStatement(sql);
|
final PreparedStatement statement = connection.prepareStatement(sql);
|
||||||
statement.setString(1, uuid.toString());
|
statement.setString(1, uuid.toString());
|
||||||
int rows = statement.executeUpdate();
|
int rows = statement.executeUpdate();
|
||||||
return (rows == 1 ? ActionResult.ok() : ActionResult.error(I18NDict.Error.SQL));
|
return (rows == 1 ? ActionResult.ok() : ActionResult.error(I18NDict.Error.DATABASE));
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.warning("Couldn't delete profile: " + e.getMessage());
|
logger.warning("Couldn't delete profile: " + e.getMessage());
|
||||||
return ActionResult.error(I18NDict.Error.SQL);
|
return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class MySQLStorage extends Storage {
|
||||||
@Override
|
@Override
|
||||||
public ActionResult store(UUID uuid, NickoProfile profile) {
|
public ActionResult store(UUID uuid, NickoProfile profile) {
|
||||||
final Connection connection = getProvider().getConnection();
|
final Connection connection = getProvider().getConnection();
|
||||||
if (connection == null) return ActionResult.error(I18NDict.Error.SQL);
|
if (connection == null) return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final PreparedStatement statement = isStored(uuid) ?
|
final PreparedStatement statement = isStored(uuid) ?
|
||||||
|
@ -45,7 +45,7 @@ public class MySQLStorage extends Storage {
|
||||||
return ActionResult.ok();
|
return ActionResult.ok();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.warning("Couldn't send SQL Request: " + e.getMessage());
|
logger.warning("Couldn't send SQL Request: " + e.getMessage());
|
||||||
return ActionResult.error(I18NDict.Error.SQL);
|
return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,17 +103,17 @@ public class MySQLStorage extends Storage {
|
||||||
@Override
|
@Override
|
||||||
public ActionResult delete(UUID uuid) {
|
public ActionResult delete(UUID uuid) {
|
||||||
final Connection connection = getProvider().getConnection();
|
final Connection connection = getProvider().getConnection();
|
||||||
if (connection == null) return ActionResult.error(I18NDict.Error.SQL);
|
if (connection == null) return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final String sql = "DELETE FROM nicko.DATA WHERE uuid = ?";
|
final String sql = "DELETE FROM nicko.DATA WHERE uuid = ?";
|
||||||
final PreparedStatement statement = connection.prepareStatement(sql);
|
final PreparedStatement statement = connection.prepareStatement(sql);
|
||||||
statement.setString(1, uuid.toString());
|
statement.setString(1, uuid.toString());
|
||||||
int rows = statement.executeUpdate();
|
int rows = statement.executeUpdate();
|
||||||
return (rows == 1 ? ActionResult.ok() : ActionResult.error(I18NDict.Error.SQL));
|
return (rows == 1 ? ActionResult.ok() : ActionResult.error(I18NDict.Error.DATABASE));
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.warning("Couldn't delete profile: " + e.getMessage());
|
logger.warning("Couldn't delete profile: " + e.getMessage());
|
||||||
return ActionResult.error(I18NDict.Error.SQL);
|
return ActionResult.error(I18NDict.Error.DATABASE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
# Nicko ${version} - Config:
|
# Nicko ${version} - Fichier de langue:
|
||||||
|
|
||||||
# Specifies the configuration version, don't change.
|
# Précise la version de la configuration, ne pas changer.
|
||||||
version: "1.1.0"
|
version: "1.1.2"
|
||||||
|
|
||||||
error:
|
error:
|
||||||
generic: "Une erreur inconnue c'est produite."
|
generic: "Une erreur inconnue c'est produite."
|
||||||
permission: "§cVous ne possédez pas la permission."
|
permission: "§cVous ne possédez pas la permission."
|
||||||
invalid_username: "§cLe pseudo n'est pas un pseudo Minecraft valide."
|
invalid_username: "§cLe pseudo n'est pas un pseudo Minecraft valide."
|
||||||
mojang_name: "Un compte Minecraft avec ce nom n'existe pas."
|
mojang_name: "Compte Minecraft inexistant"
|
||||||
mojang_skin: "Ce compte Minecraft n'a pas de skin."
|
mojang_skin: "Skin Minecraft invalide"
|
||||||
cache: "Impossible de récupérer le skin depuis le cache."
|
cache: "Erreur du cache"
|
||||||
sql: "Erreur SQL"
|
database: "Erreur SQL"
|
||||||
json: "Erreur JSON"
|
json: "Erreur JSON"
|
||||||
|
|
||||||
event:
|
event:
|
||||||
|
|
Loading…
Reference in a new issue