add locales

This commit is contained in:
okx-code
2018-11-27 17:14:11 +00:00
parent c90dccee0d
commit 861644566d
8 changed files with 313 additions and 548 deletions
@@ -1,8 +1,5 @@
package sh.okx.rankup.messages;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public enum Variable {
PLAYER,
OLD_RANK,
@@ -18,11 +15,5 @@ public enum Variable {
PERCENT_DONE,
PERCENT_LEFT,
SECONDS,
SECONDS_LEFT;
public String replace(String message, String value, String type) {
Pattern pattern = Pattern.compile("\\{" + type + "_" + this + "}", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(message);
return matcher.replaceAll(value);
}
SECONDS_LEFT
}