diff --git a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java index 56918026..d563f33c 100644 --- a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java +++ b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java @@ -17,7 +17,6 @@ import fr.xephi.authme.settings.Settings; import fr.xephi.authme.util.GeoLiteAPI; import fr.xephi.authme.util.Utils; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -243,9 +242,7 @@ public class AuthMePlayerListener implements Listener { String realName = auth.getRealName(); if (!realName.isEmpty() && !realName.equals("Player") && !realName.equals(event.getName())) { event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER); - // TODO: Add a message like : MessageKey.INVALID_NAME_CASE - event.setKickMessage("You should join using username: " + ChatColor.AQUA + realName + - ChatColor.RESET + "\nnot: " + ChatColor.RED + event.getName()); + event.setKickMessage(m.retrieveSingle(MessageKey.INVALID_NAME_CASE, realName, event.getName())); return; } if (realName.isEmpty() || realName.equals("Player")) { diff --git a/src/main/java/fr/xephi/authme/output/MessageKey.java b/src/main/java/fr/xephi/authme/output/MessageKey.java index d5e60120..45cdc0be 100644 --- a/src/main/java/fr/xephi/authme/output/MessageKey.java +++ b/src/main/java/fr/xephi/authme/output/MessageKey.java @@ -127,7 +127,9 @@ public enum MessageKey { TWO_FACTOR_CREATE("two_factor_create", "%code", "%url"), - NOT_OWNER_ERROR("not_owner_error"); + NOT_OWNER_ERROR("not_owner_error"), + + INVALID_NAME_CASE("invalid_name_case", "%valid", "%invalid"); private String key; private String[] tags; diff --git a/src/main/java/fr/xephi/authme/output/Messages.java b/src/main/java/fr/xephi/authme/output/Messages.java index 5afba472..9ea87f44 100644 --- a/src/main/java/fr/xephi/authme/output/Messages.java +++ b/src/main/java/fr/xephi/authme/output/Messages.java @@ -55,17 +55,7 @@ public class Messages { * @param replacements The replacements to apply for the tags */ public void send(CommandSender sender, MessageKey key, String... replacements) { - String message = retrieveSingle(key); - String[] tags = key.getTags(); - if (replacements.length == tags.length) { - for (int i = 0; i < tags.length; ++i) { - message = message.replace(tags[i], replacements[i]); - } - } else { - ConsoleLogger.showError("Invalid number of replacements for message key '" + key + "'"); - send(sender, key); - } - + String message = retrieveSingle(key, replacements); for (String line : message.split("\n")) { sender.sendMessage(line); } @@ -99,6 +89,27 @@ public class Messages { return StringUtils.join("\n", retrieve(key)); } + /** + * Retrieve the given message code with the given tag replacements. Note that this method + * logs an error if the number of supplied replacements doesn't correspond to the number of tags + * the message key contains. + * + * @param key The key of the message to send + * @param replacements The replacements to apply for the tags + */ + public String retrieveSingle(MessageKey key, String... replacements) { + String message = retrieveSingle(key); + String[] tags = key.getTags(); + if (replacements.length == tags.length) { + for (int i = 0; i < tags.length; ++i) { + message = message.replace(tags[i], replacements[i]); + } + } else { + ConsoleLogger.showError("Invalid number of replacements for message key '" + key + "'"); + } + return message; + } + /** * Reload the messages manager. * diff --git a/src/main/resources/messages/messages_bg.yml b/src/main/resources/messages/messages_bg.yml index 4370c00b..94e32f38 100644 --- a/src/main/resources/messages/messages_bg.yml +++ b/src/main/resources/messages/messages_bg.yml @@ -58,6 +58,7 @@ antibot_auto_disabled: '[AuthMe] AntiBotMod автоматично изключ # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO invalid_session: '&cYour IP has been changed and your session data has expired!' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_br.yml b/src/main/resources/messages/messages_br.yml index dfaab23d..24662777 100644 --- a/src/main/resources/messages/messages_br.yml +++ b/src/main/resources/messages/messages_br.yml @@ -44,7 +44,7 @@ usage_captcha: '&3Para logar você deve resolver o captcha, por favor use o coma wrong_captcha: '&cCaptcha inválido, por favor escreva "/captcha THE_CAPTCHA"' valid_captcha: '&2Código do captcha correto!' kick_forvip: '&3Um vip entrou no servidor!' -kick_fullserver: '&4Servidor esta cheio! Para entrar mesmo cheio compre vip no site www.site.com.br' +kick_fullserver: '&4Servidor esta cheio, tente outra vez mais tarde' usage_email_add: '&cUse: /email add ' usage_email_change: '&cUse: /email change ' usage_email_recovery: '&cUse: /email recovery ' @@ -56,10 +56,10 @@ email_confirm: '&cPor favor confirme o email!' email_changed: '&2Email mudado com sucesso!' email_send: '&2Email de recuperação enviado com sucesso! !' email_exists: '&cUm email de recuperação já foi enviado! Você pode reenviar outro usando o comando:' -country_banned: '&4Seu país foi banido do servidor! Your country is banned from this server!' +country_banned: '&4Seu país foi banido do servidor!' antibot_auto_enabled: '&4[AntiBotService] AntiBot ativado devido ao grande número de conexões!' antibot_auto_disabled: '&2[AntiBotService] AntiBot desativado após %m minutos!' -# TODO two_factor_create: Missing tag %url -two_factor_create: '&2Seu código secreto é %code' -# TODO email_already_used: '&4The email address is already being used' -# TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file +two_factor_create: '&2Seu código secreto é %code. Você pode escanear ele daqui %url' +email_already_used: '&4Este endereço de email já está em uso' +not_owner_error: 'Você não é o dono desta conta. Por favor, tente outro nome!' +invalid_name_case: 'Você deve entrar usando %valid, não %invalid.' diff --git a/src/main/resources/messages/messages_cz.yml b/src/main/resources/messages/messages_cz.yml index d56a6d42..580a12bc 100644 --- a/src/main/resources/messages/messages_cz.yml +++ b/src/main/resources/messages/messages_cz.yml @@ -58,5 +58,6 @@ antibot_auto_disabled: '[AuthMe] AntiBotMod automaticky ukoncen po %m minutach, # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_de.yml b/src/main/resources/messages/messages_de.yml index eb62ce30..942460ac 100644 --- a/src/main/resources/messages/messages_de.yml +++ b/src/main/resources/messages/messages_de.yml @@ -60,4 +60,5 @@ kick_antibot: 'AntiBotMod ist aktiviert! Bitte warte einige Minuten, bevor du di # TODO two_factor_create: Missing tag %url two_factor_create: '&2Dein geheimer Code ist %code' # TODO email_already_used: '&4The email address is already being used' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_en.yml b/src/main/resources/messages/messages_en.yml index 0b7c96bf..64aa9099 100644 --- a/src/main/resources/messages/messages_en.yml +++ b/src/main/resources/messages/messages_en.yml @@ -60,3 +60,4 @@ antibot_auto_disabled: '&2[AntiBotService] AntiBot disabled disabled after %m mi email_already_used: '&4The email address is already being used' two_factor_create: '&2Your secret code is %code. You can scan it from here %url' not_owner_error: 'You are not the owner of this account. Please try another name!' +invalid_name_case: 'You should join using username %valid, not %invalid.' diff --git a/src/main/resources/messages/messages_es.yml b/src/main/resources/messages/messages_es.yml index 6fd0dbc1..df415952 100644 --- a/src/main/resources/messages/messages_es.yml +++ b/src/main/resources/messages/messages_es.yml @@ -59,5 +59,6 @@ antibot_auto_disabled: '[AuthMe] AntiBotMod desactivado automáticamente luego d # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_eu.yml b/src/main/resources/messages/messages_eu.yml index bddf751d..b490aeeb 100644 --- a/src/main/resources/messages/messages_eu.yml +++ b/src/main/resources/messages/messages_eu.yml @@ -52,6 +52,7 @@ country_banned: '[AuthMe] Zure herrialdea blokeatuta dago zerbitzari honetan' # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO antibot_auto_enabled: '&4[AntiBotService] AntiBot enabled due to the huge number of connections!' # TODO invalid_session: '&cYour IP has been changed and your session data has expired!' # TODO wrong_captcha: '&cWrong captcha, please type "/captcha THE_CAPTCHA" into the chat!' diff --git a/src/main/resources/messages/messages_fi.yml b/src/main/resources/messages/messages_fi.yml index 2e26e512..80e6cd4f 100644 --- a/src/main/resources/messages/messages_fi.yml +++ b/src/main/resources/messages/messages_fi.yml @@ -55,6 +55,7 @@ email_send: '[AuthMe] Palautus sähköposti lähetetty!' # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO country_banned: '&4Your country is banned from this server!' # TODO antibot_auto_enabled: '&4[AntiBotService] AntiBot enabled due to the huge number of connections!' # TODO antibot_auto_disabled: '&2[AntiBotService] AntiBot disabled disabled after %m minutes!' diff --git a/src/main/resources/messages/messages_fr.yml b/src/main/resources/messages/messages_fr.yml index 31a94471..153cceb4 100644 --- a/src/main/resources/messages/messages_fr.yml +++ b/src/main/resources/messages/messages_fr.yml @@ -61,4 +61,5 @@ email_exists: '&cUn email de restauration a déjà été envoyé ! Vous pouvez l # TODO two_factor_create: Missing tag %url two_factor_create: '&2Votre code secret est %code' # TODO email_already_used: '&4The email address is already being used' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_gl.yml b/src/main/resources/messages/messages_gl.yml index 3dfeb88d..1562e3a3 100644 --- a/src/main/resources/messages/messages_gl.yml +++ b/src/main/resources/messages/messages_gl.yml @@ -60,5 +60,6 @@ antibot_auto_disabled: '[AuthMe] AntiBotMod desactivouse automáticamente despo # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_hu.yml b/src/main/resources/messages/messages_hu.yml index 50436454..b3f22882 100644 --- a/src/main/resources/messages/messages_hu.yml +++ b/src/main/resources/messages/messages_hu.yml @@ -58,5 +58,6 @@ antibot_auto_enabled: '&4[AntiBot] Az AntiBot védelem bekapcsolt a nagy számú antibot_auto_disabled: '&2[AntiBot] Az AntiBot kikapcsol %m múlva!' kick_antibot: 'Az AntiBot védelem bekapcsolva! Kérünk várj pár másodpercet a csatlakozáshoz.' # TODO email_already_used: '&4The email address is already being used' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_id.yml b/src/main/resources/messages/messages_id.yml index 52835756..24e6a35b 100644 --- a/src/main/resources/messages/messages_id.yml +++ b/src/main/resources/messages/messages_id.yml @@ -55,6 +55,7 @@ antibot_auto_enabled: '&4[AntiBotService] AntiBot diaktifkan dikarenakan banyak antibot_auto_disabled: '&2[AntiBotService] AntiBot dimatikan setelah %m menit!' # TODO email_already_used: '&4The email address is already being used' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO country_banned: '&4Your country is banned from this server!' # TODO usage_unreg: '&cUsage: /unregister ' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' diff --git a/src/main/resources/messages/messages_it.yml b/src/main/resources/messages/messages_it.yml index abc943fc..e7c77c89 100644 --- a/src/main/resources/messages/messages_it.yml +++ b/src/main/resources/messages/messages_it.yml @@ -60,4 +60,5 @@ antibot_auto_disabled: "Il servizio di AntiBot è stato automaticamente disabili kick_antibot: 'Il servizio di AntiBot è attualmente attivo! Devi aspettare qualche minuto prima di poter entrare nel server.' two_factor_create: '&2Il tuo codice segreto è: &f%code&n&2Puoi anche scannerizzare il codice QR da qui: &f%url' # TODO email_already_used: '&4The email address is already being used' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_ko.yml b/src/main/resources/messages/messages_ko.yml index 32ad6166..ab122309 100644 --- a/src/main/resources/messages/messages_ko.yml +++ b/src/main/resources/messages/messages_ko.yml @@ -61,5 +61,6 @@ antibot_auto_disabled: '[AuthMe] 봇차단모드가 %m 분 후에 자동적으 # TODO password_error_nick: '&cYou can''t use your name as password, please choose another one...' # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_lt.yml b/src/main/resources/messages/messages_lt.yml index a432b62a..fce26d1b 100644 --- a/src/main/resources/messages/messages_lt.yml +++ b/src/main/resources/messages/messages_lt.yml @@ -46,6 +46,7 @@ kick_fullserver: '&cServeris yra pilnas, Atsiprasome.' # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO new_email_invalid: '&cInvalid new email, try again!' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO email_send: '&2Recovery email sent successfully! Please check your email inbox!' # TODO usage_email_recovery: '&cUsage: /email recovery ' # TODO email_confirm: '&cPlease confirm your email address!' diff --git a/src/main/resources/messages/messages_nl.yml b/src/main/resources/messages/messages_nl.yml index bf662ce7..a3159e48 100644 --- a/src/main/resources/messages/messages_nl.yml +++ b/src/main/resources/messages/messages_nl.yml @@ -59,5 +59,6 @@ kick_antibot: 'AntiBot is aangezet! Wacht alsjeblieft enkele minuten voor je met two_factor_create: '&2Je geheime code is %code' # TODO email_already_used: '&4The email address is already being used' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO reg_email_msg: '&3Please, register to the server with the command "/register "' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_pl.yml b/src/main/resources/messages/messages_pl.yml index 506995bd..c6cba56f 100644 --- a/src/main/resources/messages/messages_pl.yml +++ b/src/main/resources/messages/messages_pl.yml @@ -55,6 +55,7 @@ email_send: '[AuthMe] Email z odzyskaniem wyslany!' # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO country_banned: '&4Your country is banned from this server!' # TODO antibot_auto_enabled: '&4[AntiBotService] AntiBot enabled due to the huge number of connections!' # TODO antibot_auto_disabled: '&2[AntiBotService] AntiBot disabled disabled after %m minutes!' diff --git a/src/main/resources/messages/messages_pt.yml b/src/main/resources/messages/messages_pt.yml index 5b11aea6..64428a52 100644 --- a/src/main/resources/messages/messages_pt.yml +++ b/src/main/resources/messages/messages_pt.yml @@ -59,5 +59,6 @@ antibot_auto_disabled: '[AuthMe] AntiBotMod desactivado automaticamente após %m # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_ru.yml b/src/main/resources/messages/messages_ru.yml index 3c34794e..2b9dd640 100644 --- a/src/main/resources/messages/messages_ru.yml +++ b/src/main/resources/messages/messages_ru.yml @@ -58,5 +58,6 @@ antibot_auto_disabled: '&a[AuthMe] AntiBot-режим автоматичски # TODO email_already_used: '&4The email address is already being used' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_sk.yml b/src/main/resources/messages/messages_sk.yml index 1366e2a9..77433f62 100644 --- a/src/main/resources/messages/messages_sk.yml +++ b/src/main/resources/messages/messages_sk.yml @@ -38,28 +38,29 @@ name_len: '&cTvoje meno je velmi krátke alebo dlhé' regex: '&cTvoje meno obsahuje zakázané znaky. Povolené znaky: REG_EX' add_email: '&cPridaj svoj e-mail príkazom "/email add email zopakujEmail"' recovery_email: '&cZabudol si heslo? Pouzi príkaz /email recovery ' -# TODO email_already_used: '&4The email address is already being used' -# TODO password_error_nick: '&cYou can''t use your name as password, please choose another one...' # TODO usage_email_change: '&cUsage: /email change ' -# TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' +# TODO password_error_nick: '&cYou can''t use your name as password, please choose another one...' +# TODO email_already_used: '&4The email address is already being used' # TODO new_email_invalid: '&cInvalid new email, try again!' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' -# TODO email_send: '&2Recovery email sent successfully! Please check your email inbox!' -# TODO email_confirm: '&cPlease confirm your email address!' -# TODO usage_captcha: '&3To login you have to solve a captcha code, please use the command "/captcha "' -# TODO usage_email_recovery: '&cUsage: /email recovery ' -# TODO email_changed: '&2Email address changed correctly!' # TODO old_email_invalid: '&cInvalid old email, try again!' +# TODO email_changed: '&2Email address changed correctly!' # TODO antibot_auto_disabled: '&2[AntiBotService] AntiBot disabled disabled after %m minutes!' -# TODO kick_fullserver: '&4The server is full, try again later!' -# TODO email_added: '&2Email address successfully added to your account!' -# TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' # TODO country_banned: '&4Your country is banned from this server!' -# TODO antibot_auto_enabled: '&4[AntiBotService] AntiBot enabled due to the huge number of connections!' -# TODO email_invalid: '&cInvalid email address, try again!' -# TODO kick_forvip: '&3A VIP player has joined the server when it was full!' # TODO usage_email_add: '&cUsage: /email add ' # TODO wrong_captcha: '&cWrong captcha, please type "/captcha THE_CAPTCHA" into the chat!' # TODO valid_captcha: '&2Captcha code solved correctly!' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' +# TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' +# TODO email_send: '&2Recovery email sent successfully! Please check your email inbox!' +# TODO usage_email_recovery: '&cUsage: /email recovery ' +# TODO usage_captcha: '&3To login you have to solve a captcha code, please use the command "/captcha "' +# TODO email_confirm: '&cPlease confirm your email address!' +# TODO kick_fullserver: '&4The server is full, try again later!' +# TODO email_added: '&2Email address successfully added to your account!' +# TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO kick_forvip: '&3A VIP player has joined the server when it was full!' +# TODO email_invalid: '&cInvalid email address, try again!' +# TODO antibot_auto_enabled: '&4[AntiBotService] AntiBot enabled due to the huge number of connections!' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_tr.yml b/src/main/resources/messages/messages_tr.yml index b3603929..0e118de0 100644 --- a/src/main/resources/messages/messages_tr.yml +++ b/src/main/resources/messages/messages_tr.yml @@ -58,5 +58,6 @@ antibot_auto_disabled: '[AuthMe] AntiBotMode %m dakika sonra otomatik olarak isg # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_uk.yml b/src/main/resources/messages/messages_uk.yml index 6c5db173..df5710f9 100644 --- a/src/main/resources/messages/messages_uk.yml +++ b/src/main/resources/messages/messages_uk.yml @@ -59,5 +59,6 @@ antibot_auto_disabled: '[AuthMe] AntiBotMod автоматично вимкну # TODO email_already_used: '&4The email address is already being used' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_vn.yml b/src/main/resources/messages/messages_vn.yml index 2df8588a..262b7b73 100644 --- a/src/main/resources/messages/messages_vn.yml +++ b/src/main/resources/messages/messages_vn.yml @@ -59,5 +59,6 @@ antibot_auto_disabled: '[AuthMe] AntiBot tự huỷ kích hoạt sau %m phút, h # TODO password_error_unsafe: '&cThe chosen password isn''t safe, please choose another one...' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_zhcn.yml b/src/main/resources/messages/messages_zhcn.yml index d1f71209..3c7fa1a2 100644 --- a/src/main/resources/messages/messages_zhcn.yml +++ b/src/main/resources/messages/messages_zhcn.yml @@ -63,5 +63,6 @@ antibot_auto_disabled: '&8[&6用戶系統&8] 防止機械人程序檢查到不 # TODO email_already_used: '&4The email address is already being used' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' # TODO email_exists: '&cA recovery email was already sent! You can discard it and send a new one using the command below:' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_zhhk.yml b/src/main/resources/messages/messages_zhhk.yml index e18f4109..2eacb1f6 100644 --- a/src/main/resources/messages/messages_zhhk.yml +++ b/src/main/resources/messages/messages_zhhk.yml @@ -63,4 +63,5 @@ email_already_used: '&4邮箱已被使用' kick_antibot: '[AuthMe] 防机器人程序已启用 !请稍等几分钟後才再次进入服务器' email_exists: '&c恢复邮件已发送 ! 你可以丢弃它然後使用以下的指令来发送新的邮件:' two_factor_create: '&2你的代码是 %code,你可以使用 %url 来扫描' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/main/resources/messages/messages_zhtw.yml b/src/main/resources/messages/messages_zhtw.yml index 61ed5d88..d31431f4 100644 --- a/src/main/resources/messages/messages_zhtw.yml +++ b/src/main/resources/messages/messages_zhtw.yml @@ -63,5 +63,6 @@ antibot_auto_enabled: '&b【AuthMe】&6AntiBotMod已自動啟用!' antibot_auto_disabled: '&b【AuthMe】&6AntiBotMod將會於 &c%m &6分鐘後自動關閉' # TODO email_already_used: '&4The email address is already being used' # TODO kick_antibot: 'AntiBot protection mode is enabled! You have to wait some minutes before joining the server.' +# TODO invalid_name_case: 'You should join using username %valid, not %invalid.' # TODO two_factor_create: '&2Your secret code is %code. You can scan it from here %url' # TODO not_owner_error: 'You are not the owner of this account. Please try another name!' \ No newline at end of file diff --git a/src/test/java/fr/xephi/authme/output/MessagesIntegrationTest.java b/src/test/java/fr/xephi/authme/output/MessagesIntegrationTest.java index 5ff79b9d..39955365 100644 --- a/src/test/java/fr/xephi/authme/output/MessagesIntegrationTest.java +++ b/src/test/java/fr/xephi/authme/output/MessagesIntegrationTest.java @@ -266,4 +266,16 @@ public class MessagesIntegrationTest { assertThat(messages.retrieveSingle(MessageKey.MUST_REGISTER_MESSAGE), equalTo("Message from default file")); } + + @Test + public void shouldRetrieveMessageWithReplacements() { + // given + MessageKey key = MessageKey.CAPTCHA_WRONG_ERROR; + + // when + String result = messages.retrieveSingle(key, "24680"); + + // then + assertThat(result, equalTo("Use /captcha 24680 to solve the captcha")); + } }