1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-11 17:15:07 +02:00

Moving all default messages back to the code, where they should be

Also tweaking I18n class and YamlStorageWriter a bit
This commit is contained in:
snowleo
2013-04-06 04:02:15 +02:00
parent d17d7153dc
commit fd1c7f4fcc
201 changed files with 5156 additions and 3835 deletions

View File

@@ -47,7 +47,7 @@ public class EssentialsConf extends YamlConfiguration
{
if (!configFile.getParentFile().mkdirs())
{
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()));
LOGGER.log(Level.SEVERE, _("Failed to create config {0}", configFile.toString()));
}
}
// This will delete files where the first character is 0. In most cases they are broken.
@@ -90,22 +90,22 @@ public class EssentialsConf extends YamlConfiguration
{
if (templateName != null)
{
LOGGER.log(Level.INFO, _("creatingConfigFromTemplate", configFile.toString()));
LOGGER.log(Level.INFO, _("Creating config from template: {0}", configFile.toString()));
createFromTemplate();
}
else
{
try
{
LOGGER.log(Level.INFO, _("creatingEmptyConfig", configFile.toString()));
LOGGER.log(Level.INFO, _("Creating empty config: {0}", configFile.toString()));
if (!configFile.createNewFile())
{
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()));
LOGGER.log(Level.SEVERE, _("Failed to create config {0}", configFile.toString()));
}
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()), ex);
LOGGER.log(Level.SEVERE, _("Failed to create config {0}", configFile.toString()), ex);
}
}
}
@@ -175,7 +175,7 @@ public class EssentialsConf extends YamlConfiguration
istr = resourceClass.getResourceAsStream(templateName);
if (istr == null)
{
LOGGER.log(Level.SEVERE, _("couldNotFindTemplate", templateName));
LOGGER.log(Level.SEVERE, _("Could not find template {0}", templateName));
return;
}
ostr = new FileOutputStream(configFile);
@@ -190,7 +190,7 @@ public class EssentialsConf extends YamlConfiguration
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, _("failedToWriteConfig", configFile.toString()), ex);
LOGGER.log(Level.SEVERE, _("Failed to write config {0}", configFile.toString()), ex);
}
finally
{
@@ -214,7 +214,7 @@ public class EssentialsConf extends YamlConfiguration
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, _("failedToCloseConfig", configFile.toString()), ex);
LOGGER.log(Level.SEVERE, _("Failed to close config {0}", configFile.toString()), ex);
}
}
}

View File

@@ -174,4 +174,4 @@ public interface ISettings
public int getMailsPerMinute();
public void setEssentialsChatActive(boolean b);
}
}

View File

@@ -446,7 +446,7 @@ public final class Settings implements ISettings
}
catch (Exception ex)
{
logger.log(Level.SEVERE, _("unknownItemInList", itemName, "item-spawn-blacklist"));
logger.log(Level.SEVERE, _("Unknown item {0} in {1} list.", itemName, "item-spawn-blacklist"));
}
}
return epItemSpwn;
@@ -483,7 +483,7 @@ public final class Settings implements ISettings
}
catch (Exception ex)
{
logger.log(Level.SEVERE, _("unknownItemInList", signName, "enabledSigns"));
logger.log(Level.SEVERE, _("Unknown item {0} in {1} list.", signName, "enabledSigns"));
continue;
}
signsEnabled = true;
@@ -579,7 +579,7 @@ public final class Settings implements ISettings
}
catch (Exception ex)
{
logger.log(Level.SEVERE, _("unknownItemInList", itemName, configName));
logger.log(Level.SEVERE, _("Unknown item {0} in {1} list.", itemName, configName));
}
}
return list;
@@ -950,4 +950,4 @@ public final class Settings implements ISettings
{
return mailsPerMinute;
}
}
}

View File

@@ -794,4 +794,4 @@ public class UserData
{
config.save();
}
}
}

View File

@@ -108,4 +108,4 @@ public class Util
}
return input.substring(pos, pos + 2);
}
}
}