From 8f62c2c4a146d4c946d415d75b67b5b9302a6764 Mon Sep 17 00:00:00 2001 From: Romain J Date: Thu, 13 May 2021 22:51:16 +0200 Subject: [PATCH] feat(i18n:rule|Mod): feat rule command translations --- tuxbot/cogs/Custom/locales/messages.pot | 2 +- tuxbot/cogs/Linux/locales/messages.pot | 11 ++++- tuxbot/cogs/Logs/locales/messages.pot | 6 +-- tuxbot/cogs/Mod/functions/utils.py | 2 +- tuxbot/cogs/Mod/locales/en-US.po | 48 ++++++++++++++++++- tuxbot/cogs/Mod/locales/fr-FR.po | 59 ++++++++++++++++++++++-- tuxbot/cogs/Mod/locales/messages.pot | 50 ++++++++++++++++++-- tuxbot/cogs/Mod/mod.py | 2 +- tuxbot/cogs/Network/locales/messages.pot | 55 ++++++++++++++-------- tuxbot/cogs/Polls/locales/messages.pot | 2 +- tuxbot/cogs/Utils/locales/messages.pot | 6 +-- 11 files changed, 204 insertions(+), 39 deletions(-) diff --git a/tuxbot/cogs/Custom/locales/messages.pot b/tuxbot/cogs/Custom/locales/messages.pot index 198e7b9..6b5c95a 100644 --- a/tuxbot/cogs/Custom/locales/messages.pot +++ b/tuxbot/cogs/Custom/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-03-01 14:59+0100\n" +"POT-Creation-Date: 2021-05-13 22:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tuxbot/cogs/Linux/locales/messages.pot b/tuxbot/cogs/Linux/locales/messages.pot index 691ff10..0faddaa 100644 --- a/tuxbot/cogs/Linux/locales/messages.pot +++ b/tuxbot/cogs/Linux/locales/messages.pot @@ -8,12 +8,19 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-03-01 14:59+0100\n" +"POT-Creation-Date: 2021-05-13 22:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" +"Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" +#: tuxbot/cogs/Linux/functions/cnf.py:42 +msgid "Something went wrong ..." +msgstr "" + +#: tuxbot/cogs/Linux/linux.py:56 +msgid "No result found" +msgstr "" diff --git a/tuxbot/cogs/Logs/locales/messages.pot b/tuxbot/cogs/Logs/locales/messages.pot index 7ddb391..8ed8e82 100644 --- a/tuxbot/cogs/Logs/locales/messages.pot +++ b/tuxbot/cogs/Logs/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-03-01 14:59+0100\n" +"POT-Creation-Date: 2021-05-13 22:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,10 +21,10 @@ msgstr "" msgid "```An error occurred, the bot owner has been advertised...```" msgstr "" -#: tuxbot/cogs/Logs/logs.py:333 +#: tuxbot/cogs/Logs/logs.py:334 msgid "Sockets stats" msgstr "" -#: tuxbot/cogs/Logs/logs.py:335 +#: tuxbot/cogs/Logs/logs.py:336 msgid "{} socket events observed ({:.2f}/minute):" msgstr "" diff --git a/tuxbot/cogs/Mod/functions/utils.py b/tuxbot/cogs/Mod/functions/utils.py index 7daa262..f4a92af 100644 --- a/tuxbot/cogs/Mod/functions/utils.py +++ b/tuxbot/cogs/Mod/functions/utils.py @@ -15,7 +15,7 @@ async def get_server_rules(guild_id: int) -> list[Rule]: def get_most_recent_server_rules(rules: list[Rule]) -> Rule: - return sorted(rules, key=lambda r: r.updated_at)[0] + return sorted(rules, key=lambda r: r.updated_at, reverse=True)[0] def paginate_server_rules(rules: list[Rule]) -> list[str]: diff --git a/tuxbot/cogs/Mod/locales/en-US.po b/tuxbot/cogs/Mod/locales/en-US.po index 89e4b2f..96aefd2 100644 --- a/tuxbot/cogs/Mod/locales/en-US.po +++ b/tuxbot/cogs/Mod/locales/en-US.po @@ -17,11 +17,55 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: tuxbot/cogs/Admin/admin.py:50 +#: tuxbot/cogs/Mod/mod.py:67 #, python-brace-format msgid "Locale changed to {lang} successfully" msgstr "" -#: tuxbot/cogs/Admin/admin.py:61 +#: tuxbot/cogs/Mod/mod.py:78 msgid "List of available locales: " msgstr "" + +#: tuxbot/cogs/Mod/mod.py:103 +msgid "" +"{}please read the following rule: \n" +"{}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:120 +msgid "Rules for {}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:126 +msgid "Latest change: {}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:140 +msgid "Rules for {} ({}/{})" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:159 +msgid "" +"Following rule added: \n" +"{}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:182 +msgid "" +"Following rule updated: \n" +"{}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:200 +msgid "" +"Following rule deleted: \n" +"{}" +msgstr "" + +#: tuxbot/cogs/Mod/functions/converters.py:22 +msgid "Unknown rule" +msgstr "" + +#: tuxbot/cogs/Mod/functions/converters.py:31 +msgid "Rule length must be 300 characters or lower." +msgstr "" diff --git a/tuxbot/cogs/Mod/locales/fr-FR.po b/tuxbot/cogs/Mod/locales/fr-FR.po index eb80950..f2e43d8 100644 --- a/tuxbot/cogs/Mod/locales/fr-FR.po +++ b/tuxbot/cogs/Mod/locales/fr-FR.po @@ -18,11 +18,64 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: tuxbot/cogs/Admin/admin.py:50 -#, fuzzy, python-brace-format +#: tuxbot/cogs/Mod/mod.py:67 +#, python-brace-format msgid "Locale changed to {lang} successfully" msgstr "Langue changée pour {lang} avec succès" -#: tuxbot/cogs/Admin/admin.py:61 +#: tuxbot/cogs/Mod/mod.py:78 msgid "List of available locales: " msgstr "Liste des langues disponibles : " + +#: tuxbot/cogs/Mod/mod.py:103 +msgid "" +"{}please read the following rule: \n" +"{}" +msgstr "" +"{}merci de lire la règle suivante : \n" +"{}" + +#: tuxbot/cogs/Mod/mod.py:120 +msgid "Rules for {}" +msgstr "Règles pour {}" + +#: tuxbot/cogs/Mod/mod.py:126 +msgid "Latest change: {}" +msgstr "Dernières modifications : {}" + +#: tuxbot/cogs/Mod/mod.py:140 +msgid "Rules for {} ({}/{})" +msgstr "Règles pour {} ({}/{})" + +#: tuxbot/cogs/Mod/mod.py:159 +msgid "" +"Following rule added: \n" +"{}" +msgstr "" +"La règles suivante a été ajoutée: \n" +"{}" + +#: tuxbot/cogs/Mod/mod.py:182 +msgid "" +"Following rule updated: \n" +"{}" +msgstr "" +"La règles suivante a été modifiée: \n" +"{}" + +#: tuxbot/cogs/Mod/mod.py:200 +msgid "" +"Following rule deleted: \n" +"{}" +msgstr "" +"La règles suivante a été supprimée: \n" +"{}" + +#: tuxbot/cogs/Mod/functions/converters.py:22 +msgid "Unknown rule" +msgstr "Règle inconnue" + +#: tuxbot/cogs/Mod/functions/converters.py:31 +msgid "Rule length must be 300 characters or lower." +msgstr "La règles doit faire 300 characters ou moins" + diff --git a/tuxbot/cogs/Mod/locales/messages.pot b/tuxbot/cogs/Mod/locales/messages.pot index 827fcdc..f70ecd7 100644 --- a/tuxbot/cogs/Mod/locales/messages.pot +++ b/tuxbot/cogs/Mod/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-03-01 14:59+0100\n" +"POT-Creation-Date: 2021-05-13 22:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,55 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: tuxbot/cogs/Admin/admin.py:50 +#: tuxbot/cogs/Mod/mod.py:67 #, python-brace-format msgid "Locale changed to {lang} successfully" msgstr "" -#: tuxbot/cogs/Admin/admin.py:61 +#: tuxbot/cogs/Mod/mod.py:78 msgid "List of available locales: " msgstr "" + +#: tuxbot/cogs/Mod/mod.py:103 +msgid "" +"{}please read the following rule: \n" +"{}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:120 +msgid "Rules for {}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:126 +msgid "Latest change: {}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:140 +msgid "Rules for {} ({}/{})" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:159 +msgid "" +"Following rule added: \n" +"{}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:182 +msgid "" +"Following rule updated: \n" +"{}" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:200 +msgid "" +"Following rule deleted: \n" +"{}" +msgstr "" + +#: tuxbot/cogs/Mod/functions/converters.py:22 +msgid "Unknown rule" +msgstr "" + +#: tuxbot/cogs/Mod/functions/converters.py:31 +msgid "Rule length must be 300 characters or lower." +msgstr "" diff --git a/tuxbot/cogs/Mod/mod.py b/tuxbot/cogs/Mod/mod.py index 7a4cd02..c35680c 100644 --- a/tuxbot/cogs/Mod/mod.py +++ b/tuxbot/cogs/Mod/mod.py @@ -124,7 +124,7 @@ class Mod(commands.Cog): ) embed.set_footer( text=_("Latest change: {}", ctx, self.bot.config).format( - get_most_recent_server_rules(rules).created_at + get_most_recent_server_rules(rules).updated_at.ctime() ) ) diff --git a/tuxbot/cogs/Network/locales/messages.pot b/tuxbot/cogs/Network/locales/messages.pot index d9333e4..e5a7426 100644 --- a/tuxbot/cogs/Network/locales/messages.pot +++ b/tuxbot/cogs/Network/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-03-01 14:59+0100\n" +"POT-Creation-Date: 2021-05-13 22:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,57 +17,74 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: tuxbot/cogs/Network/functions/utils.py:39 -msgid "Impossible to collect information on this in the given version" +#: tuxbot/cogs/Network/functions/utils.py:54 +msgid "Unable to collect information on this in the given version" msgstr "" -#: tuxbot/cogs/Network/functions/utils.py:62 +#: tuxbot/cogs/Network/functions/utils.py:103 #, python-brace-format msgid "IP address {ip_address} is already defined as Private-Use Networks via RFC 1918." msgstr "" -#: tuxbot/cogs/Network/functions/utils.py:135 -msgid "Invalid ip or domain" -msgstr "" - -#: tuxbot/cogs/Network/functions/utils.py:142 +#: tuxbot/cogs/Network/functions/utils.py:265 msgid "Invalid ip version" msgstr "" -#: tuxbot/cogs/Network/functions/utils.py:164 +#: tuxbot/cogs/Network/functions/utils.py:287 msgid "Supported queries : A, AAAA, CNAME, NS, DS, DNSKEY, SOA, TXT, PTR, MX" msgstr "" -#: tuxbot/cogs/Network/network.py:94 -msgid "*Retrieving information...*" +#: tuxbot/cogs/Network/functions/utils.py:296 +msgid "Invalid ASN provided" msgstr "" -#: tuxbot/cogs/Network/network.py:112 +#: tuxbot/cogs/Network/network.py:137 #, python-brace-format msgid "Information for ``{ip} ({ip_address})``" msgstr "" -#: tuxbot/cogs/Network/network.py:118 +#: tuxbot/cogs/Network/network.py:143 msgid "Belongs to:" msgstr "" -#: tuxbot/cogs/Network/network.py:128 +#: tuxbot/cogs/Network/network.py:153 msgid "Region:" msgstr "" -#: tuxbot/cogs/Network/network.py:136 +#: tuxbot/cogs/Network/network.py:161 #, python-brace-format msgid "Hostname: {hostname}" msgstr "" -#: tuxbot/cogs/Network/network.py:180 +#: tuxbot/cogs/Network/network.py:205 +msgid "Unable to collect information through CloudFlare" +msgstr "" + +#: tuxbot/cogs/Network/network.py:250 msgid "[show all]({})" msgstr "" -#: tuxbot/cogs/Network/network.py:190 +#: tuxbot/cogs/Network/network.py:264 tuxbot/cogs/Network/network.py:337 msgid "Cannot connect to host {}" msgstr "" -#: tuxbot/cogs/Network/network.py:218 +#: tuxbot/cogs/Network/network.py:289 msgid "No result..." msgstr "" + +#: tuxbot/cogs/Network/network.py:321 +msgid "Up!" +msgstr "" + +#: tuxbot/cogs/Network/network.py:324 +msgid "Down..." +msgstr "" + +#: tuxbot/cogs/Network/network.py:353 +msgid "Please retry in few minutes" +msgstr "" + +#: tuxbot/cogs/Network/network.py:367 +#, python-brace-format +msgid "AS{asn} could not be found in PeeringDB's database." +msgstr "" diff --git a/tuxbot/cogs/Polls/locales/messages.pot b/tuxbot/cogs/Polls/locales/messages.pot index 2fe574a..8f0e05c 100644 --- a/tuxbot/cogs/Polls/locales/messages.pot +++ b/tuxbot/cogs/Polls/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-03-01 14:59+0100\n" +"POT-Creation-Date: 2021-05-13 22:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tuxbot/cogs/Utils/locales/messages.pot b/tuxbot/cogs/Utils/locales/messages.pot index a87ee75..af2289e 100644 --- a/tuxbot/cogs/Utils/locales/messages.pot +++ b/tuxbot/cogs/Utils/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-03-01 14:59+0100\n" +"POT-Creation-Date: 2021-05-13 22:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -108,10 +108,10 @@ msgstr "" msgid "All minimal permissions + extra permissions for admin commands such as kick and ban\n" msgstr "" -#: tuxbot/cogs/Utils/utils.py:246 +#: tuxbot/cogs/Utils/utils.py:247 msgid "Unable to find `{}`" msgstr "" -#: tuxbot/cogs/Utils/utils.py:254 +#: tuxbot/cogs/Utils/utils.py:255 msgid "Unable to fetch lines for `{}`" msgstr ""