summaryrefslogtreecommitdiffstats
path: root/EssentialsGeoIP
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-10 19:57:59 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-10 19:57:59 +0000
commitbc79d5acfcaf6a112bbc22c9c387999f82d89201 (patch)
tree36cb2703850d497c459123f9a8fe04d22b0be4d7 /EssentialsGeoIP
parent0671150c4255565eb1168780d84a2ef68a3df023 (diff)
downloadEssentials-bc79d5acfcaf6a112bbc22c9c387999f82d89201.tar
Essentials-bc79d5acfcaf6a112bbc22c9c387999f82d89201.tar.gz
Essentials-bc79d5acfcaf6a112bbc22c9c387999f82d89201.tar.lz
Essentials-bc79d5acfcaf6a112bbc22c9c387999f82d89201.tar.xz
Essentials-bc79d5acfcaf6a112bbc22c9c387999f82d89201.zip
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
Diffstat (limited to 'EssentialsGeoIP')
-rw-r--r--EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java8
-rw-r--r--EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java15
2 files changed, 14 insertions, 9 deletions
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
index 1a01c7132..612fa7030 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
@@ -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/.");
}
}
diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
index 071e9f6f7..91d0186e6 100644
--- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
+++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
@@ -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);
}
}
}