1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-22 22:34:43 +02:00

More translation stuff. Translated Spawn, Chat, Protect, GeoIP

Protect is only partly translated (sql stuff is not translated)
EssentialsSpawn is changed to use the onCommand from Essentials jar, since that is more up to date.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1408 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo
2011-05-10 19:57:59 +00:00
parent 8e1f018104
commit e846093fd0
13 changed files with 76 additions and 109 deletions

View File

@@ -1,6 +1,7 @@
package com.earth2me.essentials.geoip;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.event.Event.Priority;
@@ -38,8 +39,11 @@ public class EssentialsGeoIP extends JavaPlugin
EssentialsGeoIPPlayerListener playerListener = new EssentialsGeoIPPlayerListener(getDataFolder());
pm.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this);
logger.info("Loaded " + this.getDescription().getName() + " build " + this.getDescription().getVersion() + " by " + Essentials.AUTHORS);
if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) {
logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
}
logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), Essentials.AUTHORS));
logger.log(Level.INFO, "This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.");
}
}

View File

@@ -4,6 +4,7 @@ import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.EssentialsConf;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import com.maxmind.geoip.Location;
import com.maxmind.geoip.LookupService;
import com.maxmind.geoip.regionName;
@@ -83,7 +84,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
{
User user = ess.getUser(player);
if (user.isAuthorized("essentials.geoip.show")) {
user.sendMessage("Player " + u.getDisplayName() + " comes from " + sb.toString());
user.sendMessage(Util.format("geoipJoinFormat", u.getDisplayName(), sb.toString()));
}
}
}
@@ -110,7 +111,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
else
{
logger.log(Level.SEVERE, "Can't find GeoIP database!");
logger.log(Level.SEVERE, Util.i18n("cantFindGeoIpDB"));
return;
}
}
@@ -120,7 +121,7 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
catch (IOException ex)
{
logger.log(Level.SEVERE, "Failed to read GeoIP database!", ex);
logger.log(Level.SEVERE, Util.i18n("cantReadGeoIpDB"), ex);
}
}
@@ -139,10 +140,10 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
if (url == null || url.isEmpty())
{
logger.log(Level.SEVERE, "GeoIP download url is empty.");
logger.log(Level.SEVERE, Util.i18n("geoIpUrlEmpty"));
return;
}
logger.log(Level.INFO, "Downloading GeoIP database ... this might take a while (country: 0.6 MB, city: 20MB)");
logger.log(Level.INFO, Util.i18n("downloadingGeoIp"));
URL downloadUrl = new URL(url);
URLConnection conn = downloadUrl.openConnection();
conn.setConnectTimeout(10000);
@@ -165,12 +166,12 @@ public class EssentialsGeoIPPlayerListener extends PlayerListener implements ICo
}
catch (MalformedURLException ex)
{
logger.log(Level.SEVERE, "GeoIP download url is invalid.", ex);
logger.log(Level.SEVERE, Util.i18n("geoIpUrlInvalid"), ex);
return;
}
catch (IOException ex)
{
logger.log(Level.SEVERE, "Failed to open connection.", ex);
logger.log(Level.SEVERE, Util.i18n("connectionFailed"), ex);
}
}
}