Skip to content

Commit 082dffa

Browse files
committed
Issue #1024 - further improvements to i18n for commands (107 commands in total)
1 parent 6fc4f16 commit 082dffa

43 files changed

Lines changed: 433 additions & 84 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/AdminCommand.java

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
package us.talabrek.ultimateskyblock.command;
22

3+
import dk.lockfuglsang.minecraft.animation.AnimationHandler;
34
import dk.lockfuglsang.minecraft.command.AbstractCommandExecutor;
45
import dk.lockfuglsang.minecraft.command.DocumentCommand;
5-
import dk.lockfuglsang.minecraft.po.I18nUtil;
66
import org.bukkit.command.CommandSender;
77
import org.bukkit.command.TabCompleter;
8-
import dk.lockfuglsang.minecraft.animation.AnimationHandler;
9-
import us.talabrek.ultimateskyblock.command.admin.*;
8+
import us.talabrek.ultimateskyblock.command.admin.AbstractPlayerInfoCommand;
9+
import us.talabrek.ultimateskyblock.command.admin.AdminChallengeCommand;
10+
import us.talabrek.ultimateskyblock.command.admin.AdminIslandCommand;
11+
import us.talabrek.ultimateskyblock.command.admin.ConfigGUICommand;
12+
import us.talabrek.ultimateskyblock.command.admin.CooldownCommand;
13+
import us.talabrek.ultimateskyblock.command.admin.DebugCommand;
14+
import us.talabrek.ultimateskyblock.command.admin.FlatlandFixCommand;
15+
import us.talabrek.ultimateskyblock.command.admin.FlushCommand;
16+
import us.talabrek.ultimateskyblock.command.admin.GenTopTenCommand;
17+
import us.talabrek.ultimateskyblock.command.admin.GotoIslandCommand;
18+
import us.talabrek.ultimateskyblock.command.admin.ImportCommand;
19+
import us.talabrek.ultimateskyblock.command.admin.JobsCommand;
20+
import us.talabrek.ultimateskyblock.command.admin.LanguageCommand;
21+
import us.talabrek.ultimateskyblock.command.admin.NBTCommand;
22+
import us.talabrek.ultimateskyblock.command.admin.OrphanCommand;
23+
import us.talabrek.ultimateskyblock.command.admin.PerkCommand;
24+
import us.talabrek.ultimateskyblock.command.admin.ProtectAllCommand;
25+
import us.talabrek.ultimateskyblock.command.admin.PurgeCommand;
26+
import us.talabrek.ultimateskyblock.command.admin.RegionCommand;
27+
import us.talabrek.ultimateskyblock.command.admin.ReloadCommand;
28+
import us.talabrek.ultimateskyblock.command.admin.SetMaintenanceCommand;
29+
import us.talabrek.ultimateskyblock.command.admin.VersionCommand;
30+
import us.talabrek.ultimateskyblock.command.admin.WGCommand;
1031
import us.talabrek.ultimateskyblock.command.completion.AllPlayerTabCompleter;
1132
import us.talabrek.ultimateskyblock.command.completion.BiomeTabCompleter;
1233
import us.talabrek.ultimateskyblock.command.completion.ChallengeTabCompleter;
@@ -16,12 +37,14 @@
1637
import us.talabrek.ultimateskyblock.player.PlayerInfo;
1738
import us.talabrek.ultimateskyblock.uSkyBlock;
1839

