Fix stasis messages (both display for adding stasis as well as internal message keys)

This commit is contained in:
skizzerz 2016-01-11 22:56:04 -06:00
parent 281beda634
commit 9d8f77c1e1
2 changed files with 15 additions and 14 deletions

View File

@ -549,12 +549,13 @@
"not_enough_targets": "Not enough valid targets for the {0} template.", "not_enough_targets": "Not enough valid targets for the {0} template.",
"role_skipped": "This role has been skipped for this game.", "role_skipped": "This role has been skipped for this game.",
"stasis_non_negative": "The amount of stasis has to be a non-negative integer.", "stasis_non_negative": "The amount of stasis has to be a non-negative integer.",
"target_in_stasis": "\u0002{0}\u0002 (Host: {1}) is in stasis for \u0002{2}\u0002 game{3}.", "hostmask_in_stasis": "\u0002{0}\u0002 (Host: {1}) is in stasis for \u0002{2}\u0002 game{3}.",
"target_not_in_stasis": "\u0002{0}\u0002 (Host: {1}) is not in stasis.", "hostmask_not_in_stasis": "\u0002{0}\u0002 (Host: {1}) is not in stasis.",
"fstasis_add_success": "\u0002{0}\u0002 (Host: {1}) is now in stasis for \u0002{2}\u0002 game{3}.", "fstasis_hostmask_add": "\u0002{0}\u0002 (Host: {1}) is now in stasis for \u0002{2}\u0002 game{3}.",
"fstasis_remove_success": "\u0002{0}\u0002 (Host: {1}) is no longer in stasis.", "fstasis_hostmask_remove": "\u0002{0}\u0002 (Host: {1}) is no longer in stasis.",
"fstasis_account_add_success": "\u0002{0}\u0002 (Account: {1}) is in stasis for \u0002{2}\u0002 game{3}.", "fstasis_account_add": "\u0002{0}\u0002 (Account: {1}) is now in stasis for \u0002{2}\u0002 game{3}.",
"fstasis_account_remove_success": "\u0002{0}\u0002 (Account: {1}) is no longer in stasis.", "fstasis_account_remove": "\u0002{0}\u0002 (Account: {1}) is no longer in stasis.",
"account_in_stasis": "\u0002{0}\u0002 (Account: {1}) is in stasis for \u0002{2}\u0002 game{3}.",
"account_not_in_stasis": "\u0002{0}\u0002 (Account: {1}) is not in stasis.", "account_not_in_stasis": "\u0002{0}\u0002 (Account: {1}) is not in stasis.",
"currently_stasised": "Currently stasised: {0}", "currently_stasised": "Currently stasised: {0}",
"noone_stasised": "Nobody is currently stasised.", "noone_stasised": "Nobody is currently stasised.",

View File

@ -7701,9 +7701,9 @@ def fstasis(cli, nick, chan, rest):
if len(data) == 1: if len(data) == 1:
if hostmask in var.STASISED: if hostmask in var.STASISED:
plural = "" if var.STASISED[hostmask] == 1 else "s" plural = "" if var.STASISED[hostmask] == 1 else "s"
msg = messages["target_in_stasis"].format(data[0], hostmask, var.STASISED[hostmask], plural) msg = messages["hostmask_in_stasis"].format(data[0], hostmask, var.STASISED[hostmask], plural)
else: else:
msg = messages["target_not_in_stasis"].format(data[0], hostmask) msg = messages["hostmask_not_in_stasis"].format(data[0], hostmask)
else: else:
try: try:
amt = int(data[1]) amt = int(data[1])
@ -7729,19 +7729,19 @@ def fstasis(cli, nick, chan, rest):
var.STASISED[hostmask] = amt var.STASISED[hostmask] = amt
var.set_stasis(hostmask, amt) var.set_stasis(hostmask, amt)
plural = "" if amt == 1 else "s" plural = "" if amt == 1 else "s"
msg = messages["fstasis_add_success"].format(data[0], hostmask, amt, plural) msg = messages["fstasis_hostmask_add"].format(data[0], hostmask, amt, plural)
elif amt == 0: elif amt == 0:
if hostmask in var.STASISED: if hostmask in var.STASISED:
del var.STASISED[hostmask] del var.STASISED[hostmask]
var.set_stasis(hostmask, 0) var.set_stasis(hostmask, 0)
msg = messages["fstasis_remove_success"].format(data[0], hostmask) msg = messages["fstasis_hostmask_remove"].format(data[0], hostmask)
else: else:
msg = messages["target_not_in_stasis"].format(data[0], hostmask) msg = messages["hostmask_not_in_stasis"].format(data[0], hostmask)
if not var.DISABLE_ACCOUNTS and acc: if not var.DISABLE_ACCOUNTS and acc:
if len(data) == 1: if len(data) == 1:
if acc in var.STASISED_ACCS: if acc in var.STASISED_ACCS:
plural = "" if var.STASISED_ACCS[acc] == 1 else "s" plural = "" if var.STASISED_ACCS[acc] == 1 else "s"
msg = messages["fstasis_account_add_success"].format(data[0], acc, var.STASISED_ACCS[acc], plural) msg = messages["account_in_stasis"].format(data[0], acc, var.STASISED_ACCS[acc], plural)
else: else:
msg = messages["account_not_in_stasis"].format(data[0], acc) msg = messages["account_not_in_stasis"].format(data[0], acc)
else: else:
@ -7767,12 +7767,12 @@ def fstasis(cli, nick, chan, rest):
var.STASISED_ACCS[acc] = amt var.STASISED_ACCS[acc] = amt
var.set_stasis_acc(acc, amt) var.set_stasis_acc(acc, amt)
plural = "" if amt == 1 else "s" plural = "" if amt == 1 else "s"
msg = messages["fstasis_account_add_success"].format(data[0], acc, amt, plural) msg = messages["fstasis_account_add"].format(data[0], acc, amt, plural)
elif amt == 0: elif amt == 0:
if acc in var.STASISED_ACCS: if acc in var.STASISED_ACCS:
del var.STASISED_ACCS[acc] del var.STASISED_ACCS[acc]
var.set_stasis_acc(acc, 0) var.set_stasis_acc(acc, 0)
msg = messages["fstasis_account_remove_success"].format(data[0], acc) msg = messages["fstasis_account_remove"].format(data[0], acc)
else: else:
msg = messages["account_not_in_stasis"].format(data[0], acc) msg = messages["account_not_in_stasis"].format(data[0], acc)
elif var.STASISED or var.STASISED_ACCS: elif var.STASISED or var.STASISED_ACCS: