mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Merge pull request #2558 from IntellectualSites/more-translation-strings
Add translation messages for flag errors
This commit is contained in:
commit
e8bf3f0d2c
@ -702,7 +702,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
+ " is using Offline Mode UUIDs either because of user preference, or because you are using an old version of "
|
||||
+ "Bukkit");
|
||||
} else {
|
||||
PlotSquared.log(Captions.PREFIX + "" + getPluginName() + " is using online UUIDs");
|
||||
PlotSquared.log(Captions.PREFIX + "&6" + getPluginName() + " is using online UUIDs");
|
||||
}
|
||||
if (Settings.UUID.USE_SQLUUIDHANDLER) {
|
||||
return new SQLUUIDHandler(wrapper);
|
||||
|
@ -548,7 +548,21 @@ public enum Captions {
|
||||
FLAG_CATEGORY_BOOLEAN("Boolean Flags", "Flags"),
|
||||
FLAG_CATEGORY_MIXED("Mixed Value Flags", "Flags"),
|
||||
//</editor-fold>
|
||||
|
||||
//<editor-fold desc="Flag category errors">
|
||||
FLAG_ERROR_BOOLEAN("Flag value must be a boolean (true|false)", "Flags"),
|
||||
FLAG_ERROR_ENUM("Must be one of: %s", "Flags"),
|
||||
FLAG_ERROR_GAMEMODE("Flag value must be a gamemode: 'survival', 'creative', 'adventure' or 'spectator.", "Flags"),
|
||||
FLAG_ERROR_INTEGER("Flag value must be a whole number", "Flags"),
|
||||
FLAG_ERROR_INTEGER_LIST("Flag value must be an integer list", "Flags"),
|
||||
FLAG_ERROR_INTERVAL("Value(s) must be numeric. /plot set flag <flag> <interval> [amount]", "Flags"),
|
||||
FLAG_ERROR_KEEP("Flag value must be a timestamp or a boolean", "Flags"),
|
||||
FLAG_ERROR_LONG("Flag value must be a whole number (large numbers allowed)", "Flags"),
|
||||
FLAG_ERROR_PLOTBLOCKLIST("Flag value must be a block list", "Flags"),
|
||||
FLAG_ERROR_PRICE("Flag value must be a positive number.", "Flags"),
|
||||
FLAG_ERROR_STRING("Flag value must be alphanumeric. Some special characters are allowed.", "Flags"),
|
||||
FLAG_ERROR_STRINGLIST("Flag value must be a string list", "Flags"),
|
||||
FLAG_ERROR_WEATHER("Flag must be a weather: 'rain' or 'sun'", "Flags"),
|
||||
//</editor-fold>
|
||||
//<editor-fold desc="Trusted">
|
||||
TRUSTED_ADDED("$4You successfully trusted a user to the plot", "Trusted"),
|
||||
WAS_NOT_ADDED("$2That player was not trusted on this plot", "Trusted"),
|
||||
|
@ -31,7 +31,7 @@ public class BooleanFlag extends Flag<Boolean> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a boolean (true|false)";
|
||||
return Captions.FLAG_ERROR_BOOLEAN.getTranslated();
|
||||
}
|
||||
|
||||
public boolean isTrue(Plot plot) {
|
||||
|
@ -22,6 +22,6 @@ public class DoubleFlag extends Flag<Double> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a number.";
|
||||
return Captions.FLAG_ERROR_BOOLEAN.getTranslated();
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,6 @@ public class EnumFlag extends Flag<String> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Must be one of: " + StringMan.getString(values);
|
||||
return Captions.FLAG_ERROR_ENUM.getTranslated() + StringMan.getString(values);
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public final class Flags {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a positive number.";
|
||||
return Captions.FLAG_ERROR_PRICE.getTranslated();
|
||||
}
|
||||
};
|
||||
public static final BooleanFlag EXPLOSION = new BooleanFlag("explosion");
|
||||
@ -114,7 +114,7 @@ public final class Flags {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a timestamp or a boolean";
|
||||
return Captions.FLAG_ERROR_KEEP.getTranslated();
|
||||
}
|
||||
};
|
||||
public static final TeleportDenyFlag DENY_TELEPORT = new TeleportDenyFlag("deny-teleport");
|
||||
|
@ -37,6 +37,6 @@ public class GameModeFlag extends Flag<PlotGameMode> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a gamemode: 'survival', 'creative', 'adventure' or 'spectator'";
|
||||
return Captions.FLAG_ERROR_GAMEMODE.getTranslated();
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ public class IntegerFlag extends Flag<Integer> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a whole number";
|
||||
return Captions.FLAG_ERROR_INTEGER.getTranslated();
|
||||
}
|
||||
|
||||
@Override public String valueToString(Object value) {
|
||||
|
@ -27,6 +27,6 @@ public class IntegerListFlag extends ListFlag<List<Integer>> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be an integer list";
|
||||
return Captions.FLAG_ERROR_INTEGER_LIST.getTranslated();
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ public class IntervalFlag extends Flag<IntervalFlag.Interval> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Value(s) must be numeric. /plot set flag <flag> <interval> [amount]";
|
||||
return Captions.FLAG_ERROR_INTERVAL.getTranslated();
|
||||
}
|
||||
|
||||
@EqualsAndHashCode @RequiredArgsConstructor @Getter public static final class Interval {
|
||||
|
@ -21,6 +21,6 @@ public class LongFlag extends Flag<Long> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a whole number (large numbers allowed)";
|
||||
return Captions.FLAG_ERROR_LONG.getTranslated();
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,6 @@ public class PlotBlockListFlag extends ListFlag<HashSet<PlotBlock>> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a block list";
|
||||
return Captions.FLAG_ERROR_PLOTBLOCKLIST.getTranslated();
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,6 @@ public class PlotWeatherFlag extends Flag<PlotWeather> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag must be a weather: 'rain' or 'sun'";
|
||||
return Captions.FLAG_ERROR_WEATHER.getTranslated();
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,6 @@ public class StringFlag extends Flag<String> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be alphanumeric. Some special characters are allowed.";
|
||||
return Captions.FLAG_ERROR_STRING.getTranslated();
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,6 @@ public class StringListFlag extends ListFlag<List<String>> {
|
||||
}
|
||||
|
||||
@Override public String getValueDescription() {
|
||||
return "Flag value must be a string list";
|
||||
return Captions.FLAG_ERROR_STRINGLIST.getTranslated();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user