Added header and footer to help message (translatable)

+ Fixed translations with one or more equal signs in its value
This commit is contained in:
Eric 2017-06-08 14:01:23 +02:00
parent 6aa0c0b07c
commit 408abebbfa
6 changed files with 25 additions and 0 deletions

View File

@ -214,6 +214,10 @@ public class ShopCommand {
plugin.debug("Sending basic help message to " + sender.getName());
sender.sendMessage(" ");
String header = LanguageUtils.getMessage(LocalizedMessage.Message.COMMAND_DESC_HEADER,
new LocalizedMessage.ReplacedPlaceholder(Placeholder.COMMAND, plugin.getShopChestConfig().main_command_name));
if (!header.trim().isEmpty()) sender.sendMessage(header);
for (ShopSubCommand subCommand : subCommands) {
String msg = subCommand.getHelpMessage(sender);
@ -224,6 +228,10 @@ public class ShopCommand {
sender.sendMessage(msg);
}
String footer = LanguageUtils.getMessage(LocalizedMessage.Message.COMMAND_DESC_FOOTER,
new LocalizedMessage.ReplacedPlaceholder(Placeholder.COMMAND, plugin.getShopChestConfig().main_command_name));
if (!footer.trim().isEmpty()) sender.sendMessage(footer);
sender.sendMessage(" ");
}

View File

@ -83,6 +83,9 @@ public class LanguageConfiguration extends FileConfiguration {
StringBuilder sbValue = new StringBuilder();
for (int i = 1; i < line.split("=").length; i++) {
if (i > 1) {
sbValue.append("=");
}
sbValue.append(line.split("=")[i]);
}

View File

@ -1077,6 +1077,8 @@ public class LanguageUtils {
messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_CONFIG, langConfig.getString("message.noPermission.config", "&cYou don't have permission to change configuration values.")));
messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_EXTEND_OTHERS, langConfig.getString("message.noPermission.extend-others", "&cYou don't have permission to extend this chest.")));
messages.add(new LocalizedMessage(LocalizedMessage.Message.NO_PERMISSION_EXTEND_PROTECTED, langConfig.getString("message.noPermission.extend-protected", "&cYou don't have permission to extend this chest to here.")));
messages.add(new LocalizedMessage(LocalizedMessage.Message.COMMAND_DESC_HEADER, langConfig.getString("message.commandDescription.header", "&6==== &c/%COMMAND% &6Help")));
messages.add(new LocalizedMessage(LocalizedMessage.Message.COMMAND_DESC_FOOTER, langConfig.getString("message.commandDescription.footer", "&6==== End")));
messages.add(new LocalizedMessage(LocalizedMessage.Message.COMMAND_DESC_CREATE, langConfig.getString("message.commandDescription.create", "&a/%COMMAND% create <amount> <buy-price> <sell-price> - Create a shop.")));
messages.add(new LocalizedMessage(LocalizedMessage.Message.COMMAND_DESC_CREATE_ADMIN, langConfig.getString("message.commandDescription.create-admin", "&a/%COMMAND% create <amount> <buy-price> <sell-price> [normal|admin] - Create a shop.")));
messages.add(new LocalizedMessage(LocalizedMessage.Message.COMMAND_DESC_REMOVE, langConfig.getString("message.commandDescription.remove", "&a/%COMMAND% remove - Remove a shop.")));

View File

@ -108,6 +108,8 @@ public class LocalizedMessage {
NO_PERMISSION_CONFIG,
NO_PERMISSION_EXTEND_OTHERS,
NO_PERMISSION_EXTEND_PROTECTED,
COMMAND_DESC_HEADER,
COMMAND_DESC_FOOTER,
COMMAND_DESC_CREATE,
COMMAND_DESC_CREATE_ADMIN,
COMMAND_DESC_REMOVE,

View File

@ -78,6 +78,8 @@ message.noPermission.update=&cDu hast keine Berechtigung nach Aktualisierungen z
message.noPermission.config=&cDu hast keine Berechtigung Konfigurationswerte zu verändern.
message.noPermission.extend-others=&cDu hast keine Berechtigung diesen Shop zu erweitern.
message.noPermission.extend-protected=&cDu hast keine Berechtigung diesen Shop nach hier zu erweitern.
message.commandDescription.header=&6==== &c/%COMMAND% &6Hilfe
message.commandDescription.footer=&6==== Ende
message.commandDescription.create=&a/%COMMAND% create <amount> <buy-price> <sell-price> - Erstelle einen Shop.
message.commandDescription.create-admin=&a/%COMMAND% create <amount> <buy-price> <sell-price> [normal|admin] - Erstelle einen Shop.
message.commandDescription.remove=&a/%COMMAND% remove - Entferne einen Shop.

View File

@ -272,6 +272,14 @@ message.noPermission.extend-others=&cYou don't have permission to extend this ch
# Set the message when a not permitted player tries to extend a chest into a protected region/plot (e.g. WorldGuard/Towny).
message.noPermission.extend-protected=&cYou don't have permission to extend this chest to here.
# Set the header of the help message the player gets after entering '/shop' or an invalid command.
# Usable Placeholders: %COMMAND%
message.commandDescription.header=&6==== &c/%COMMAND% &6Help
# Set the footer of the help message the player gets after entering '/shop' or an invalid command.
# Usable Placeholders: %COMMAND%
message.commandDescription.footer=&6==== End
# Set the command description message for '/shop create' when you type '/shop'.
# Usable Placeholders: %COMMAND%
message.commandDescription.create=&a/%COMMAND% create <amount> <buy-price> <sell-price> - Create a shop.