Changed a few locale references for consistency

Removed `general.errors.you-need` to put the [permission] variable in the `general.errors.no-permission`.
Renamed all confirmation-related references to `commands.confirmation.xxx`.
Renamed `protection.panel.flag-item.xxx_rank` to use a dash instead of an underscore.
This commit is contained in:
Florian CUNY 2018-08-12 18:47:31 +02:00
parent 2fee163818
commit 3212b7180d
6 changed files with 22 additions and 21 deletions

View File

@ -237,8 +237,7 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
} }
// Check perms, but only if this isn't the console // Check perms, but only if this isn't the console
if ((sender instanceof Player) && !sender.isOp() && !cmd.getPermission().isEmpty() && !sender.hasPermission(cmd.getPermission())) { if ((sender instanceof Player) && !sender.isOp() && !cmd.getPermission().isEmpty() && !sender.hasPermission(cmd.getPermission())) {
user.sendMessage("general.errors.no-permission"); user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, cmd.getPermission());
user.sendMessage("general.errors.you-need", TextVariables.PERMISSION, cmd.getPermission());
return false; return false;
} }
// Fire an event to see if this command should be cancelled // Fire an event to see if this command should be cancelled
@ -732,14 +731,14 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi
return; return;
} else { } else {
// Player has another outstanding confirmation request that will now be cancelled // Player has another outstanding confirmation request that will now be cancelled
user.sendMessage("general.previous-request-cancelled"); user.sendMessage("commands.confirmation.previous-request-cancelled");
} }
} }
// Tell user that they need to confirm // Tell user that they need to confirm
user.sendMessage("general.confirm", "[seconds]", String.valueOf(getSettings().getConfirmationTime())); user.sendMessage("commands.confirmation.confirm", "[seconds]", String.valueOf(getSettings().getConfirmationTime()));
// Set up a cancellation task // Set up a cancellation task
BukkitTask task = Bukkit.getScheduler().runTaskLater(getPlugin(), () -> { BukkitTask task = Bukkit.getScheduler().runTaskLater(getPlugin(), () -> {
user.sendMessage("general.request-cancelled"); user.sendMessage("commands.confirmation.request-cancelled");
toBeConfirmed.remove(user); toBeConfirmed.remove(user);
}, getPlugin().getSettings().getConfirmationTime() * 20L); }, getPlugin().getSettings().getConfirmationTime() * 20L);

View File

@ -221,11 +221,11 @@ public class Flag implements Comparable<Flag> {
pib.description(d); pib.description(d);
plugin.getRanksManager().getRanks().forEach((reference, score) -> { plugin.getRanksManager().getRanks().forEach((reference, score) -> {
if (score > RanksManager.BANNED_RANK && score < island.getFlag(this)) { if (score > RanksManager.BANNED_RANK && score < island.getFlag(this)) {
pib.description(user.getTranslation("protection.panel.flag-item.blocked_rank") + user.getTranslation(reference)); pib.description(user.getTranslation("protection.panel.flag-item.blocked-rank") + user.getTranslation(reference));
} else if (score <= RanksManager.OWNER_RANK && score > island.getFlag(this)) { } else if (score <= RanksManager.OWNER_RANK && score > island.getFlag(this)) {
pib.description(user.getTranslation("protection.panel.flag-item.allowed_rank") + user.getTranslation(reference)); pib.description(user.getTranslation("protection.panel.flag-item.allowed-rank") + user.getTranslation(reference));
} else if (score == island.getFlag(this)) { } else if (score == island.getFlag(this)) {
pib.description(user.getTranslation("protection.panel.flag-item.minimal_rank") + user.getTranslation(reference)); pib.description(user.getTranslation("protection.panel.flag-item.minimal-rank") + user.getTranslation(reference));
} }
}); });
} }

View File

@ -5,6 +5,7 @@ import org.bukkit.event.inventory.ClickType;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.flags.Flag; import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.panels.Panel; import world.bentobox.bentobox.api.panels.Panel;
import world.bentobox.bentobox.api.panels.PanelItem; import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;
@ -39,7 +40,7 @@ public class CycleClick implements PanelItem.ClickHandler {
String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings." + id; String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings." + id;
if (!user.hasPermission(reqPerm)) { if (!user.hasPermission(reqPerm)) {
user.sendMessage("general.errors.no-permission"); user.sendMessage("general.errors.no-permission");
user.sendMessage("general.errors.you-need", "[permission]", reqPerm); user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, reqPerm);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F); user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true; return true;
} }

View File

