mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -05:00
Update Translations (#2486)
Also included a Makefile recipe which makes use of the Crowdin CLI's `crowdin download` command. This requires whoever is using it to provide the project's API key in an environment variable, but we may automate this at some point. Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
@@ -443,7 +443,7 @@ class Mod(commands.Cog):
|
||||
errors = {}
|
||||
|
||||
async def show_results():
|
||||
text = _("Banned {} users from the server.".format(len(banned)))
|
||||
text = _("Banned {num} users from the server.").format(num=len(banned))
|
||||
if errors:
|
||||
text += _("\nErrors:\n")
|
||||
text += "\n".join(errors.values())
|
||||
@@ -474,7 +474,9 @@ class Mod(commands.Cog):
|
||||
for entry in ban_list:
|
||||
for user_id in user_ids:
|
||||
if entry.user.id == user_id:
|
||||
errors[user_id] = _("User {} is already banned.".format(user_id))
|
||||
errors[user_id] = _("User {user_id} is already banned.").format(
|
||||
user_id=user_id
|
||||
)
|
||||
|
||||
user_ids = remove_processed(user_ids)
|
||||
|
||||
@@ -493,9 +495,13 @@ class Mod(commands.Cog):
|
||||
if result is True:
|
||||
banned.append(user_id)
|
||||
else:
|
||||
errors[user_id] = _("Failed to ban user {}: {}".format(user_id, result))
|
||||
errors[user_id] = _("Failed to ban user {user_id}: {reason}").format(
|
||||
user_id=user_id, reason=result
|
||||
)
|
||||
except Exception as e:
|
||||
errors[user_id] = _("Failed to ban user {}: {}".format(user_id, e))
|
||||
errors[user_id] = _("Failed to ban user {user_id}: {reason}").format(
|
||||
user_id=user_id, reason=e
|
||||
)
|
||||
|
||||
user_ids = remove_processed(user_ids)
|
||||
|
||||
@@ -513,11 +519,13 @@ class Mod(commands.Cog):
|
||||
log.info("{}({}) hackbanned {}".format(author.name, author.id, user_id))
|
||||
except discord.NotFound:
|
||||
self.ban_queue.remove(queue_entry)
|
||||
errors[user_id] = _("User {} does not exist.".format(user_id))
|
||||
errors[user_id] = _("User {user_id} does not exist.").format(user_id=user_id)
|
||||
continue
|
||||
except discord.Forbidden:
|
||||
self.ban_queue.remove(queue_entry)
|
||||
errors[user_id] = _("Could not ban {}: missing permissions.".format(user_id))
|
||||
errors[user_id] = _("Could not ban {user_id}: missing permissions.").format(
|
||||
user_id=user_id
|
||||
)
|
||||
continue
|
||||
else:
|
||||
banned.append(user_id)
|
||||
@@ -537,7 +545,7 @@ class Mod(commands.Cog):
|
||||
channel=None,
|
||||
)
|
||||
except RuntimeError as e:
|
||||
errors["0"] = _("Failed to create modlog case: {}".format(e))
|
||||
errors["0"] = _("Failed to create modlog case: {reason}").format(reason=e)
|
||||
|
||||
await show_results()
|
||||
|
||||
@@ -1540,8 +1548,8 @@ class Mod(commands.Cog):
|
||||
except RuntimeError as e:
|
||||
return _(
|
||||
"The user was banned but an error occurred when trying to "
|
||||
"create the modlog entry: {}".format(e)
|
||||
)
|
||||
"create the modlog entry: {reason}"
|
||||
).format(reason=e)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user