From 8e4347acba3c2ae15c4274d39c86a73bc679077f Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 31 Aug 2023 14:42:28 +1000 Subject: [PATCH] DEV: rename ai_helper_add_ai_pm_to_header -> ai_bot_add_to_header (#177) Old name was very unclear, this setting is only used for the bot so now it follows the same convention others do --- assets/javascripts/initializers/ai-bot-replies.js | 2 +- config/locales/server.ar.yml | 2 +- config/locales/server.de.yml | 2 +- config/locales/server.en.yml | 2 +- config/locales/server.es.yml | 2 +- config/locales/server.fi.yml | 2 +- config/locales/server.fr.yml | 2 +- config/locales/server.he.yml | 2 +- config/locales/server.it.yml | 2 +- config/locales/server.ja.yml | 2 +- config/locales/server.nl.yml | 2 +- config/locales/server.pl_PL.yml | 2 +- config/locales/server.pt_BR.yml | 2 +- config/locales/server.ru.yml | 2 +- config/locales/server.tr_TR.yml | 2 +- config/locales/server.zh_CN.yml | 2 +- config/settings.yml | 2 +- ...12_rename_ai_helper_add_ai_pm_to_header_setting.rb | 11 +++++++++++ 18 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 db/migrate/20230831033812_rename_ai_helper_add_ai_pm_to_header_setting.rb diff --git a/assets/javascripts/initializers/ai-bot-replies.js b/assets/javascripts/initializers/ai-bot-replies.js index 053c9763..e3af312a 100644 --- a/assets/javascripts/initializers/ai-bot-replies.js +++ b/assets/javascripts/initializers/ai-bot-replies.js @@ -14,7 +14,7 @@ function isGPTBot(user) { function attachHeaderIcon(api) { const settings = api.container.lookup("service:site-settings"); - const enabledBots = settings.ai_helper_add_ai_pm_to_header + const enabledBots = settings.ai_bot_add_to_header ? settings.ai_bot_enabled_chat_bots.split("|").filter(Boolean) : []; if (enabledBots.length > 0) { diff --git a/config/locales/server.ar.yml b/config/locales/server.ar.yml index 3ddf37a3..707eadad 100644 --- a/config/locales/server.ar.yml +++ b/config/locales/server.ar.yml @@ -58,7 +58,7 @@ ar: ai_bot_enabled: "تفعيل وحدة روبوت الذكاء الاصطناعي" ai_bot_allowed_groups: "عندما يتمكن GPT Bot من الوصول إلى الرسالة الخاصة، فإنه سيرد على أعضاء هذه المجموعات." ai_bot_enabled_chat_bots: "النماذج المتاحة للقيام بدور روبوت الذكاء الاصطناعي" - ai_helper_add_ai_pm_to_header: "عرض زر في الرأس لبدء رسالة خاصة مع روبوت ذكاء اصطناعي" + ai_bot_add_to_header: "عرض زر في الرأس لبدء رسالة خاصة مع روبوت ذكاء اصطناعي" ai_stability_api_key: "مفتاح API لواجهة API المسماة stability.ai" ai_stability_api_url: "عنوان URL لواجهة API المسماة stability.ai" ai_google_custom_search_api_key: "مفتاح API لواجهة API الخاصة ببحث Google المخصَّص، راجع: https://developers.google.com/custom-search" diff --git a/config/locales/server.de.yml b/config/locales/server.de.yml index 35120e5d..194838dd 100644 --- a/config/locales/server.de.yml +++ b/config/locales/server.de.yml @@ -62,7 +62,7 @@ de: ai_bot_enable_chat_warning: "Display a warnen wehen PM Chat IS initiale. Man der verrieten, bot Styling the Translation String: Diskurs_ai.ai_bot.pm_warnen" ai_bot_allowed_groups: "Wenn der GPT-Bot Zugriff auf die PN hat, wird er den Mitgliedern dieser Gruppen antworten." ai_bot_enabled_chat_bots: "Verfügbare Modelle, die als KI-Bot agieren können" - ai_helper_add_ai_pm_to_header: "Eine Schaltfläche in der Kopfzeile anzeigen, um eine PN mit einem KI-Bot zu starten" + ai_bot_add_to_header: "Eine Schaltfläche in der Kopfzeile anzeigen, um eine PN mit einem KI-Bot zu starten" ai_stability_api_key: "API-Schlüssel für die stability.ai-API" ai_stability_engine: "Bildgenerierungsengine für die stability.ai-API" ai_stability_api_url: "URL für die stability.ai-API" diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 0a16980b..e109ba2e 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -64,7 +64,7 @@ en: ai_bot_allowed_groups: "When the GPT Bot has access to the PM, it will reply to members of these groups." ai_bot_enabled_chat_bots: "Available models to act as an AI Bot" ai_bot_enabled_chat_commands: "Available GPT integrations used to provide external functionality to the model." - ai_helper_add_ai_pm_to_header: "Display a button in the header to start a PM with a AI Bot" + ai_bot_add_to_header: "Display a button in the header to start a PM with a AI Bot" ai_stability_api_key: "API key for the stability.ai API" ai_stability_engine: "Image generation engine to use for the stability.ai API" diff --git a/config/locales/server.es.yml b/config/locales/server.es.yml index cf5cb445..96ab23b1 100644 --- a/config/locales/server.es.yml +++ b/config/locales/server.es.yml @@ -58,7 +58,7 @@ es: ai_bot_enabled: "Habilitar el módulo AI Bot." ai_bot_allowed_groups: "Cuando el Bot GPT tenga acceso al MP, responderá a los miembros de estos grupos." ai_bot_enabled_chat_bots: "Modelos disponibles para actuar como Bot AI" - ai_helper_add_ai_pm_to_header: "Mostrar un botón en el encabezado para iniciar un MP con un bot de IA" + ai_bot_add_to_header: "Mostrar un botón en el encabezado para iniciar un MP con un bot de IA" ai_stability_api_key: "Clave API para la API de stability.ai" ai_stability_api_url: "URL para la API de stability.ai" ai_google_custom_search_api_key: "Clave API para la API de búsqueda personalizada de Google, consulta: https://developers.google.com/custom-search" diff --git a/config/locales/server.fi.yml b/config/locales/server.fi.yml index 40826564..3908432f 100644 --- a/config/locales/server.fi.yml +++ b/config/locales/server.fi.yml @@ -58,7 +58,7 @@ fi: ai_bot_enabled: "Ota tekoälybottimoduuli käyttöön." ai_bot_allowed_groups: "Kun GPT-botilla on yksityisviestin käyttöoikeus, se vastaa näiden ryhmien jäsenille." ai_bot_enabled_chat_bots: "Käytettävissä olevat mallit tekoälybottina toimimiseen" - ai_helper_add_ai_pm_to_header: "Näytä painike yläpalkissa yksityiskeskustelun aloittamiseksi tekoälybotin kanssa" + ai_bot_add_to_header: "Näytä painike yläpalkissa yksityiskeskustelun aloittamiseksi tekoälybotin kanssa" ai_stability_api_key: "stability.ai-APIn API-avain" ai_stability_api_url: "stability.ai-APIn URL" ai_google_custom_search_api_key: "Google Custom Search APIn API-avain, katso: https://developers.google.com/custom-search" diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index 37f09c6d..9ea81999 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -58,7 +58,7 @@ fr: ai_bot_enabled: "Activez le module du robot IA." ai_bot_allowed_groups: "Lorsque le robot GPT aura accès aux messages privés, il répondra aux membres de ces groupes." ai_bot_enabled_chat_bots: "Modèles disponibles pour agir en tant que robot IA" - ai_helper_add_ai_pm_to_header: "Afficher un bouton dans l'en-tête pour démarrer une conversation avec un robot IA" + ai_bot_add_to_header: "Afficher un bouton dans l'en-tête pour démarrer une conversation avec un robot IA" ai_stability_api_key: "Clé API pour l'API stable.ai" ai_stability_api_url: "Adresse URL de l'API stability.ai" ai_google_custom_search_api_key: "Clé API pour l'API Google Custom Search, voir : https://developers.google.com/custom-search" diff --git a/config/locales/server.he.yml b/config/locales/server.he.yml index 18ac4423..7ee45904 100644 --- a/config/locales/server.he.yml +++ b/config/locales/server.he.yml @@ -62,7 +62,7 @@ he: ai_bot_enable_chat_warning: "הצגת אזהרה עם פתיחת שיח הודעות פרטיות. אפשר לדרוס את זה על ידי עריכת מחרוזת התרגום: discourse_ai.ai_bot.pm_warning" ai_bot_allowed_groups: "כאשר לבוט של GPT יש גישה להודעות הפרטיות, הוא יגיב לחברים בקבוצות האלה." ai_bot_enabled_chat_bots: "מודלים זמינים שיכהנו כבוט בינה מלאכותית" - ai_helper_add_ai_pm_to_header: "הצגת כפתור בכותרת כדי לפתוח הודעה פרטית עם בוט בינה מלאכותית" + ai_bot_add_to_header: "הצגת כפתור בכותרת כדי לפתוח הודעה פרטית עם בוט בינה מלאכותית" ai_stability_api_key: "מפתח API ל־API של stability.ai" ai_stability_engine: "מנוע לחילול תמונות לשימוש עבור ה־API של stability.ai" ai_stability_api_url: "כתובת ל־API של stability.ai" diff --git a/config/locales/server.it.yml b/config/locales/server.it.yml index 7bd02ddc..7f3cf942 100644 --- a/config/locales/server.it.yml +++ b/config/locales/server.it.yml @@ -58,7 +58,7 @@ it: ai_bot_enabled: "Abilita il modulo Bot IA." ai_bot_allowed_groups: "Quando il bot GPT ha accesso a un MP, risponderà ai membri di questi gruppi." ai_bot_enabled_chat_bots: "Modelli disponibili per agire come robot IA" - ai_helper_add_ai_pm_to_header: "Mostra un pulsante nell'intestazione per avviare un MP con un Bot IA" + ai_bot_add_to_header: "Mostra un pulsante nell'intestazione per avviare un MP con un Bot IA" ai_stability_api_key: "Chiave API per l'API stability.ai" ai_stability_api_url: "URL per l'API stability.ai" ai_google_custom_search_api_key: "Chiave API per l'API della ricerca personalizzata di Google: https://developers.google.com/custom-search" diff --git a/config/locales/server.ja.yml b/config/locales/server.ja.yml index ab6c385d..cce11ff5 100644 --- a/config/locales/server.ja.yml +++ b/config/locales/server.ja.yml @@ -58,7 +58,7 @@ ja: ai_bot_enabled: "AI ボットモジュールを有効にします。" ai_bot_allowed_groups: "GPT ボットが PM にアクセスできる場合、これらのグループのメンバーに返信します。" ai_bot_enabled_chat_bots: "AI ボットとして機能する利用可能なモデル" - ai_helper_add_ai_pm_to_header: "AI ボットとの PM を開始するためのボタンをヘッダーに表示する" + ai_bot_add_to_header: "AI ボットとの PM を開始するためのボタンをヘッダーに表示する" ai_stability_api_key: "stability.ai API の API キー" ai_stability_api_url: "stability.ai API の URL" ai_google_custom_search_api_key: "Google カスタム検索 API の API キーは https://developers.google.com/custom-search を参照してください" diff --git a/config/locales/server.nl.yml b/config/locales/server.nl.yml index 8e795ac4..ac42d225 100644 --- a/config/locales/server.nl.yml +++ b/config/locales/server.nl.yml @@ -58,7 +58,7 @@ nl: ai_bot_enabled: "Schakel de AI-botmodule in." ai_bot_allowed_groups: "Wanneer de GPT-bot toegang heeft tot het privébericht, zal deze reageren op leden van deze groepen." ai_bot_enabled_chat_bots: "Beschikbare modellen om op te treden als AI-bot" - ai_helper_add_ai_pm_to_header: "Geef een knop weer in de kop om een privéchat te starten met een AI-bot" + ai_bot_add_to_header: "Geef een knop weer in de kop om een privéchat te starten met een AI-bot" ai_stability_api_key: "API-sleutel voor de stability.ai-API" ai_stability_api_url: "URL voor de stability.ai-API" ai_google_custom_search_api_key: "API-sleutel voor de Google Custom Search-API zie: https://developers.google.com/custom-search" diff --git a/config/locales/server.pl_PL.yml b/config/locales/server.pl_PL.yml index 9c1cd262..59884da6 100644 --- a/config/locales/server.pl_PL.yml +++ b/config/locales/server.pl_PL.yml @@ -58,7 +58,7 @@ pl_PL: ai_bot_enabled: "Włącz moduł bota AI." ai_bot_allowed_groups: "Gdy bot GPT uzyska dostęp do PW, odpowie członkom tych grup." ai_bot_enabled_chat_bots: "Dostępne modele do działania jako bot AI" - ai_helper_add_ai_pm_to_header: "Wyświetl przycisk w nagłówku, aby rozpocząć PW z botem AI" + ai_bot_add_to_header: "Wyświetl przycisk w nagłówku, aby rozpocząć PW z botem AI" ai_stability_api_key: "Klucz dla API stability.ai" ai_stability_api_url: "Adres URL interfejsu API stability.ai" ai_google_custom_search_api_key: "Klucz dla Google Custom Search API, zobacz: https://developers.google.com/custom-search" diff --git a/config/locales/server.pt_BR.yml b/config/locales/server.pt_BR.yml index f6c31cf8..8e9d1f65 100644 --- a/config/locales/server.pt_BR.yml +++ b/config/locales/server.pt_BR.yml @@ -58,7 +58,7 @@ pt_BR: ai_bot_enabled: "Ative o módulo de Bot com IA." ai_bot_allowed_groups: "Quando o Bot com GPT tiver acesso às MPs, ele responderá aos membros destes grupos." ai_bot_enabled_chat_bots: "Modelos disponíveis para agora como Bot com IA" - ai_helper_add_ai_pm_to_header: "Mostrar botão no cabeçalho para começar uma MP com um Bot com IA" + ai_bot_add_to_header: "Mostrar botão no cabeçalho para começar uma MP com um Bot com IA" ai_stability_api_key: "Chave de API para a API stability.ai" ai_stability_api_url: "URL para a API stability.ai" ai_google_custom_search_api_key: "Chave de API para a API de pesquisa personalizada do Google. Veja: https://developers.google.com/custom-search" diff --git a/config/locales/server.ru.yml b/config/locales/server.ru.yml index 4ad3e306..307da223 100644 --- a/config/locales/server.ru.yml +++ b/config/locales/server.ru.yml @@ -58,7 +58,7 @@ ru: ai_bot_enabled: "Включить модуль AI-бота." ai_bot_allowed_groups: "Если у GPT-бота есть доступ к личным сообщениям, он будет отвечать участникам указанных групп." ai_bot_enabled_chat_bots: "Доступные модели для использования в качестве AI-бота" - ai_helper_add_ai_pm_to_header: "Кнопка в заголовке для начала личного разговора с AI-ботом" + ai_bot_add_to_header: "Кнопка в заголовке для начала личного разговора с AI-ботом" ai_stability_api_key: "API-ключ для API stability.ai" ai_stability_api_url: "URL-адрес для API stability.ai" ai_google_custom_search_api_key: "API-ключ для API программируемого поиска Google — см. https://developers.google.com/custom-search" diff --git a/config/locales/server.tr_TR.yml b/config/locales/server.tr_TR.yml index f87b75d2..0d3f3662 100644 --- a/config/locales/server.tr_TR.yml +++ b/config/locales/server.tr_TR.yml @@ -58,7 +58,7 @@ tr_TR: ai_bot_enabled: "YZ Botu modülünü etkinleştirin." ai_bot_allowed_groups: "GPT Botunun Kişisel Mesaja erişimi olduğunda, bu grupların üyelerine yanıt verir." ai_bot_enabled_chat_bots: "YZ Botu görevi görecek mevcut modeller" - ai_helper_add_ai_pm_to_header: "Bir YZ Botu ile bir kişisel mesaj başlatmak için başlıkta bir düğme gösterin" + ai_bot_add_to_header: "Bir YZ Botu ile bir kişisel mesaj başlatmak için başlıkta bir düğme gösterin" ai_stability_api_key: "stability.ai API'si için API anahtarı" ai_stability_api_url: "stability.ai API'si için URL" ai_google_custom_search_api_key: "Google Özel Arama API'sı için API anahtarı bkz.: https://developers.google.com/custom-search" diff --git a/config/locales/server.zh_CN.yml b/config/locales/server.zh_CN.yml index cdab1951..67617054 100644 --- a/config/locales/server.zh_CN.yml +++ b/config/locales/server.zh_CN.yml @@ -58,7 +58,7 @@ zh_CN: ai_bot_enabled: "启用 AI 机器人模块。" ai_bot_allowed_groups: "当 GPT 机器人可以访问私信时,它将回复这些群组的成员。" ai_bot_enabled_chat_bots: "充当 AI 机器人的可用模型" - ai_helper_add_ai_pm_to_header: "在标题中显示按钮以使用 AI 机器人启动私信" + ai_bot_add_to_header: "在标题中显示按钮以使用 AI 机器人启动私信" ai_stability_api_key: "stability.ai API 的 API 密钥" ai_stability_api_url: "stability.ai API 的 URL" ai_google_custom_search_api_key: "Google 自定义搜索 API 的 API 密钥,请参阅:https://developers.google.com/custom-search" diff --git a/config/settings.yml b/config/settings.yml index 4376c1c7..0f15ea6c 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -217,6 +217,6 @@ discourse_ai: - tags - time - setting_context - ai_helper_add_ai_pm_to_header: + ai_bot_add_to_header: default: true client: true diff --git a/db/migrate/20230831033812_rename_ai_helper_add_ai_pm_to_header_setting.rb b/db/migrate/20230831033812_rename_ai_helper_add_ai_pm_to_header_setting.rb new file mode 100644 index 00000000..1db79970 --- /dev/null +++ b/db/migrate/20230831033812_rename_ai_helper_add_ai_pm_to_header_setting.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RenameAiHelperAddAiPmToHeaderSetting < ActiveRecord::Migration[7.0] + def up + execute "UPDATE site_settings SET name = 'ai_bot_add_to_header' WHERE name = 'ai_helper_add_ai_pm_to_header'" + end + + def down + execute "UPDATE site_settings SET name = 'ai_helper_add_ai_pm_to_header' WHERE name = 'ai_bot_add_to_header'" + end +end