Add balanceTopLine i18n translation string (#3626)

This commit is contained in:
Josh Roy 2020-09-25 22:16:12 -04:00 committed by GitHub
parent 29d5ccf751
commit 5d61a43fe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View File

@ -117,7 +117,7 @@ public class Commandbalancetop extends EssentialsCommand {
cache.getLines().add(tl("serverTotal", NumberUtil.displayCurrency(totalMoney, ess)));
int pos = 1;
for (Map.Entry<String, BigDecimal> entry : sortedEntries) {
cache.getLines().add(pos + ". " + entry.getKey() + ", " + NumberUtil.displayCurrency(entry.getValue(), ess));
cache.getLines().add(tl("balanceTopLine", pos, entry.getKey(), NumberUtil.displayCurrency(entry.getValue(), ess)));
pos++;
}
cacheage = System.currentTimeMillis();

View File

@ -51,13 +51,14 @@ public class TextPager {
return;
} else {
int page = 1;
try {
page = Integer.parseInt(pageStr);
} catch (NumberFormatException ex) {
page = 1;
}
if (page < 1) {
page = 1;
if (pageStr != null) {
try {
page = Integer.parseInt(pageStr);
} catch (NumberFormatException ignored) {
}
if (page < 1) {
page = 1;
}
}
int start = onePage ? 0 : (page - 1) * 9;
@ -101,8 +102,7 @@ public class TextPager {
if (chapterPageStr != null) {
try {
chapterpage = Integer.parseInt(chapterPageStr) - 1;
} catch (NumberFormatException ex) {
chapterpage = 0;
} catch (NumberFormatException ignored) {
}
if (chapterpage < 0) {
chapterpage = 0;

View File

@ -42,6 +42,7 @@ balanceCommandDescription=States the current balance of a player.
balanceCommandUsage=/<command> [player]
balanceOther=\u00a7aBalance of {0}\u00a7a\:\u00a7c {1}
balanceTop=\u00a76Top balances ({0})
balanceTopLine={0}. {1}, {2}
balancetopCommandDescription=Gets the top balance values.
balancetopCommandUsage=/<command> <page>
banCommandDescription=Bans a player.