Add localizable strings to two extensions & translate them

This commit is contained in:
Yokayo
2024-05-04 02:44:15 +07:00
parent 7bc87b6e28
commit 29e2e8f607
6 changed files with 178 additions and 69 deletions

View File

@ -1095,5 +1095,89 @@
"Space": "Пробел", "Space": "Пробел",
"Newline": "Новая строка", "Newline": "Новая строка",
"Double Newline": "Две новые строки", "Double Newline": "Две новые строки",
"The next chunk of the continued message will be appended using this as a separator.": "Используется в качестве разделителя между уже имеющимся сообщением и его новым отрывком, при генерации продолжения" "The next chunk of the continued message will be appended using this as a separator.": "Используется в качестве разделителя между уже имеющимся сообщением и его новым отрывком, при генерации продолжения",
"Regex Editor": "Редактор рег. выражений",
"regex_open_editor": "Открыть редактор",
"regex_import_script": "Импорт скрипта",
"regex_saved_scripts": "Сохранённые скрипты",
"regex_desc": "Regex - это инструмент, позволяющий находить и изменять строки, используя регулярные выражения. Для более подробной информации нажмите ? рядом с заголовком.",
"Input": "Поле ввода",
"regex_test_input_placeholder": "Введите текст...",
"Output": "Результат",
"regex_output_placeholder": "Пусто",
"Script Name": "Название скрипта",
"Find Regex": "Рег. выражение для поиска",
"Replace With": "Замена",
"regex_replace_string_placeholder": "Чтобы вставить всё вхождение рег. выражения, используйте {{match}}. Чтобы вставить группу символов, используйте $1, $2 и т.д.",
"Trim Out": "Усечение",
"regex_trim_placeholder": "Удалить перед обработкой ненужные части текста. Каждый элемент с новой строки.",
"Slash Commands": "Слэш-команды",
"Min Depth": "Мин. глубина",
"regex_min_depth_desc": "При форматировании затрагивать только те сообщения, которые находятся как минимум на глубине N. 0 = последнее сообщение, 1 = предпоследнее и т.д. Учитываются только видимые сообщения, т.е. не скрытые и не системные.",
"regex_max_depth_desc": "При форматировании затрагивать только те сообщения, которые находятся на глубине не более N. 0 = последнее сообщение, 1 = предпоследнее и т.д. Учитываются только видимые сообщения, т.е. не скрытые и не системные.",
"regex_min_depth_placeholder": "Неогранич.",
"regex_other_options": "Другие опции",
"Only Format Display": "Только визуально",
"regex_only_format_prompt_desc": "История чата не изменится, замена будет осуществляться только в промпте (при генерации)",
"Only Format Prompt (?)": "Только промпт",
"Run On Edit": "Выполнять при редактировании",
"Substitute Regex": "Заменить в рег. выражении",
"regex_substitute_regex_desc": "Перед выполнением заменять {{макросы}} в рег. выражении",
"Test Mode": "Протестировать",
"ext_regex_affects": "Затрагивает",
"ext_regex_user_input": "Ваши сообщения",
"ext_regex_ai_output": "Ответы ИИ",
"ext_regex_disable_script": "Отключить скрипт",
"ext_regex_enable_script": "Включить скрипт",
"ext_regex_edit_script": "Редактировать",
"ext_regex_export_script": "Экспортировать",
"ext_regex_delete_script": "Удалить",
"ext_sum_with": "Для пересказа использовать:",
"ext_sum_main_api": "Основное API",
"ext_sum_current_summary": "Текущий пересказ:",
"ext_sum_restore_previous": "Восстановить предыдущий",
"ext_sum_memory_placeholder": "Сгенерированный пересказ будет здесь...",
"ext_sum_force_text": "Пересказать сейчас",
"ext_sum_force_tip": "Сгенерировать пересказ прямо сейчас.",
"Disable automatic summary updates. While paused, the summary remains as-is. You can still force an update by pressing the Summarize now button (which is only available with the Main API).": "Отключить авто-обновление пересказа. Пересказ всё время будет фиксированным. Однако останется возможность принудительно обновить пересказ через кнопку \"Пересказать сейчас\" (доступно только через Основное API)",
"ext_sum_pause": "Приостановить",
"Omit World Info and Author's Note from text to be summarized. Only has an effect when using the Main API. The Extras API always omits WI/AN.": "Исключать из пересказа Информацию о мире и Заметки автора. Работает только для Основного API. Extras API всегда их исключает.",
"ext_sum_no_wi_an": "Без мира и заметок",
"ext_sum_settings_tip": "Изменить промпт пересказа, место для инжекта и т.д.",
"ext_sum_settings": "Настройки пересказа",
"ext_sum_prompt_builder": "Алгоритм формирования промпта",
"ext_sum_prompt_builder_1_desc": "Расширение само составит промпт с учётом непересказанных сообщений. Во время генерации чат недоступен.",
"ext_sum_prompt_builder_1": "Прямой, блокирующий",
"ext_sum_prompt_builder_2_desc": "Расширение само составит промпт с учётом непересказанных сообщений. Во время генерации чат доступен. Может не поддерживаться некоторыми бэкендами.",
"ext_sum_prompt_builder_2": "Прямой, неблокирующий",
"ext_sum_prompt_builder_3_desc": "Расширение будет использовать стандартные основные настройки промпта, и добавит свой промпт в качестве последнего системного сообщения.",
"ext_sum_prompt_builder_3": "Классический, блокирующий",
"Summary Prompt": "Промпт для пересказа",
"ext_sum_restore_default_prompt_tip": "Восстановить стандартный промпт",
"ext_sum_prompt_placeholder": "Этот промпт будет отправлен ИИ при запросе на генерацию пересказа. Макрос {{words}} будет заменён на значение параметра \"Количество слов\".",
"ext_sum_target_length_1": "Целевая длина пересказа",
"ext_sum_words_ru_case1": "слово",
"ext_sum_words_ru_case2": "слова",
"ext_sum_words_ru_case3": "слов",
"ext_sum_api_response_length_1": "Длина ответа от API",
"ext_sum_tokens_ru_case1": "токен",
"ext_sum_tokens_ru_case2": "токена",
"ext_sum_tokens_ru_case3": "токенов",
"ext_sum_0_default": "0 = по умолчанию",
"ext_sum_raw_max_msg": "[Прямое форматирование] Макс. кол-во сообщений в запросе",
"ext_sum_0_unlimited": "0 = неограничено",
"Update frequency": "Частота обновления",
"ext_sum_messages_ru_case1": "сообщение",
"ext_sum_messages_ru_case2": "сообщения",
"ext_sum_messages_ru_case3": "сообщений",
"ext_sum_update_every_messages_1": "Обновлять раз в",
"ext_sum_pause": "Приостановить",
"ext_sum_update_every_words_1": "Обновлять раз в",
"ext_sum_0_disable": "0 = отключено",
"ext_sum_auto_adjust_desc": "Попытаться автоматически рассчитать значение интервала, исходя из статистики чата",
"ext_sum_both_sliders": "Если ни один из ползунков не равен нулю, то оба будут триггерить генерацию пересказа с соответствующей периодичностью.",
"ext_sum_injection_template": "Шаблон для инжекта",
"ext_sum_memory_template_placeholder": "Макрос {{summary}} будет заменён на содержимое пересказа",
"ext_sum_injection_position": "Куда инжектить",
"How many messages before the current end of the chat.": "Сколько сообщений от конца чата."
} }

