Fix pluralization of warning points

This commit is contained in:
nyuszika7h 2016-06-28 10:30:20 +02:00
parent 137408d1f4
commit f8ed5c7dbd
2 changed files with 16 additions and 13 deletions

View File

@ -820,10 +820,10 @@
"fwarn_stasis_invalid": "Invalid stasis amount, specify sanction as \"stasis=number\".",
"fwarn_deny_invalid": "Invalid denied commands, specify sanction as \"deny=command,command,command\" (without spaces).",
"fwarn_deny_invalid_command": "Invalid command \"{0}\", specify sanction as \"deny=command,command,command\" (without spaces).",
"fwarn_list_header": "{0} has {1} active warning points. Warnings prefixed with \u0002!\u0002 are unacknowledged.",
"warn_list_header": "You have {0} active warning points. You must acknowledge all warnings prefixed with \u0002!\u0002 by using \"warn ack <id>\" before you can join games.",
"fwarn_list": "{0}{1}[#{2} {3}] to {4} by {5} - {6} ({7} points, {8}){9}",
"warn_list": "{0}{1}[#{2} {3}] {4} ({5} points, {6}){7}",
"fwarn_list_header": "{0} has {1} active warning point{2}. Warnings prefixed with \u0002!\u0002 are unacknowledged.",
"warn_list_header": "You have {0} active warning point{1}. You must acknowledge all warnings prefixed with \u0002!\u0002 by using \"warn ack <id>\" before you can join games.",
"fwarn_list": "{0}{1}[#{2} {3}] to {4} by {5} - {6} ({7} point{8}, {9}){10}",
"warn_list": "{0}{1}[#{2} {3}] {4} ({5} point{6}, {7}){8}",
"fwarn_deleted": "deleted",
"fwarn_expired": "expired",
"fwarn_list_expired": "expired on {0}",
@ -832,8 +832,8 @@
"warn_list_footer": "More results are available, use warn list {0} to view them.",
"fwarn_list_empty": "No results.",
"fwarn_invalid_warning": "The specified warning id does not exist or you do not have permission to view it.",
"fwarn_view_header": "Warning #{0}, given to {1} on {2} by {3}. {4} points. {5}.",
"warn_view_header": "Warning #{0}, given on {1}. {2} points. {3}.",
"fwarn_view_header": "Warning #{0}, given to {1} on {2} by {3}. {4} point{5}. {6}.",
"warn_view_header": "Warning #{0}, given on {1}. {2} point{3}. {4}.",
"fwarn_view_active": "Currently active, {0}",
"fwarn_view_expires": "expires on {0}",
"fwarn_view_expired": "Expired on {0}",

View File

@ -8166,7 +8166,7 @@ def warn(cli, nick, chan, rest):
acc, hm = parse_warning_target(nick)
warnings = db.list_warnings(acc, hm, expired=list_all, skip=(page-1)*10, show=11)
points = db.get_warning_points(acc, hm)
cli.notice(nick, messages["warn_list_header"].format(points))
cli.notice(nick, messages["warn_list_header"].format(points, "" if points == 1 else "s"))
i = 0
for warn in warnings:
@ -8194,7 +8194,8 @@ def warn(cli, nick, chan, rest):
if not warn["ack"]:
ack = "\u0002!\u0002 "
cli.notice(nick, messages["warn_list"].format(
start, ack, warn["id"], warn["issued"], warn["reason"], warn["amount"], expires, end))
start, ack, warn["id"], warn["issued"], warn["reason"], warn["amount"],
"" if warn["amount"] == 1 else "s", expires, end))
if i == 0:
cli.notice(nick, messages["fwarn_list_empty"])
return
@ -8223,7 +8224,8 @@ def warn(cli, nick, chan, rest):
expires = messages["fwarn_view_active"].format(messages["fwarn_view_expires"].format(warning["expires"]))
cli.notice(nick, messages["warn_view_header"].format(
warning["id"], warning["issued"], warning["amount"], expires))
warning["id"], warning["issued"], warning["amount"],
"" if warning["amount"] == 1 else "s", expires))
cli.notice(nick, warning["reason"])
sanctions = []
@ -8357,7 +8359,7 @@ def fwarn(cli, nick, chan, rest):
return
warnings = db.list_warnings(acc, hm, expired=list_all, deleted=list_all, skip=(page-1)*10, show=11)
points = db.get_warning_points(acc, hm)
cli.notice(nick, messages["fwarn_list_header"].format(target, points))
cli.notice(nick, messages["fwarn_list_header"].format(target, points, "" if points == 1 else "s"))
else:
warnings = db.list_all_warnings(list_all=list_all, skip=(page-1)*10, show=11)
@ -8393,7 +8395,8 @@ def fwarn(cli, nick, chan, rest):
ack = "\u0002!\u0002 "
cli.notice(nick, messages["fwarn_list"].format(
start, ack, warn["id"], warn["issued"], warn["target"],
warn["sender"], warn["reason"], warn["amount"], expires, end))
warn["sender"], warn["reason"], warn["amount"],
"" if warn["amount"] == 1 else "s", expires, end))
if i == 0:
cli.notice(nick, messages["fwarn_list_empty"])
return
@ -8424,7 +8427,7 @@ def fwarn(cli, nick, chan, rest):
cli.notice(nick, messages["fwarn_view_header"].format(
warning["id"], warning["target"], warning["issued"], warning["sender"],
warning["amount"], expires))
warning["amount"], "" if warning["amount"] == 1 else "s", expires))
reason = [warning["reason"]]
if warning["notes"] is not None: