diff --git a/locales/de.json b/locales/de.json index bd795d45..6c92b9f5 100644 --- a/locales/de.json +++ b/locales/de.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "Konnte trainierte Wörter nicht laden", - "tooLong": "Trigger Word sollte 100 Wörter nicht überschreiten", - "tooMany": "Maximal 30 Trigger Words erlaubt", + "tooLong": "Trigger Word sollte 500 Wörter nicht überschreiten", + "tooMany": "Maximal 100 Trigger Words erlaubt", "alreadyExists": "Dieses Trigger Word existiert bereits", "updateSuccess": "Trigger Words erfolgreich aktualisiert", "updateFailed": "Fehler beim Aktualisieren der Trigger Words", diff --git a/locales/en.json b/locales/en.json index a7e41e0f..ea62d8fe 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "Could not load trained words", - "tooLong": "Trigger word should not exceed 100 words", - "tooMany": "Maximum 30 trigger words allowed", + "tooLong": "Trigger word should not exceed 500 words", + "tooMany": "Maximum 100 trigger words allowed", "alreadyExists": "This trigger word already exists", "updateSuccess": "Trigger words updated successfully", "updateFailed": "Failed to update trigger words", diff --git a/locales/es.json b/locales/es.json index 8154b625..eee4bf86 100644 --- a/locales/es.json +++ b/locales/es.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "No se pudieron cargar palabras entrenadas", - "tooLong": "La palabra clave no debe exceder 100 palabras", - "tooMany": "Máximo 30 palabras clave permitidas", + "tooLong": "La palabra clave no debe exceder 500 palabras", + "tooMany": "Máximo 100 palabras clave permitidas", "alreadyExists": "Esta palabra clave ya existe", "updateSuccess": "Palabras clave actualizadas exitosamente", "updateFailed": "Error al actualizar palabras clave", diff --git a/locales/fr.json b/locales/fr.json index fd156e34..ac139d19 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "Impossible de charger les mots entraînés", - "tooLong": "Le mot-clé ne doit pas dépasser 100 mots", - "tooMany": "Maximum 30 mots-clés autorisés", + "tooLong": "Le mot-clé ne doit pas dépasser 500 mots", + "tooMany": "Maximum 100 mots-clés autorisés", "alreadyExists": "Ce mot-clé existe déjà", "updateSuccess": "Mots-clés mis à jour avec succès", "updateFailed": "Échec de la mise à jour des mots-clés", diff --git a/locales/he.json b/locales/he.json index 9cd794d5..f1de1aab 100644 --- a/locales/he.json +++ b/locales/he.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "לא ניתן היה לטעון מילים מאומנות", - "tooLong": "מילת טריגר לא תעלה על 100 מילים", - "tooMany": "מותרות עד 30 מילות טריגר", + "tooLong": "מילת טריגר לא תעלה על 500 מילים", + "tooMany": "מותרות עד 100 מילות טריגר", "alreadyExists": "מילת טריגר זו כבר קיימת", "updateSuccess": "מילות הטריגר עודכנו בהצלחה", "updateFailed": "עדכון מילות הטריגר נכשל", diff --git a/locales/ja.json b/locales/ja.json index f5d286c2..4643e63d 100644 --- a/locales/ja.json +++ b/locales/ja.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "学習済みワードを読み込めませんでした", - "tooLong": "トリガーワードは100ワードを超えてはいけません", - "tooMany": "最大30トリガーワードまで許可されています", + "tooLong": "トリガーワードは500ワードを超えてはいけません", + "tooMany": "最大100トリガーワードまで許可されています", "alreadyExists": "このトリガーワードは既に存在します", "updateSuccess": "トリガーワードが正常に更新されました", "updateFailed": "トリガーワードの更新に失敗しました", diff --git a/locales/ko.json b/locales/ko.json index 2e1f40ca..b1f0fcee 100644 --- a/locales/ko.json +++ b/locales/ko.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "학습된 단어를 로딩할 수 없습니다", - "tooLong": "트리거 단어는 100단어를 초과할 수 없습니다", - "tooMany": "최대 30개의 트리거 단어만 허용됩니다", + "tooLong": "트리거 단어는 500단어를 초과할 수 없습니다", + "tooMany": "최대 100개의 트리거 단어만 허용됩니다", "alreadyExists": "이 트리거 단어는 이미 존재합니다", "updateSuccess": "트리거 단어가 성공적으로 업데이트되었습니다", "updateFailed": "트리거 단어 업데이트에 실패했습니다", diff --git a/locales/ru.json b/locales/ru.json index 58eccf53..4b0c9140 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "Не удалось загрузить обученные слова", - "tooLong": "Триггерное слово не должно превышать 100 слов", - "tooMany": "Максимум 30 триггерных слов разрешено", + "tooLong": "Триггерное слово не должно превышать 500 слов", + "tooMany": "Максимум 100 триггерных слов разрешено", "alreadyExists": "Это триггерное слово уже существует", "updateSuccess": "Триггерные слова успешно обновлены", "updateFailed": "Не удалось обновить триггерные слова", diff --git a/locales/zh-CN.json b/locales/zh-CN.json index 17644c63..c9606407 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "无法加载训练词", - "tooLong": "触发词不能超过100个词", - "tooMany": "最多允许30个触发词", + "tooLong": "触发词不能超过500个词", + "tooMany": "最多允许100个触发词", "alreadyExists": "该触发词已存在", "updateSuccess": "触发词更新成功", "updateFailed": "触发词更新失败", diff --git a/locales/zh-TW.json b/locales/zh-TW.json index c2139ef0..1f19fbfa 100644 --- a/locales/zh-TW.json +++ b/locales/zh-TW.json @@ -1761,8 +1761,8 @@ }, "triggerWords": { "loadFailed": "無法載入訓練詞", - "tooLong": "觸發詞不可超過 100 個字", - "tooMany": "最多允許 30 個觸發詞", + "tooLong": "觸發詞不可超過 500 個字", + "tooMany": "最多允許 100 個觸發詞", "alreadyExists": "此觸發詞已存在", "updateSuccess": "觸發詞已更新", "updateFailed": "更新觸發詞失敗", diff --git a/static/js/components/shared/TriggerWords.js b/static/js/components/shared/TriggerWords.js index a413492c..4426a508 100644 --- a/static/js/components/shared/TriggerWords.js +++ b/static/js/components/shared/TriggerWords.js @@ -8,6 +8,9 @@ import { translate } from '../../utils/i18nHelpers.js'; import { getModelApiClient } from '../../api/modelApiFactory.js'; import { escapeAttribute, escapeHtml } from './utils.js'; +const MAX_WORDS_PER_TRIGGER_GROUP = 500; +const MAX_TRIGGER_WORD_GROUPS = 100; + /** * Fetch trained words for a model * @param {string} filePath - Path to the model file @@ -523,14 +526,14 @@ function addNewTriggerWord(word) { } // Validation: Check length - if (word.split(/\s+/).length > 100) { + if (word.split(/\s+/).length > MAX_WORDS_PER_TRIGGER_GROUP) { showToast('toast.triggerWords.tooLong', {}, 'error'); return; } // Validation: Check total number const currentTags = tagsContainer.querySelectorAll('.trigger-word-tag'); - if (currentTags.length >= 100) { + if (currentTags.length >= MAX_TRIGGER_WORD_GROUPS) { showToast('toast.triggerWords.tooMany', {}, 'error'); return; }