@ -8,6 +8,7 @@ import org.bukkit.event.inventory.ClickType;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.flags.Flag; import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.panels.Panel; import world.bentobox.bentobox.api.panels.Panel;
import world.bentobox.bentobox.api.panels.PanelItem.ClickHandler; import world.bentobox.bentobox.api.panels.PanelItem.ClickHandler;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;
@ -41,7 +42,7 @@ public class IslandToggleClick implements ClickHandler {
String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings." + id; String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".settings." + id;
if (!user.hasPermission(reqPerm)) { if (!user.hasPermission(reqPerm)) {
user.sendMessage("general.errors.no-permission"); user.sendMessage("general.errors.no-permission");
user.sendMessage("general.errors.you-need", "[permission]", reqPerm); user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, reqPerm);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F); user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true; return true;
} }

View File

@ -8,6 +8,7 @@ import org.bukkit.event.inventory.ClickType;
import world.bentobox.bentobox.BentoBox; import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.flags.Flag; import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.panels.Panel; import world.bentobox.bentobox.api.panels.Panel;
import world.bentobox.bentobox.api.panels.PanelItem.ClickHandler; import world.bentobox.bentobox.api.panels.PanelItem.ClickHandler;
import world.bentobox.bentobox.api.user.User; import world.bentobox.bentobox.api.user.User;
@ -39,8 +40,7 @@ public class WorldToggleClick implements ClickHandler {
} }
String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".admin.world.settings." + id; String reqPerm = plugin.getIWM().getPermissionPrefix(Util.getWorld(user.getWorld())) + ".admin.world.settings." + id;
if (!user.hasPermission(reqPerm)) { if (!user.hasPermission(reqPerm)) {
user.sendMessage("general.errors.no-permission"); user.sendMessage("general.errors.no-permission", TextVariables.PERMISSION, reqPerm);
user.sendMessage("general.errors.you-need", "[permission]", reqPerm);
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F); user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true; return true;
} }

View File

@ -12,12 +12,9 @@ meta:
general: general:
success: "&aSuccess!" success: "&aSuccess!"
request-cancelled: "&cConfirmation timeout - &brequest cancelled"
previous-request-cancelled: "&6Previous confirmation request cancelled"
confirm: "&cType command again within &b[seconds]s&c to confirm"
errors: errors:
command-cancelled: "&cCommand cancelled" command-cancelled: "&cCommand cancelled"
no-permission: "&cYou don't have permission to execute this command." no-permission: "&cYou don't have the permission to execute this command (&7[permission])&c."
use-in-game: "&cThis command is only available in game." use-in-game: "&cThis command is only available in game."
no-team: "&cYou do not have a team!" no-team: "&cYou do not have a team!"
no-island: "&cYou do not have an island!" no-island: "&cYou do not have an island!"
@ -35,7 +32,6 @@ general:
warp-not-safe: "&cThat warp is not safe right now!" warp-not-safe: "&cThat warp is not safe right now!"
wrong-world: "&cYou are not in the right world to do that!" wrong-world: "&cYou are not in the right world to do that!"
you-must-wait: "&cYou must wait [number]s before you can do that command again" you-must-wait: "&cYou must wait [number]s before you can do that command again"
you-need: "&cYou need [permission]"
tips: tips:
changing-obsidian-to-lava: "Changing obsidian back into lava. Be careful!" changing-obsidian-to-lava: "Changing obsidian back into lava. Be careful!"
@ -184,7 +180,11 @@ commands:
loaded-addons: "Loaded Add-Ons" loaded-addons: "Loaded Add-Ons"
loaded-game-worlds: "Loaded Game Worlds" loaded-game-worlds: "Loaded Game Worlds"
addon-syntax: "&2[name] &3[version]" addon-syntax: "&2[name] &3[version]"
game-worlds: "&2[name]" game-worlds: "&2[name]"
confirmation:
confirm: "&cType command again within &b[seconds]s&c to confirm"
previous-request-cancelled: "&6Previous confirmation request cancelled"
request-cancelled: "&cConfirmation timeout - &brequest cancelled"
island: island:
go: go:
parameters: "[home number]" parameters: "[home number]"
@ -630,9 +630,9 @@ protection:
&a[description] &a[description]
&7Allowed for: &7Allowed for:
allowed_rank: "&3- &a" allowed-rank: "&3- &a"
blocked_rank: "&3- &c" blocked-rank: "&3- &c"
minimal_rank: "&3- &2" minimal-rank: "&3- &2"
menu-layout: "&a[description]" menu-layout: "&a[description]"
setting-layout: | setting-layout: |
&a[description] &a[description]