Translate a few more strings

This commit is contained in:
fullwall 2012-09-30 23:23:27 +08:00
parent 0c926293c4
commit 9f5d99904f
4 changed files with 12 additions and 8 deletions

View File

@ -16,6 +16,7 @@ import net.citizensnpcs.api.event.NPCRemoveEvent;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.util.DataKey;
import net.citizensnpcs.editor.Editor;
import net.citizensnpcs.util.Messages;
import net.citizensnpcs.util.Messaging;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.StringHelper;
@ -104,15 +105,14 @@ public class LinearWaypointProvider implements WaypointProvider {
private final Player player;
private boolean showPath;
Map<Waypoint, Entity> waypointMarkers = Maps.newHashMap();
private LinearWaypointEditor(Player player) {
this.player = player;
}
@Override
public void begin() {
Messaging.send(player, ChatColor.AQUA + "Entered the linear waypoint editor!");
Messaging.send(player, "<e>Left click<a> to add a waypoint, <e>right click<a> to remove.");
Messaging.send(player, "<a>Type <e>toggle path<a> to toggle showing entities at waypoints.");
Messaging.sendTr(player, ChatColor.AQUA, Messages.LINEAR_WAYPOINT_EDITOR_BEGIN);
}
private void createWaypointMarker(int index, Waypoint waypoint) {
@ -138,7 +138,7 @@ public class LinearWaypointProvider implements WaypointProvider {
public void end() {
if (!editing)
return;
Messaging.send(player, ChatColor.AQUA + "Exited the linear waypoint editor.");
Messaging.sendTr(player, ChatColor.AQUA, Messages.LINEAR_WAYPOINT_EDITOR_END);
editing = false;
if (!showPath)
return;
@ -204,8 +204,7 @@ public class LinearWaypointProvider implements WaypointProvider {
double distance = at.distanceSquared(prev);
double maxDistance = Math.pow(npc.getNavigator().getDefaultParameters().range(), 2);
if (distance > maxDistance) {
Messaging.sendF(player, ChatColor.RED
+ "Previous waypoint is %s blocks away but the distance limit is %s.",
Messaging.sendErrorTr(player, Messages.LINEAR_WAYPOINT_EDITOR_RANGE_EXCEEDED,
StringHelper.wrap(Math.sqrt(distance), ChatColor.RED),
StringHelper.wrap(Math.sqrt(maxDistance), ChatColor.RED));
return;

View File

@ -68,6 +68,9 @@ public class Messages {
public static final String TEXT_EDITOR_INVALID_INDEX = "citizens.editors.text.invalid-index";
public static final String TEXT_EDITOR_INVALID_INPUT = "citizens.editors.text.invalid-input";
public static final String TEXT_EDITOR_EDIT_BEGIN_PROMPT = "citizens.editors.text.edit-begin-prompt";
public static final String LINEAR_WAYPOINT_EDITOR_BEGIN = "citizens.editors.waypoints.linear.begin-message";
public static final String LINEAR_WAYPOINT_EDITOR_END = "citizens.editors.waypoints.linear.end-message";
public static final String LINEAR_WAYPOINT_EDITOR_RANGE_EXCEEDED = "citizens.editors.waypoints.linear.range-exceeded-message";
private static Properties getDefaultBundleProperties() {
Properties defaults = new Properties();

View File

@ -92,7 +92,6 @@ public class Translator {
}
private static Translator instance;
public static final String PREFIX = "messages";
public static void setInstance(File resourceFile, Locale locale) {

View File

@ -49,4 +49,7 @@ citizens.notifications.database-connection-failed=Unable to connect to database,
citizens.notifications.unknown-npc-type=NPC type '{0}' was not recognized. Did you spell it correctly?
citizens.waypoints.available-providers-message=List of available providers
citizens.waypoints.current-provider-message=The current waypoint provider is {0}.
citizens.waypoints.set-provider-message=Set the waypoint provider to {0}.
citizens.waypoints.set-provider-message=Set the waypoint provider to {0}.
citizens.editors.waypoints.linear.begin-message=Entered the linear waypoint editor!<br><e>Left click<a> to add a waypoint, <e>right click<a> to remove.<br><a>Type <e>toggle path<a> to toggle showing entities at waypoints.
citizens.editors.waypoints.linear.end-message=Exited the linear waypoint editor.
citizens.editors.waypoints.linear.range-exceeded-message=Previous waypoint is {0} blocks away but the distance limit is {1}.