From 5ad8cc750d8d58de88cbd31b314228c260f4a379 Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 11 Aug 2023 22:46:30 +0200 Subject: [PATCH] Added "selectable" parameter --- locale/de.json | 1 + locale/en.json | 1 + locale/uk.json | 1 + plugins/language.py | 7 ++++--- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/locale/de.json b/locale/de.json index 1d07290..43ef90f 100644 --- a/locale/de.json +++ b/locale/de.json @@ -2,6 +2,7 @@ "metadata": { "flag": "🇩🇪", "name": "Deutsch", + "selectable": true, "codes": [ "de", "de-AT", diff --git a/locale/en.json b/locale/en.json index dc837d1..e0a0c5a 100644 --- a/locale/en.json +++ b/locale/en.json @@ -2,6 +2,7 @@ "metadata": { "flag": "🇬🇧", "name": "English", + "selectable": true, "codes": [ "en", "en-GB", diff --git a/locale/uk.json b/locale/uk.json index df612c4..c32fcbc 100644 --- a/locale/uk.json +++ b/locale/uk.json @@ -2,6 +2,7 @@ "metadata": { "flag": "🇺🇦", "name": "Українська", + "selectable": true, "codes": [ "uk", "uk-UA" diff --git a/plugins/language.py b/plugins/language.py index 68379d2..7a4ffc4 100644 --- a/plugins/language.py +++ b/plugins/language.py @@ -33,9 +33,10 @@ async def command_language(app: PyroClient, message: Message): buttons = [] for language, data in app.in_every_locale("metadata").items(): - buttons.append( - InlineButton(f"{data['flag']} {data['name']}", f"language;{language}") - ) + if data["selectable"]: + buttons.append( + InlineButton(f"{data['flag']} {data['name']}", f"language;{language}") + ) buttons.append( InlineButton(