40+
import static dk.lockfuglsang.minecraft.po.I18nUtil.marktr;
41+
1942
/**
2043
* The new admin command, alias /usb
2144
*/
2245
public class AdminCommand extends AbstractCommandExecutor {
2346
public AdminCommand(final uSkyBlock plugin, ConfirmHandler confirmHandler, AnimationHandler animationHandler) {
24-
super("usb", null, I18nUtil.tr("Ultimate SkyBlock Admin"));
47+
super("usb", null, marktr("Ultimate SkyBlock Admin"));
2548
OnlinePlayerTabCompleter playerCompleter = new OnlinePlayerTabCompleter();
2649
TabCompleter challengeCompleter = new ChallengeTabCompleter();
2750
TabCompleter allPlayerCompleter = new AllPlayerTabCompleter(playerCompleter);
@@ -42,7 +65,7 @@ public AdminCommand(final uSkyBlock plugin, ConfirmHandler confirmHandler, Anima
4265
add(new AdminIslandCommand(plugin, confirmHandler));
4366
add(new PurgeCommand(plugin));
4467
add(new GotoIslandCommand(plugin));
45-
add(new AbstractPlayerInfoCommand("info", "usb.admin.info", I18nUtil.tr("show player-information")) {
68+
add(new AbstractPlayerInfoCommand("info", "usb.admin.info", marktr("show player-information")) {
4669
@Override
4770
protected void doExecute(CommandSender sender, PlayerInfo playerInfo) {
4871
sender.sendMessage(playerInfo.toString());

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/AdminChallengeCommand.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
import dk.lockfuglsang.minecraft.command.AbstractCommand;
44
import dk.lockfuglsang.minecraft.command.CompositeCommand;
55
import dk.lockfuglsang.minecraft.po.I18nUtil;
6+
import dk.lockfuglsang.minecraft.util.FormatUtil;
67
import org.bukkit.command.CommandSender;
7-
import org.bukkit.command.TabCompleter;
88
import us.talabrek.ultimateskyblock.challenge.Challenge;
99
import us.talabrek.ultimateskyblock.challenge.ChallengeCompletion;
10-
import us.talabrek.ultimateskyblock.command.completion.RankTabCompleter;
1110
import us.talabrek.ultimateskyblock.player.PlayerInfo;
1211
import us.talabrek.ultimateskyblock.uSkyBlock;
13-
import dk.lockfuglsang.minecraft.util.FormatUtil;
1412

1513
import java.util.Arrays;
1614
import java.util.List;
1715
import java.util.Map;
1816

17+
import static dk.lockfuglsang.minecraft.po.I18nUtil.marktr;
18+
1919
/**
2020
* The challenge admin command.
2121
*/
@@ -24,7 +24,7 @@ public class AdminChallengeCommand extends CompositeCommand {
2424
private final uSkyBlock plugin;
2525

2626
public AdminChallengeCommand(final uSkyBlock plugin) {
27-
super("challenge|ch", "usb.mod.challenges", "player", I18nUtil.tr("Manage challenges for a player"));
27+
super("challenge|ch", "usb.mod.challenges", "player", marktr("Manage challenges for a player"));
2828
this.plugin = plugin;
2929
add(new ChallengeCommand("complete", null, "completes the challenge for the player") {
3030
@Override
@@ -33,7 +33,7 @@ protected void doExecute(CommandSender sender, PlayerInfo playerInfo, ChallengeC
3333
completeChallenge(sender, playerInfo, challenge);
3434
}
3535
});
36-
add(new ChallengeCommand("reset", null, I18nUtil.tr("resets the challenge for the player")) {
36+
add(new ChallengeCommand("reset", null, marktr("resets the challenge for the player")) {
3737
@Override
3838
protected void doExecute(CommandSender sender, PlayerInfo pi, ChallengeCompletion completion) {
3939
String challenge = completion.getName();
@@ -47,7 +47,7 @@ protected void doExecute(CommandSender sender, PlayerInfo pi, ChallengeCompletio
4747
}
4848
}
4949
});
50-
add(new AbstractCommand("resetall", null, I18nUtil.tr("resets all challenges for the player")) {
50+
add(new AbstractCommand("resetall", null, marktr("resets all challenges for the player")) {
5151
@Override
5252
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
5353
PlayerInfo playerInfo = (PlayerInfo) data.get("playerInfo");
@@ -60,7 +60,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
6060
return false;
6161
}
6262
});
63-
add(new RankCommand("rank", null, I18nUtil.tr("complete all challenges in the rank")) {
63+
add(new RankCommand("rank", null, marktr("complete all challenges in the rank")) {
6464
@Override
6565
protected void doExecute(CommandSender sender, PlayerInfo playerInfo, String rankName, List<Challenge> challenges) {
6666
for (Challenge c : challenges) {

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/AdminIslandCommand.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
import org.bukkit.Bukkit;
66
import org.bukkit.block.Biome;
77
import org.bukkit.command.CommandSender;
8-
import org.bukkit.command.TabCompleter;
98
import org.bukkit.entity.Player;
10-
import us.talabrek.ultimateskyblock.command.admin.task.ProtectAllTask;
119
import us.talabrek.ultimateskyblock.handler.ConfirmHandler;
1210
import us.talabrek.ultimateskyblock.handler.WorldGuardHandler;
1311
import us.talabrek.ultimateskyblock.island.IslandInfo;
@@ -28,13 +26,13 @@ public class AdminIslandCommand extends CompositeCommand {
2826
public AdminIslandCommand(final uSkyBlock plugin, final ConfirmHandler confirmHandler) {
2927
super("island|is", "", marktr("manage islands"));
3028
this.plugin = plugin;
31-
add(new AbstractIslandInfoCommand("protect", "usb.admin.protect", tr("protects the island")) {
29+
add(new AbstractIslandInfoCommand("protect", "usb.admin.protect", marktr("protects the island")) {
3230
@Override
3331
protected void doExecute(CommandSender sender, PlayerInfo playerInfo, IslandInfo islandInfo, String... args) {
3432
protectIsland(sender, islandInfo);
3533
}
3634
});
37-
add(new AbstractCommand("delete", "usb.admin.delete", "?leader", tr("delete the island (removes the blocks)")) {
35+
add(new AbstractCommand("delete", "usb.admin.delete", "?leader", marktr("delete the island (removes the blocks)")) {
3836
@Override
3937
public boolean execute(final CommandSender sender, String alias, Map<String, Object> data, String... args) {
4038
if (args.length == 1) {
@@ -63,13 +61,13 @@ public void run() {
6361
return false;
6462
}
6563
});
66-
add(new AbstractIslandInfoCommand("remove", "usb.admin.remove", tr("removes the player from the island")) {
64+
add(new AbstractIslandInfoCommand("remove", "usb.admin.remove", marktr("removes the player from the island")) {
6765
@Override
6866
protected void doExecute(CommandSender sender, PlayerInfo playerInfo, IslandInfo islandInfo, String... args) {
6967
removePlayerFromIsland(sender, playerInfo, islandInfo);
7068
}
7169
});
72-
add(new AbstractCommand("addmember|add", "usb.admin.addmember", "player ?island", tr("adds the player to the island")) {
70+
add(new AbstractCommand("addmember|add", "usb.admin.addmember", "player ?island", marktr("adds the player to the island")) {
7371
@Override
7472
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
7573
IslandInfo islandInfo = null;
@@ -95,13 +93,13 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
9593
return false;
9694
}
9795
});
98-
add(new AbstractIslandInfoCommand("info", "usb.admin.info", tr("print out info about the island")) {
96+
add(new AbstractIslandInfoCommand("info", "usb.admin.info", marktr("print out info about the island")) {
9997
@Override
10098
protected void doExecute(CommandSender sender, PlayerInfo playerInfo, IslandInfo islandInfo, String... args) {
10199
sender.sendMessage(islandInfo.toString());
102100
}
103101
});
104-
add(new AbstractCommand("setbiome", "usb.admin.setbiome", "?leader biome", tr("sets the biome of the island")) {
102+
add(new AbstractCommand("setbiome", "usb.admin.setbiome", "?leader biome", marktr("sets the biome of the island")) {
105103
@Override
106104
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
107105
if (args.length == 2) {
@@ -129,7 +127,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
129127
return false;
130128
}
131129
});
132-
add(new AbstractCommand("purge", "usb.admin.purge", "?leader", tr("purges the island")) {
130+
add(new AbstractCommand("purge", "usb.admin.purge", "?leader", marktr("purges the island")) {
133131
@Override
134132
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
135133
String cmd = "/usb island purge";
@@ -161,7 +159,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
161159
});
162160
add(new MakeLeaderCommand(plugin));
163161
add(new RegisterIslandToPlayerCommand());
164-
add(new AbstractIslandInfoCommand("ignore", "usb.admin.ignore", tr("toggles the islands ignore status")) {
162+
add(new AbstractIslandInfoCommand("ignore", "usb.admin.ignore", marktr("toggles the islands ignore status")) {
165163
@Override
166164
protected void doExecute(CommandSender sender, PlayerInfo playerInfo, IslandInfo islandInfo, String... args) {
167165
if (islandInfo != null) {

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/CooldownCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
public class CooldownCommand extends CompositeCommand {
2424
public CooldownCommand(final uSkyBlock plugin) {
2525
super("cooldown|cd", "usb.admin.cooldown", marktr("Controls player-cooldowns"));
26-
add(new AbstractCommand("clear|c", null, "player command", tr("clears the cooldown on a command (* = all)")) {
26+
add(new AbstractCommand("clear|c", null, "player command", marktr("clears the cooldown on a command (* = all)")) {
2727
@Override
2828
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
2929
if (args.length < 2) {
@@ -47,7 +47,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
4747
}
4848
}
4949
});
50-
add(new AbstractCommand("restart|r", null, "player", tr("restarts the cooldown on the command")) {
50+
add(new AbstractCommand("restart|r", null, "player", marktr("restarts the cooldown on the command")) {
5151
@Override
5252
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
5353
if (args.length < 2) {
@@ -69,7 +69,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
6969
}
7070
}
7171
});
72-
add(new AbstractCommand("list|l", null, "?player", tr("lists all the active cooldowns")) {
72+
add(new AbstractCommand("list|l", null, "?player", marktr("lists all the active cooldowns")) {
7373
@Override
7474
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
7575
if (args.length < 1) {

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/DebugCommand.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import java.util.logging.LogRecord;
2121
import java.util.logging.Logger;
2222

23+
import static dk.lockfuglsang.minecraft.po.I18nUtil.marktr;
24+
2325
/**
2426
* Debug control.
2527
*/
@@ -28,8 +30,8 @@ public class DebugCommand extends CompositeCommand {
2830
private static Handler logHandler = null;
2931

3032
public DebugCommand(final uSkyBlock plugin) {
31-
super("debug", "usb.admin.debug", I18nUtil.tr("control debugging"));
32-
add(new AbstractCommand("setlevel", null, "level", I18nUtil.tr("set debug-level")) {
33+
super("debug", "usb.admin.debug", marktr("control debugging"));
34+
add(new AbstractCommand("setlevel", null, "level", marktr("set debug-level")) {
3335
@Override
3436
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
3537
if (args.length == 1) {
@@ -39,7 +41,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
3941
return false;
4042
}
4143
});
42-
add(new AbstractCommand("enable|disable", null, I18nUtil.tr("toggle debug-logging")) {
44+
add(new AbstractCommand("enable|disable", null, marktr("toggle debug-logging")) {
4345
@Override
4446
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
4547
if (logHandler != null && alias.equals("disable")) {
@@ -52,7 +54,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
5254
return true;
5355
}
5456
});
55-
add(new AbstractCommand("flush", null, I18nUtil.tr("flush current content of the logger to file.")) {
57+
add(new AbstractCommand("flush", null, marktr("flush current content of the logger to file.")) {
5658
@Override
5759
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
5860
if (logHandler != null) {

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/FlatlandFixCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import java.util.Map;
1414

15+
import static dk.lockfuglsang.minecraft.po.I18nUtil.marktr;
1516
import static dk.lockfuglsang.minecraft.po.I18nUtil.tr;
1617

1718
/**
@@ -21,7 +22,7 @@ public class FlatlandFixCommand extends AbstractCommand {
2122
private final uSkyBlock plugin;
2223

2324
public FlatlandFixCommand(uSkyBlock plugin) {
24-
super("fix-flatland", "usb.admin.remove", "?player", I18nUtil.tr("tries to fix the the area of flatland."));
25+
super("fix-flatland", "usb.admin.remove", "?player", marktr("tries to fix the the area of flatland."));
2526
this.plugin = plugin;
2627
}
2728

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/GotoIslandCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import us.talabrek.ultimateskyblock.player.PlayerInfo;
77
import us.talabrek.ultimateskyblock.uSkyBlock;
88

9+
import static dk.lockfuglsang.minecraft.po.I18nUtil.marktr;
910
import static dk.lockfuglsang.minecraft.po.I18nUtil.tr;
1011

1112
/**
@@ -15,7 +16,7 @@ public class GotoIslandCommand extends AbstractPlayerInfoCommand {
1516
private final uSkyBlock plugin;
1617

1718
public GotoIslandCommand(uSkyBlock plugin) {
18-
super("goto", "usb.mod.goto", I18nUtil.tr("teleport to another players island"));
19+
super("goto", "usb.mod.goto", marktr("teleport to another players island"));
1920
this.plugin = plugin;
2021
}
2122

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/JobsCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.util.List;
1313
import java.util.Map;
1414

15+
import static dk.lockfuglsang.minecraft.po.I18nUtil.marktr;
1516
import static dk.lockfuglsang.minecraft.po.I18nUtil.tr;
1617

1718
/**
@@ -21,7 +22,7 @@ public class JobsCommand extends CompositeCommand {
2122
private final uSkyBlock plugin;
2223

2324
public JobsCommand(uSkyBlock plugin) {
24-
super("jobs|j", "usb.admin.jobs", "controls async jobs");
25+
super("jobs|j", "usb.admin.jobs", marktr("controls async jobs"));
2526
this.plugin = plugin;
2627
/*
2728
add(new AbstractCommand("list|l", "usb.admin.jobs.list", "list all jobs") {

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/MakeLeaderCommand.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111

1212
import java.util.Map;
1313

14+
import static dk.lockfuglsang.minecraft.po.I18nUtil.marktr;
15+
1416
/**
1517
* Allows transfer of leadership to another player.
1618
*/
1719
public class MakeLeaderCommand extends AbstractCommand {
1820
private final uSkyBlock plugin;
1921

2022
public MakeLeaderCommand(uSkyBlock plugin) {
21-
super("makeleader|transfer", "usb.admin.makeleader", "leader oplayer", I18nUtil.tr("transfer leadership to another player"));
23+
super("makeleader|transfer", "usb.admin.makeleader", "leader oplayer", marktr("transfer leadership to another player"));
2224
this.plugin = plugin;
2325
}
2426

@@ -55,7 +57,7 @@ public void run() {
5557
islandPlayer.save();
5658
playerInfo.save();
5759
WorldGuardHandler.updateRegion(islandInfo);
58-
islandInfo.sendMessageToIslandGroup(true, I18nUtil.marktr("\u00a7bLeadership transferred by {0}\u00a7b to {1}"), sender.getName(), playerName);
60+
islandInfo.sendMessageToIslandGroup(true, marktr("\u00a7bLeadership transferred by {0}\u00a7b to {1}"), sender.getName(), playerName);
5961
}
6062
});
6163
return true;

uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/command/admin/NBTCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class NBTCommand extends CompositeCommand {
2121
public NBTCommand() {
2222
super("nbt", "usb.admin.nbt", marktr("advanced info about NBT stuff"));
23-
add(new AbstractCommand("info|i", tr("shows the NBTTag for the currently held item")) {
23+
add(new AbstractCommand("info|i", marktr("shows the NBTTag for the currently held item")) {
2424
@Override
2525
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
2626
if (sender instanceof Player) {
@@ -42,7 +42,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
4242
return false;
4343
}
4444
});
45-
add(new AbstractCommand("set|s", null, "nbttag", tr("sets the NBTTag on the currently held item")) {
45+
add(new AbstractCommand("set|s", null, "nbttag", marktr("sets the NBTTag on the currently held item")) {
4646
@Override
4747
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
4848
if (sender instanceof Player) {
@@ -64,7 +64,7 @@ public boolean execute(CommandSender sender, String alias, Map<String, Object> d
6464
return false;
6565
}
6666
});
67-
add(new AbstractCommand("add|a", null, "nbttag", tr("adds the NBTTag on the currently held item")) {
67+
add(new AbstractCommand("add|a", null, "nbttag", marktr("adds the NBTTag on the currently held item")) {
6868
@Override
6969
public boolean execute(CommandSender sender, String alias, Map<String, Object> data, String... args) {
7070
if (sender instanceof Player) {

0 commit comments

Comments
 (0)