mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[i18n] Start work on named format arguments (#1795)
This commit is contained in:
committed by
Toby Harradine
parent
139329233a
commit
aa8c9c350e
@@ -81,8 +81,11 @@ class Bank(commands.Cog):
|
||||
default_balance = await bank._conf.guild(ctx.guild).default_balance()
|
||||
|
||||
settings = _(
|
||||
"Bank settings:\n\nBank name: {}\nCurrency: {}\nDefault balance: {}"
|
||||
).format(bank_name, currency_name, default_balance)
|
||||
"Bank settings:\n\nBank name: {bank_name}\nCurrency: {currency_name}\n"
|
||||
"Default balance: {default_balance}"
|
||||
).format(
|
||||
bank_name=bank_name, currency_name=currency_name, default_balance=default_balance
|
||||
)
|
||||
await ctx.send(box(settings))
|
||||
|
||||
@bankset.command(name="toggleglobal")
|
||||
@@ -97,26 +100,26 @@ class Bank(commands.Cog):
|
||||
if confirm is False:
|
||||
await ctx.send(
|
||||
_(
|
||||
"This will toggle the bank to be {}, deleting all accounts "
|
||||
"in the process! If you're sure, type `{}`"
|
||||
).format(word, "{}bankset toggleglobal yes".format(ctx.prefix))
|
||||
"This will toggle the bank to be {banktype}, deleting all accounts "
|
||||
"in the process! If you're sure, type `{command}`"
|
||||
).format(banktype=word, command="{}bankset toggleglobal yes".format(ctx.prefix))
|
||||
)
|
||||
else:
|
||||
await bank.set_global(not cur_setting)
|
||||
await ctx.send(_("The bank is now {}.").format(word))
|
||||
await ctx.send(_("The bank is now {banktype}.").format(banktype=word))
|
||||
|
||||
@bankset.command(name="bankname")
|
||||
@check_global_setting_guildowner()
|
||||
async def bankset_bankname(self, ctx: commands.Context, *, name: str):
|
||||
"""Set the bank's name"""
|
||||
await bank.set_bank_name(name, ctx.guild)
|
||||
await ctx.send(_("Bank's name has been set to {}").format(name))
|
||||
await ctx.send(_("Bank name has been set to: {name}").format(name=name))
|
||||
|
||||
@bankset.command(name="creditsname")
|
||||
@check_global_setting_guildowner()
|
||||
async def bankset_creditsname(self, ctx: commands.Context, *, name: str):
|
||||
"""Set the name for the bank's currency"""
|
||||
await bank.set_currency_name(name, ctx.guild)
|
||||
await ctx.send(_("Currency name has been set to {}").format(name))
|
||||
await ctx.send(_("Currency name has been set to: {name}").format(name=name))
|
||||
|
||||
# ENDSECTION
|
||||
|
||||
Reference in New Issue
Block a user