Skip to content

Commit

Permalink
fix: added and compacted translation for commands on help
Browse files Browse the repository at this point in the history
  • Loading branch information
EncryptEx committed Jan 11, 2025
1 parent 255c96b commit d55b968
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
19 changes: 13 additions & 6 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ async def help(ctx):

user = await GetTranslatedText(ctx.guild.id, "user")
reason = await GetTranslatedText(ctx.guild.id, "reason")
seconds = await GetTranslatedText(ctx.guild.id, "seconds")
channel = await GetTranslatedText(ctx.guild.id, "channel")
embed.add_field(
name=await GetTranslatedText(ctx.guild.id, "help_moderation_title"),
value=f"""
Expand All @@ -133,17 +135,22 @@ async def help(ctx):

embed.add_field(
name=await GetTranslatedText(ctx.guild.id, "help_chatmod_title"),
value=await GetTranslatedText(ctx.guild.id,
"help_chatmod_description",
COMMAND_PREFIX=COMMAND_PREFIX),
value=f"""
{COMMAND_PREFIX}setdelay [{seconds}] <{reason}>\n
{COMMAND_PREFIX}mute [{user}] <{reason}>\n
{COMMAND_PREFIX}unmute [{user}] <{reason}>\n
{COMMAND_PREFIX}lock <{channel}> <{reason}>\n
{COMMAND_PREFIX}unlock <{channel}> <{reason}>\n
{COMMAND_PREFIX}bulkdelete [{channel}] [{user}] <{reason}>",
""",
inline=True,
)

embed.add_field(
name=await GetTranslatedText(ctx.guild.id, "help_various_title"),
value=await GetTranslatedText(ctx.guild.id,
"help_various_description",
COMMAND_PREFIX=COMMAND_PREFIX),
value=f"""
{COMMAND_PREFIX}whois [{user}]
""",
inline=True,
)

Expand Down
4 changes: 2 additions & 2 deletions langs/cat.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"help_moderation_title": "Comandes de Moderació :tools:",
"user": "usuari",
"reason": "motiu",
"seconds": "segons",
"channel": "canal",
"help_automod_title": "Serveis d'AutoMod :robot:",
"help_automod_description": "Detecta paraules obscenes i adverteix automàticament. \nUtilitza una base de dades de més de 880 paraules obscenes \n\n Personalitza-ho amb:\n {COMMAND_PREFIX}automod [add/remove] [paraula]\nO activa/desactiva-ho amb:\n{COMMAND_PREFIX}settings [automod] [on/off]",
"help_chatmod_title": "Comandes de Moderació de Xat :file_folder:",
"help_chatmod_description": "{COMMAND_PREFIX}setdelay [segons] <motiu>\n{COMMAND_PREFIX}mute [usuari] <motiu>\n{COMMAND_PREFIX}unmute [usuari] <motiu>\n{COMMAND_PREFIX}lock <canal> <motiu>\n{COMMAND_PREFIX}unlock <canal> <motiu>\n",
"help_various_title": "Utilitats Diverses :screwdriver:",
"help_various_description": "{COMMAND_PREFIX}whois [usuari]",
"help_links_title": "Enllaços Útils: :link:",
"help_links_description": "[:classical_building: Suport del Hammer Bot](https://discord.gg/fMSyQA6)\n[:link: Enllaç d'Invitació del Hammer](https://discordapp.com/api/oauth2/authorize?client_id=591633652493058068&permissions=8&scope=bot)\n[:newspaper: Vota per al Hammer](https://top.gg/bot/591633652493058068)]",
"help_commands_title": "Comandes d'Ajuda",
Expand Down
4 changes: 2 additions & 2 deletions langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"help_moderation_title": "Moderation Commands :tools:",
"user": "user",
"reason": "reason",
"seconds": "seconds",
"channel": "channel",
"help_automod_title": "AutoMod Services :robot:",
"help_automod_description": "Swear Word Detector and wuto warn. \n Using a +880 swear word database \n\n Customize it with:\n {COMMAND_PREFIX}automod [add/remove] [word]\nOr switch it on/off with:\n{COMMAND_PREFIX}settings [automod] [on/off]",
"help_chatmod_title": "Chat Moderation Commands :file_folder:",
"help_chatmod_description": "{COMMAND_PREFIX}setdelay [seconds] <reason>\n{COMMAND_PREFIX}mute [user] <reason>\n{COMMAND_PREFIX}unmute [user] <reason>\n{COMMAND_PREFIX}lock <channel> <reason>\n{COMMAND_PREFIX}unlock <channel> <reason>\n",
"help_various_title": "Various Utilities :screwdriver:",
"help_various_description": "{COMMAND_PREFIX}whois [user]",
"help_links_title": "Useful Links: :link:",
"help_links_description": "[:classical_building: Hammer Bot Support](https://discord.gg/fMSyQA6)\n[:link: Hammer Invite Link](https://discordapp.com/api/oauth2/authorize?client_id=591633652493058068&permissions=8&scope=bot)\n[:newspaper: Vote Hammer](https://top.gg/bot/591633652493058068)}",
"help_commands_title": "Help Commands",
Expand Down
4 changes: 2 additions & 2 deletions langs/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"help_moderation_title": "Comandos de Moderación :tools:",
"user": "usuario",
"reason": "razón",
"seconds": "segundos",
"channel": "canal",
"help_automod_title": "Servicios de AutoMod :robot:",
"help_automod_description": "Detector de lenguaje obsceno con aviso automático. \n Utiliza una base de datos con más de 880 palabras \n\n Personalízalo con:\n {COMMAND_PREFIX}automod [agregar/eliminar] [palabra]\nO activa/desactiva esta función con:\n{COMMAND_PREFIX}configuración [automod] [encender/apagar]",
"help_chatmod_title": "Comandos de Moderación de Chat :file_folder:",
"help_chatmod_description": "{COMMAND_PREFIX}setdelay [segundos] <razón>\n{COMMAND_PREFIX}mute [usuario] <razón>\n{COMMAND_PREFIX}unmute [usuario] <razón>\n{COMMAND_PREFIX}lock <canal> <razón>\n{COMMAND_PREFIX}unlock <canal> <razón>\n",
"help_various_title": "Utilidades Varias :screwdriver:",
"help_various_description": "{COMMAND_PREFIX}whois [usuario]",
"help_links_title": "Enlaces Útiles :link:",
"help_links_description": "[:classical_building: Soporte de Hammer Bot](https://discord.gg/fMSyQA6)\n[:link: Enlace de Invitación de Hammer Bot](https://discordapp.com/api/oauth2/authorize?client_id=591633652493058068&permissions=8&scope=bot)\n[:newspaper: Vota por Hammer](https://top.gg/bot/591633652493058068)}",
"help_commands_title": "Comandos de Ayuda",
Expand Down
4 changes: 2 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ def jsonToDict(filename):
"help_moderation_title",
"user",
"reason",
"seconds",
"channel",
"help_automod_title",
"help_automod_description",
"help_chatmod_title",
"help_chatmod_description",
"help_various_title",
"help_various_description",
"help_links_title",
"help_links_description",
"help_commands_title",
Expand Down

0 comments on commit d55b968

Please sign in to comment.