View File

@ -228,14 +228,18 @@ function onMemorySkipWIANInput() {
function onMemoryPromptWordsInput() { function onMemoryPromptWordsInput() {
const value = $(this).val(); const value = $(this).val();
extension_settings.memory.promptWords = Number(value); extension_settings.memory.promptWords = Number(value);
$('#memory_prompt_words_value').text(extension_settings.memory.promptWords); const display = $('#memory_prompt_words_value');
display.text(extension_settings.memory.promptWords);
updateCase(display.next(), extension_settings.memory.promptWords);
saveSettingsDebounced(); saveSettingsDebounced();
} }
function onMemoryPromptIntervalInput() { function onMemoryPromptIntervalInput() {
const value = $(this).val(); const value = $(this).val();
extension_settings.memory.promptInterval = Number(value); extension_settings.memory.promptInterval = Number(value);
$('#memory_prompt_interval_value').text(extension_settings.memory.promptInterval); const display = $('#memory_prompt_interval_value');
display.text(extension_settings.memory.promptInterval);
updateCase(display.next(), extension_settings.memory.promptInterval);
saveSettingsDebounced(); saveSettingsDebounced();
} }
@ -280,14 +284,34 @@ function onMemoryPositionChange(e) {
function onMemoryPromptWordsForceInput() { function onMemoryPromptWordsForceInput() {
const value = $(this).val(); const value = $(this).val();
extension_settings.memory.promptForceWords = Number(value); extension_settings.memory.promptForceWords = Number(value);
$('#memory_prompt_words_force_value').text(extension_settings.memory.promptForceWords); const display = $('#memory_prompt_words_force_value');
display.text(extension_settings.memory.promptForceWords);
updateCase(display.next(), extension_settings.memory.promptForceWords);
saveSettingsDebounced(); saveSettingsDebounced();
} }
function updateCase(span, number) { // other languages can use this function too, adding their own attributes to the elements
const ru_case1 = span.attr('ru-case1');
if (ru_case1) {
const ru_case2 = span.attr('ru-case2');
const ru_case3 = span.attr('ru-case3');
const last_digit = number % 10;
if (last_digit == 1) {
span.text(ru_case1);
} else if (last_digit != 0 && last_digit < 5) {
span.text(ru_case2);
} else {
span.text(ru_case3);
}
}
}
function onOverrideResponseLengthInput() { function onOverrideResponseLengthInput() {
const value = $(this).val(); const value = $(this).val();
extension_settings.memory.overrideResponseLength = Number(value); extension_settings.memory.overrideResponseLength = Number(value);
$('#memory_override_response_length_value').text(extension_settings.memory.overrideResponseLength); const display = $('#memory_override_response_length_value');
display.text(extension_settings.memory.overrideResponseLength);
updateCase(display.next(), extension_settings.memory.overrideResponseLength);
saveSettingsDebounced(); saveSettingsDebounced();
} }

View File

@ -9,73 +9,73 @@
</div> </div>
<div class="inline-drawer-content"> <div class="inline-drawer-content">
<div id="summaryExtensionDrawerContents"> <div id="summaryExtensionDrawerContents">
<label for="summary_source">Summarize with:</label> <label for="summary_source" data-i18n="ext_sum_with">Summarize with:</label>
<select id="summary_source"> <select id="summary_source">
<option value="main">Main API</option> <option value="main" data-i18n="ext_sum_main_api">Main API</option>
<option value="extras">Extras API</option> <option value="extras">Extras API</option>
</select><br> </select><br>
<div class="flex-container justifyspacebetween alignitemscenter"> <div class="flex-container justifyspacebetween alignitemscenter">
<span class="flex1">Current summary:</span> <span class="flex1" data-i18n="ext_sum_current_summary">Current summary:</span>
<div id="memory_restore" class="menu_button flex1 margin0"> <div id="memory_restore" class="menu_button flex1 margin0">
<span>Restore Previous</span> <span data-i18n="ext_sum_restore_previous">Restore Previous</span>
</div> </div>
</div> </div>
<textarea id="memory_contents" class="text_pole textarea_compact" rows="6" placeholder="Summary will be generated here..."></textarea> <textarea id="memory_contents" class="text_pole textarea_compact" rows="6" data-i18n="[placeholder]ext_sum_memory_placeholder" placeholder="Summary will be generated here..."></textarea>
<div class="memory_contents_controls"> <div class="memory_contents_controls">
<div id="memory_force_summarize" data-summary-source="main" class="menu_button menu_button_icon" title="Trigger a summary update right now." data-i18n="Trigger a summary update right now."> <div id="memory_force_summarize" data-summary-source="main" class="menu_button menu_button_icon" data-i18n="[title]ext_sum_force_tip" title="Trigger a summary update right now." data-i18n="Trigger a summary update right now.">
<i class="fa-solid fa-database"></i> <i class="fa-solid fa-database"></i>
<span>Summarize now</span> <span data-i18n="ext_sum_force_text">Summarize now</span>
</div> </div>
<label for="memory_frozen" title="Disable automatic summary updates. While paused, the summary remains as-is. You can still force an update by pressing the Summarize now button (which is only available with the Main API)." data-i18n="[title]Disable automatic summary updates. While paused, the summary remains as-is. You can still force an update by pressing the Summarize now button (which is only available with the Main API)."><input id="memory_frozen" type="checkbox" />Pause</label> <label for="memory_frozen" title="Disable automatic summary updates. While paused, the summary remains as-is. You can still force an update by pressing the Summarize now button (which is only available with the Main API)." data-i18n="[title]Disable automatic summary updates. While paused, the summary remains as-is. You can still force an update by pressing the Summarize now button (which is only available with the Main API)."><input id="memory_frozen" type="checkbox" /><span data-i18n="ext_sum_pause">Pause</span></label>
<label data-summary-source="main" for="memory_skipWIAN" title="Omit World Info and Author's Note from text to be summarized. Only has an effect when using the Main API. The Extras API always omits WI/AN." data-i18n="[title]Omit World Info and Author's Note from text to be summarized. Only has an effect when using the Main API. The Extras API always omits WI/AN."> <label data-summary-source="main" for="memory_skipWIAN" title="Omit World Info and Author's Note from text to be summarized. Only has an effect when using the Main API. The Extras API always omits WI/AN." data-i18n="[title]Omit World Info and Author's Note from text to be summarized. Only has an effect when using the Main API. The Extras API always omits WI/AN.">
<input id="memory_skipWIAN" type="checkbox" /> <input id="memory_skipWIAN" type="checkbox" />
<span>No WI/AN</span> <span data-i18n="ext_sum_no_wi_an">No WI/AN</span>
</label> </label>
</div> </div>
<div class="memory_contents_controls"> <div class="memory_contents_controls">
<div id="summarySettingsBlockToggle" class="menu_button menu_button_icon" title="Edit summarization prompt, insertion position, etc."> <div id="summarySettingsBlockToggle" class="menu_button menu_button_icon" data-i18n="[title]ext_sum_settings_tip" title="Edit summarization prompt, insertion position, etc.">
<i class="fa-solid fa-cog"></i> <i class="fa-solid fa-cog"></i>
<span>Summary Settings</span> <span data-i18n="ext_sum_settings">Summary Settings</span>
</div> </div>
</div> </div>
<div id="summarySettingsBlock" style="display:none;"> <div id="summarySettingsBlock" style="display:none;">
<div data-summary-source="main"> <div data-summary-source="main">
<label> <label data-i18n="ext_sum_prompt_builder">
Prompt builder Prompt builder
</label> </label>
<label class="checkbox_label" for="memory_prompt_builder_raw_blocking" title="Extension will build its own prompt using messages that were not summarized yet. Blocks the chat until the summary is generated."> <label class="checkbox_label" for="memory_prompt_builder_raw_blocking" data-i18n="[title]ext_sum_prompt_builder_1_desc" title="Extension will build its own prompt using messages that were not summarized yet. Blocks the chat until the summary is generated.">
<input id="memory_prompt_builder_raw_blocking" type="radio" name="memory_prompt_builder" value="1" /> <input id="memory_prompt_builder_raw_blocking" type="radio" name="memory_prompt_builder" value="1" />
<span>Raw, blocking</span> <span data-i18n="ext_sum_prompt_builder_1">Raw, blocking</span>
</label> </label>
<label class="checkbox_label" for="memory_prompt_builder_raw_non_blocking" title="Extension will build its own prompt using messages that were not summarized yet. Does not block the chat while the summary is being generated. Not all backends support this mode."> <label class="checkbox_label" for="memory_prompt_builder_raw_non_blocking" data-i18n="[title]ext_sum_prompt_builder_2_desc" title="Extension will build its own prompt using messages that were not summarized yet. Does not block the chat while the summary is being generated. Not all backends support this mode.">
<input id="memory_prompt_builder_raw_non_blocking" type="radio" name="memory_prompt_builder" value="2" /> <input id="memory_prompt_builder_raw_non_blocking" type="radio" name="memory_prompt_builder" value="2" />
<span>Raw, non-blocking</span> <span data-i18n="ext_sum_prompt_builder_2">Raw, non-blocking</span>
</label> </label>
<label class="checkbox_label" id="memory_prompt_builder_default" title="Extension will use the regular main prompt builder and add the summary request to it as the last system message."> <label class="checkbox_label" id="memory_prompt_builder_default" data-i18n="[title]ext_sum_prompt_builder_3_desc" title="Extension will use the regular main prompt builder and add the summary request to it as the last system message.">
<input id="memory_prompt_builder_default" type="radio" name="memory_prompt_builder" value="0" /> <input id="memory_prompt_builder_default" type="radio" name="memory_prompt_builder" value="0" />
<span>Classic, blocking</span> <span data-i18n="ext_sum_prompt_builder_3">Classic, blocking</span>
</label> </label>
</div> </div>
<div data-summary-source="main"> <div data-summary-source="main">
<label for="memory_prompt" class="title_restorable"> <label for="memory_prompt" class="title_restorable">
<span data-i18n="Summary Prompt">Summary Prompt</span> <span data-i18n="Summary Prompt">Summary Prompt</span>
<div id="memory_prompt_restore" title="Restore default prompt" class="right_menu_button"> <div id="memory_prompt_restore" data-i18n="[title]ext_sum_restore_default_prompt_tip" title="Restore default prompt" class="right_menu_button">
<div class="fa-solid fa-clock-rotate-left"></div> <div class="fa-solid fa-clock-rotate-left"></div>
</div> </div>
</label> </label>
<textarea id="memory_prompt" class="text_pole textarea_compact" rows="6" placeholder="This prompt will be sent to AI to request the summary generation. &lcub;&lcub;words&rcub;&rcub; will resolve to the 'Number of words' parameter."></textarea> <textarea id="memory_prompt" class="text_pole textarea_compact" rows="6" data-i18n="[placeholder]ext_sum_prompt_placeholder" placeholder="This prompt will be sent to AI to request the summary generation. &lcub;&lcub;words&rcub;&rcub; will resolve to the 'Number of words' parameter."></textarea>
<label for="memory_prompt_words">Target summary length (<span id="memory_prompt_words_value"></span> words)</label> <label for="memory_prompt_words"><span data-i18n="ext_sum_target_length_1">Target summary length</span> (<span id="memory_prompt_words_value"></span> <span data-i18n="ext_sum_target_length_2;[ru-case1]ext_sum_words_ru_case1;[ru-case2]ext_sum_words_ru_case2;[ru-case3]ext_sum_words_ru_case3">words</span>)</label>
<input id="memory_prompt_words" type="range" value="{{defaultSettings.promptWords}}" min="{{defaultSettings.promptMinWords}}" max="{{defaultSettings.promptMaxWords}}" step="{{defaultSettings.promptWordsStep}}" /> <input id="memory_prompt_words" type="range" value="{{defaultSettings.promptWords}}" min="{{defaultSettings.promptMinWords}}" max="{{defaultSettings.promptMaxWords}}" step="{{defaultSettings.promptWordsStep}}" />
<label for="memory_override_response_length"> <label for="memory_override_response_length">
API response length (<span id="memory_override_response_length_value"></span> tokens) <span data-i18n="ext_sum_api_response_length_1">API response length</span> (<span id="memory_override_response_length_value"></span> <span data-i18n="ext_sum_api_response_length_2;[ru-case1]ext_sum_tokens_ru_case1;[ru-case2]ext_sum_tokens_ru_case2;[ru-case3]ext_sum_tokens_ru_case3">tokens</span>)
<small class="memory_disabled_hint">0 = default</small> <small class="memory_disabled_hint" data-i18n="ext_sum_0_default">0 = default</small>
</label> </label>
<input id="memory_override_response_length" type="range" value="{{defaultSettings.overrideResponseLength}}" min="{{defaultSettings.overrideResponseLengthMin}}" max="{{defaultSettings.overrideResponseLengthMax}}" step="{{defaultSettings.overrideResponseLengthStep}}" /> <input id="memory_override_response_length" type="range" value="{{defaultSettings.overrideResponseLength}}" min="{{defaultSettings.overrideResponseLengthMin}}" max="{{defaultSettings.overrideResponseLengthMax}}" step="{{defaultSettings.overrideResponseLengthStep}}" />
<label for="memory_max_messages_per_request"> <label for="memory_max_messages_per_request">
[Raw] Max messages per request (<span id="memory_max_messages_per_request_value"></span>) <span data-i18n="ext_sum_raw_max_msg">[Raw] Max messages per request</span> (<span id="memory_max_messages_per_request_value"></span>)
<small class="memory_disabled_hint">0 = unlimited</small> <small class="memory_disabled_hint" data-i18n="ext_sum_0_unlimited">0 = unlimited</small>
</label> </label>
<input id="memory_max_messages_per_request" type="range" value="{{defaultSettings.maxMessagesPerRequest}}" min="{{defaultSettings.maxMessagesPerRequestMin}}" max="{{defaultSettings.maxMessagesPerRequestMax}}" step="{{defaultSettings.maxMessagesPerRequestStep}}" /> <input id="memory_max_messages_per_request" type="range" value="{{defaultSettings.maxMessagesPerRequest}}" min="{{defaultSettings.maxMessagesPerRequestMin}}" max="{{defaultSettings.maxMessagesPerRequestMax}}" step="{{defaultSettings.maxMessagesPerRequestStep}}" />
<h4 data-i18n="Update frequency" class="textAlignCenter"> <h4 data-i18n="Update frequency" class="textAlignCenter">
@ -83,49 +83,49 @@
</h4> </h4>
<label for="memory_prompt_interval" class="title_restorable"> <label for="memory_prompt_interval" class="title_restorable">
<span> <span>
Update every <span id="memory_prompt_interval_value"></span> messages <span data-i18n="ext_sum_update_every_messages_1">Update every</span> <span id="memory_prompt_interval_value"></span> <span data-i18n="ext_sum_update_every_messages_2;[ru-case1]ext_sum_messages_ru_case1;[ru-case2]ext_sum_messages_ru_case2;[ru-case3]ext_sum_messages_ru_case3">messages</span>
<small class="memory_disabled_hint">0 = disable</small> <small class="memory_disabled_hint" data-i18n="ext_sum_0_disable">0 = disable</small>
</span> </span>
<div id="memory_prompt_interval_auto" title="Try to automatically adjust the interval based on the chat metrics." class="right_menu_button"> <div id="memory_prompt_interval_auto" data-i18n="[title]ext_sum_auto_adjust_desc" title="Try to automatically adjust the interval based on the chat metrics." class="right_menu_button">
<div class="fa-solid fa-wand-magic-sparkles"></div> <div class="fa-solid fa-wand-magic-sparkles"></div>
</div> </div>
</label> </label>
<input id="memory_prompt_interval" type="range" value="{{defaultSettings.promptInterval}}" min="{{defaultSettings.promptMinInterval}}" max="{{defaultSettings.promptMaxInterval}}" step="{{defaultSettings.promptIntervalStep}}" /> <input id="memory_prompt_interval" type="range" value="{{defaultSettings.promptInterval}}" min="{{defaultSettings.promptMinInterval}}" max="{{defaultSettings.promptMaxInterval}}" step="{{defaultSettings.promptIntervalStep}}" />
<label for="memory_prompt_words_force" class="title_restorable"> <label for="memory_prompt_words_force" class="title_restorable">
<span> <span>
Update every <span id="memory_prompt_words_force_value"></span> words <span data-i18n="ext_sum_update_every_words_1">Update every</span> <span id="memory_prompt_words_force_value"></span> <span data-i18n="ext_sum_update_every_words_2;[ru-case1]ext_sum_words_ru_case1;[ru-case2]ext_sum_words_ru_case2;[ru-case3]ext_sum_words_ru_case3">words</span>
<small class="memory_disabled_hint">0 = disable</small> <small class="memory_disabled_hint" data-i18n="ext_sum_0_disable">0 = disable</small>
</span> </span>
<div id="memory_prompt_words_auto" title="Try to automatically adjust the interval based on the chat metrics." class="right_menu_button"> <div id="memory_prompt_words_auto" data-i18n="[title]ext_sum_auto_adjust_desc" title="Try to automatically adjust the interval based on the chat metrics." class="right_menu_button">
<div class="fa-solid fa-wand-magic-sparkles"></div> <div class="fa-solid fa-wand-magic-sparkles"></div>
</div> </div>
</label> </label>
<input id="memory_prompt_words_force" type="range" value="{{defaultSettings.promptForceWords}}" min="{{defaultSettings.promptMinForceWords}}" max="{{defaultSettings.promptMaxForceWords}}" step="{{defaultSettings.promptForceWordsStep}}" /> <input id="memory_prompt_words_force" type="range" value="{{defaultSettings.promptForceWords}}" min="{{defaultSettings.promptMinForceWords}}" max="{{defaultSettings.promptMaxForceWords}}" step="{{defaultSettings.promptForceWordsStep}}" />
<small>If both sliders are non-zero, then both will trigger summary updates at their respective intervals.</small> <small data-i18n="ext_sum_both_sliders">If both sliders are non-zero, then both will trigger summary updates at their respective intervals.</small>
<hr> <hr>
</div> </div>
<div class="memory_template"> <div class="memory_template">
<label for="memory_template">Injection Template</label> <label for="memory_template" data-i18n="ext_sum_injection_template">Injection Template</label>
<textarea id="memory_template" class="text_pole textarea_compact" rows="2" placeholder="&lcub;&lcub;summary&rcub;&rcub; will resolve to the current summary contents."></textarea> <textarea id="memory_template" class="text_pole textarea_compact" rows="2" data-i18n="[placeholder]ext_sum_memory_template_placeholder" placeholder="&lcub;&lcub;summary&rcub;&rcub; will resolve to the current summary contents."></textarea>
</div> </div>
<label for="memory_position">Injection Position</label> <label for="memory_position" data-i18n="ext_sum_injection_position">Injection Position</label>
<div class="radio_group"> <div class="radio_group">
<label> <label>
<input type="radio" name="memory_position" value="2" /> <input type="radio" name="memory_position" value="2" />
Before Main Prompt / Story String <span data-i18n="Before Main Prompt / Story String">Before Main Prompt / Story String</span>
</label> </label>
<label> <label>
<input type="radio" name="memory_position" value="0" /> <input type="radio" name="memory_position" value="0" />
After Main Prompt / Story String <span data-i18n="After Main Prompt / Story String">After Main Prompt / Story String</span>
</label> </label>
<label class="flex-container alignItemsCenter" title="How many messages before the current end of the chat." data-i18n="[title]How many messages before the current end of the chat."> <label class="flex-container alignItemsCenter" title="How many messages before the current end of the chat." data-i18n="[title]How many messages before the current end of the chat.">
<input type="radio" name="memory_position" value="1" /> <input type="radio" name="memory_position" value="1" />
In-chat @ Depth <input id="memory_depth" class="text_pole widthUnset" type="number" min="0" max="999" /> <span data-i18n="In-chat @ Depth">In-chat @ Depth</span> <input id="memory_depth" class="text_pole widthUnset" type="number" min="0" max="999" />
as <span data-i18n="as">as</span>
<select id="memory_role" class="text_pole widthNatural"> <select id="memory_role" class="text_pole widthNatural">
<option value="0">System</option> <option value="0" data-i18n="System">System</option>
<option value="1">User</option> <option value="1" data-i18n="User">User</option>
<option value="2">Assistant</option> <option value="2" data-i18n="Assistant">Assistant</option>
</select> </select>
</label> </label>
</div> </div>

View File

@ -8,16 +8,16 @@
<div class="flex-container"> <div class="flex-container">
<div id="open_regex_editor" class="menu_button"> <div id="open_regex_editor" class="menu_button">
<i class="fa-solid fa-pen-to-square"></i> <i class="fa-solid fa-pen-to-square"></i>
<span>Open Editor</span> <span data-i18n="regex_open_editor">Open Editor</span>
</div> </div>
<div id="import_regex" class="menu_button"> <div id="import_regex" class="menu_button">
<i class="fa-solid fa-file-import"></i> <i class="fa-solid fa-file-import"></i>
<span>Import Script</span> <span data-i18n="regex_import_script">Import Script</span>
</div> </div>
<input type="file" id="import_regex_file" hidden accept="*.json" /> <input type="file" id="import_regex_file" hidden accept="*.json" />
</div> </div>
<hr /> <hr />
<label>Saved Scripts</label> <label data-i18n="regex_saved_scripts">Saved Scripts</label>
<div id="saved_regex_scripts" class="flex-container regex-script-container flexFlowColumn"></div> <div id="saved_regex_scripts" class="flex-container regex-script-container flexFlowColumn"></div>
</div> </div>
</div> </div>

View File

@ -11,7 +11,7 @@
</div> </div>
</h3> </h3>
<small class="flex-container extensions_info"> <small class="flex-container extensions_info" data-i18n="ext_regex_desc">
Regex is a tool to find/replace strings using regular expressions. If you want to learn more, click on the ? next to the title. Regex is a tool to find/replace strings using regular expressions. If you want to learn more, click on the ? next to the title.
</small> </small>
<hr /> <hr />
@ -21,13 +21,13 @@
<label class="title_restorable" for="regex_test_input"> <label class="title_restorable" for="regex_test_input">
<small data-i18n="Input">Input</small> <small data-i18n="Input">Input</small>
</label> </label>
<textarea id="regex_test_input" class="text_pole textarea_compact" rows="4" placeholder="Type here..."></textarea> <textarea id="regex_test_input" class="text_pole textarea_compact" rows="4" data-i18n="[placeholder]ext_regex_test_input_placeholder" placeholder="Type here..."></textarea>
</div> </div>
<div class="flex1"> <div class="flex1">
<label class="title_restorable" for="regex_test_output"> <label class="title_restorable" for="regex_test_output">
<small data-i18n="Output">Output</small> <small data-i18n="Output">Output</small>
</label> </label>
<textarea id="regex_test_output" class="text_pole textarea_compact" rows="4" placeholder="Empty" readonly></textarea> <textarea id="regex_test_output" class="text_pole textarea_compact" rows="4" data-i18n="[placeholder]ext_regex_output_placeholder" placeholder="Empty" readonly></textarea>
</div> </div>
<hr> <hr>
</div> </div>
@ -56,6 +56,7 @@
<div> <div>
<textarea <textarea
class="regex_replace_string text_pole wide100p textarea_compact" class="regex_replace_string text_pole wide100p textarea_compact"
data-i18n="[placeholder]ext_regex_replace_string_placeholder"
placeholder="Use {{match}} to include the matched text from the Find Regex or $1, $2, etc. for capture groups." placeholder="Use {{match}} to include the matched text from the Find Regex or $1, $2, etc. for capture groups."
rows="2" rows="2"
></textarea> ></textarea>
@ -67,7 +68,7 @@
</label> </label>
<div> <div>
<textarea <textarea
class="regex_trim_strings text_pole wide100p textarea_compact" class="regex_trim_strings text_pole wide100p textarea_compact" data-i18n="[placeholder]ext_regex_trim_placeholder"
placeholder="Globally trims any unwanted parts from a regex match before replacement. Separate each element by an enter." placeholder="Globally trims any unwanted parts from a regex match before replacement. Separate each element by an enter."
rows="3" rows="3"
></textarea> ></textarea>
@ -77,17 +78,17 @@
<div class="flex-container"> <div class="flex-container">
<div class="flex1 wi-enter-footer-text flex-container flexFlowColumn flexNoGap alignitemsstart"> <div class="flex1 wi-enter-footer-text flex-container flexFlowColumn flexNoGap alignitemsstart">
<small>Affects</small> <small data-i18n="ext_regex_affects">Affects</small>
<div> <div>
<label class="checkbox flex-container"> <label class="checkbox flex-container">
<input type="checkbox" name="replace_position" value="1"> <input type="checkbox" name="replace_position" value="1">
<span data-i18n="Before Char">User Input</span> <span data-i18n="ext_regex_user_input">User Input</span>
</label> </label>
</div> </div>
<div> <div>
<label class="checkbox flex-container"> <label class="checkbox flex-container">
<input type="checkbox" name="replace_position" value="2"> <input type="checkbox" name="replace_position" value="2">
<span data-i18n="After Char">AI Output</span> <span data-i18n="ext_regex_ai_output">AI Output</span>
</label> </label>
</div> </div>
<div> <div>
@ -98,23 +99,23 @@
</div> </div>
<div class="flex-container wide100p marginTop5"> <div class="flex-container wide100p marginTop5">
<div class="flex1 flex-container flexNoGap"> <div class="flex1 flex-container flexNoGap">
<small title="When applied to prompts or display, only affect messages that are at least N levels deep. 0 = last message, 1 = penultimate message, etc. Only counts usable messages, i.e. not hidden or system."> <small data-i18n="[title]ext_regex_min_depth_desc" title="When applied to prompts or display, only affect messages that are at least N levels deep. 0 = last message, 1 = penultimate message, etc. Only counts usable messages, i.e. not hidden or system.">
<span data-i18n="Min Depth">Min Depth</span> <span data-i18n="Min Depth">Min Depth</span>
<span class="fa-solid fa-circle-question note-link-span"></span> <span class="fa-solid fa-circle-question note-link-span"></span>
</small> </small>
<input name="min_depth" class="text_pole textarea_compact" type="number" min="0" max="999" placeholder="Unlimited" /> <input name="min_depth" class="text_pole textarea_compact" type="number" min="0" max="999" data-i18n="[placeholder]ext_regex_min_depth_placeholder" placeholder="Unlimited" />
</div> </div>
<div class="flex1 flex-container flexNoGap"> <div class="flex1 flex-container flexNoGap">
<small title="When applied to prompts or display, only affect messages no more than N levels deep. 0 = last message, 1 = penultimate message, etc. Only counts usable messages, i.e. not hidden or system."> <small data-i18n="[title]ext_regex_max_depth_desc" title="When applied to prompts or display, only affect messages no more than N levels deep. 0 = last message, 1 = penultimate message, etc. Only counts usable messages, i.e. not hidden or system.">
<span data-i18n="Max Depth">Max Depth</span> <span data-i18n="Max Depth">Max Depth</span>
<span class="fa-solid fa-circle-question note-link-span"></span> <span class="fa-solid fa-circle-question note-link-span"></span>
</small> </small>
<input name="max_depth" class="text_pole textarea_compact" type="number" min="0" max="999" placeholder="Unlimited" /> <input name="max_depth" class="text_pole textarea_compact" type="number" min="0" max="999" data-i18n="[placeholder]ext_regex_min_depth_placeholder" placeholder="Unlimited" />
</div> </div>
</div> </div>
</div> </div>
<div class="flex1 wi-enter-footer-text flex-container flexFlowColumn flexNoGap alignitemsstart"> <div class="flex1 wi-enter-footer-text flex-container flexFlowColumn flexNoGap alignitemsstart">
<small>Other Options</small> <small data-i18n="ext_regex_other_options">Other Options</small>
<label class="checkbox flex-container"> <label class="checkbox flex-container">
<input type="checkbox" name="disabled" /> <input type="checkbox" name="disabled" />
<span data-i18n="Disabled">Disabled</span> <span data-i18n="Disabled">Disabled</span>
@ -123,7 +124,7 @@
<input type="checkbox" name="only_format_display" /> <input type="checkbox" name="only_format_display" />
<span data-i18n="Only Format Display">Only Format Display</span> <span data-i18n="Only Format Display">Only Format Display</span>
</label> </label>
<label class="checkbox flex-container" title="Chat history won't change, only the prompt as the request is sent (on generation)"> <label class="checkbox flex-container" data-i18n="[title]ext_regex_only_format_prompt_desc" title="Chat history won't change, only the prompt as the request is sent (on generation)">
<input type="checkbox" name="only_format_prompt"/> <input type="checkbox" name="only_format_prompt"/>
<span> <span>
<span data-i18n="Only Format Prompt (?)">Only Format Prompt</span> <span data-i18n="Only Format Prompt (?)">Only Format Prompt</span>
@ -134,7 +135,7 @@
<input type="checkbox" name="run_on_edit" /> <input type="checkbox" name="run_on_edit" />
<span data-i18n="Run On Edit">Run On Edit</span> <span data-i18n="Run On Edit">Run On Edit</span>
</label> </label>
<label class="checkbox flex-container" title="Substitute {{macros}} in Find Regex before running it"> <label class="checkbox flex-container" data-i18n="[title]ext_regex_substitute_regex_desc" title="Substitute {{macros}} in Find Regex before running it">
<input type="checkbox" name="substitute_regex" /> <input type="checkbox" name="substitute_regex" />
<span> <span>
<span data-i18n="Substitute Regex">Substitute Regex</span> <span data-i18n="Substitute Regex">Substitute Regex</span>

View File

@ -4,16 +4,16 @@
<div class="flex-container flexnowrap"> <div class="flex-container flexnowrap">
<label class="checkbox flex-container" for="regex_disable"> <label class="checkbox flex-container" for="regex_disable">
<input type="checkbox" name="regex_disable" class="disable_regex" /> <input type="checkbox" name="regex_disable" class="disable_regex" />
<span class="regex-toggle-on fa-solid fa-toggle-on" title="Disable script"></span> <span class="regex-toggle-on fa-solid fa-toggle-on" data-i18n="[title]regex_disable_script" title="Disable script"></span>
<span class="regex-toggle-off fa-solid fa-toggle-off" title="Enable script"></span> <span class="regex-toggle-off fa-solid fa-toggle-off" data-i18n="[title]regex_enable_script" title="Enable script"></span>
</label> </label>
<div class="edit_existing_regex menu_button" title="Edit script"> <div class="edit_existing_regex menu_button" data-i18n="[title]regex_edit_script" title="Edit script">
<i class="fa-solid fa-pencil"></i> <i class="fa-solid fa-pencil"></i>
</div> </div>
<div class="export_regex menu_button" title="Export script"> <div class="export_regex menu_button" data-i18n="[title]regex_export_script" title="Export script">
<i class="fa-solid fa-file-export"></i> <i class="fa-solid fa-file-export"></i>
</div> </div>
<div class="delete_regex menu_button" title="Delete script"> <div class="delete_regex menu_button" data-i18n="[title]regex_delete_script" title="Delete script">
<i class="fa-solid fa-trash"></i> <i class="fa-solid fa-trash"></i>
</div> </div>
</div> </div>