[Core/Core Cogs] Prevent translation errors and use formatting utils (#5435)

* Use proper syntax for inline formatting in core_commands

* use proper formating utils in core and core cogs wherever reasonable

* tests are awesome

* ensure "(continued)" is translated in help.py

* add colons to translatable strings for easier context comprehension by translators

* Thx flame :)

Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>

* good point

Co-authored-by: Dav <dav@mail.stopdavabuse.de>
Co-authored-by: Flame442 <34169552+Flame442@users.noreply.github.com>
This commit is contained in:
Dav
2022-02-16 01:25:21 +00:00
committed by GitHub
parent 9ab307c1ef
commit c6517d5087
8 changed files with 111 additions and 90 deletions

View File

@@ -564,19 +564,13 @@ class Mutes(VoiceMutes, commands.Cog, metaclass=CompositeMetaClass):
else:
message = f"{title}\n>>> "
message += reason
message += (f"\n{bold(_('Moderator:'))} {moderator_str}") if show_mod else ""
message += (
_("\n**Moderator**: {moderator}").format(moderator=moderator_str)
if show_mod
else ""
)
message += (
_("\n**Until**: {until}\n**Duration**: {duration}").format(
until=until_str, duration=duration_str
)
(f"\n{bold(_('Until:'))} {until_str}\n{bold(_('Duration:'))} {duration_str}")
if duration
else ""
)
message += _("\n**Guild**: {guild_name}").format(guild_name=guild.name)
message += f"\n{bold(_('Guild:'))} {guild.name}"
try:
await user.send(message)
except discord.Forbidden: