diff --git a/src/babel/cog.py b/src/babel/cog.py index e25e945c..bd535a3e 100644 --- a/src/babel/cog.py +++ b/src/babel/cog.py @@ -230,7 +230,7 @@ class BabelCog(LionCog): supported = self.bot.translator.supported_locales formatted = [] for locale in supported: - name = locale_names.get(locale, None) + name = locale_names.get(locale.replace('_', '-'), None) if name: localestr = f"{locale} ({t(name)})" else: diff --git a/src/babel/enums.py b/src/babel/enums.py index 90285985..6ab77a74 100644 --- a/src/babel/enums.py +++ b/src/babel/enums.py @@ -35,6 +35,7 @@ class LocaleMap(Enum): turkish = 'tr' ukrainian = 'uk' vietnamese = 'vi' + hebrew = 'he-IL' locale_names = { @@ -68,4 +69,6 @@ locale_names = { 'tr': _p('localenames|locale:tr', "Turkish"), 'uk': _p('localenames|locale:uk', "Ukrainian"), 'vi': _p('localenames|locale:vi', "Vietnamese"), + 'he': _p('localenames|locale:he', "Hebrew"), + 'he-IL': _p('localenames|locale:he_IL', "Hebrew (Israel)"), } diff --git a/src/modules/pomodoro/timer.py b/src/modules/pomodoro/timer.py index f199931c..b53ecc96 100644 --- a/src/modules/pomodoro/timer.py +++ b/src/modules/pomodoro/timer.py @@ -142,14 +142,22 @@ class Timer: if not hook: # Attempt to create and save webhook # TODO: Localise + t = self.bot.translator.t + ctx_locale.set(self.locale.value) try: if channel.permissions_for(channel.guild.me).manage_webhooks: avatar = self.bot.user.avatar avatar_data = (await avatar.to_file()).fp.read() if avatar else None webhook = await channel.create_webhook( avatar=avatar_data, - name=f"{self.bot.user.name} Pomodoro", - reason="Pomodoro Notifications" + name=t(_p( + 'timer|webhook|name', + "{bot_name} Pomodoro" + )).format(bot_name=self.bot.user.name), + reason=t(_p( + 'timer|webhook|audit_reason', + "Pomodoro Notifications" + )) ) hook = await self.bot.core.data.LionHook.create( channelid=channel.id, @@ -157,9 +165,10 @@ class Timer: webhookid=webhook.id ) elif channel.permissions_for(channel.guild.me).send_messages: - await channel.send( - "I require the `manage_webhooks` permission to send pomodoro notifications here!" - ) + await channel.send(t(_p( + 'timer|webhook|error:insufficient_permissions', + "I require the `MANAGE_WEBHOOKS` permission to send pomodoro notifications here!" + ))) except discord.HTTPException: logger.warning( "Unexpected Exception caught while creating timer notification webhook "