Work on tl

383d46fe4daeb5bd81b6c3b1c6ca212e0b79e682

Yokayo <nonameutubecomm@gmail.com>

7 files changed, +82 -32Ignore whitespace
public/index.html+1 -1
@@ -4120,7 +4120,7 @@
41204120 <input id="movingUImode" type="checkbox" />
41214121 <small data-i18n="Movable UI Panels">MovingUI&nbsp;<i class="fa-solid fa-desktop"></i></small>
41224122 </label>
41234123 <div data-newbie-hidden id="movingUIreset" title="Reset MovingUI panel sizes/locations." class="menu_button margin0" data-i18n="[title]Reset MovingUI panel sizes/locations."><i class=" fa-solid fa-recycle margin-r5"></i> <span data-i18n="mui_reset">Reset</span></div>
41244124 </div>
41254125 <div data-newbie-hidden id="MovingUI-presets-block" class="flex-container alignitemscenter">
41264126 <div class="flex-container alignItemsFlexEnd">
public/locales/ru-ru.json+54 -7
@@ -43,7 +43,7 @@
4343 "Smoothing Factor": "Коэффициент сглаживания",
4444 "No Repeat Ngram Size": "Размер no_repeat_ngram",
4545 "Min Length": "Мин. длина",
4646 "Alternative server URL (leave empty to use the default value).": "Альтернативный URL альтернативного сервера (оставьте пустым для стандартного значения)",
4747 "Remove your real OAI API Key from the API panel BEFORE typing anything into this box": "Удалите свой личный OAI API Key из панели API, и ТОЛЬКО ПОСЛЕ ЭТОГО вводите что-то сюда",
4848 "We cannot provide support for problems encountered while using an unofficial OpenAI proxy": "Мы не сможем предоставить помощь с проблемами, с которыми вы столкнетесь при использовании неофициальных прокси для OpenAI",
4949 "Context Size (tokens)": "Размер контекста (в токенах)",
@@ -186,7 +186,7 @@
186186 "Generate only one line per request": "Генерировать одну строку на запрос",
187187 "Misc. Settings": "Доп. настройки",
188188 "Auto-Continue": "Авто-продолжение",
189189 "Collapse Consecutive Newlines": "Сворачивать последовательныенеск. новыеновых строкистрок в одну",
190190 "Allow for Chat Completion APIs": "Разрешить для Chat Completion API",
191191 "Target length (tokens)": "Целевая длина (в токенах)",
192192 "World Info": "Информация о мире",
@@ -373,7 +373,7 @@
373373 "Prefer Character Card Prompt": "Приоритет промпту из карточки персонажа",
374374 "Prefer Character Card Jailbreak": "Приоритет джейлбрейку из карточки персонажа",
375375 "Press Send to continue": "Кнопка отправки продолжает сообщение",
376376 "Quick 'Continue' button": "Кнопка быстрогоБыстрое продолженияпродолжение",
377377 "Log prompts to console": "Выводить промпты в консоль",
378378 "Never resize avatars": "Не менять размер аватарок",
379379 "Show avatar filenames": "Показывать названия файлов аватарок",
@@ -495,7 +495,7 @@
495495 "(Write a comma-separated list of tags)": "(Список тегов через запятую)",
496496 "(A brief description of the personality)": "(Краткое описание личности)",
497497 "(Circumstances and context of the interaction)": "(Обстоятельства и контекст этого диалога)",
498498 "(Examples of chat dialog. Begin each example with START on a new line.)": "(Примеры диалога. Начинайте каждый пример с START или новой линиейстрокой.)",
499499 "Type here...": "Пишите здесь...",
500500 "Comma separated (required)": "Через запятую (обязательное поле)",
501501 "What this keyword should mean to the AI, sent verbatim": "Что это ключевое слово должно означать для ИИ, отправляется дословно",
@@ -552,7 +552,7 @@
552552 "Click to set a new User Name": "Нажмите, чтобы задать новое имя пользователя.",
553553 "Click to lock your selected persona to the current chat. Click again to remove the lock.": "Нажмите, чтобы закрепить выбранную персону для текущего чата. Нажмите еще раз, чтобы открепить.",
554554 "Click to set user name for all messages": "Нажмите, чтобы задать имя пользователя для всех сообщений.",
555555 "Create a dummy persona": "Создать пустую персону-болванку",
556556 "Character Management": "Управление персонажами",
557557 "Locked = Character Management panel will stay open": "Закреплено = Панель управление персонажами останется открытой",
558558 "Select/Create Characters": "Выбрать/Создать персонажа",
@@ -625,7 +625,7 @@
625625 "Automatically select a background based on the chat context": "Автоматический выбор фона в зависимости от контекста чата",
626626 "Filter": "Фильтр",
627627 "Exclude message from prompts": "Исключить сообщение из промпта",
628628 "Include message in prompts": "Включить сообщение в подсказкипромпт",
629629 "Create checkpoint": "Создать чекпоинт",
630630 "Create Branch": "Создать ветку",
631631 "Embed file or image": "Вставить файл или изображение",
@@ -1661,5 +1661,52 @@
16611661 "ext_regex_ai_output_desc": "Сообщения, полученные от API",
16621662 "ext_regex_sts_desc": "Сообщения, отправленные с помощью команд STscript",
16631663 "ext_regex_wi_desc": "Содержимое лорбуков и миров. Для работы требует включения флажка \"Только промпт\"!",
16641664 "ext_regex_only_format_display_desc": "История чата не изменится, замена будет осуществляться только в отображаемом сообщении (в UI)",
1665+ "Prefer Character Card Instructions": "Приоритет инструкциям из карточек",
1666+ "If checked and the character card contains a Post-History Instructions override, use that instead": "Если в карточке персонажа имеется собственная инструкция после истории, в промпт попадёт именно она",
1667+ "Auto-select Input Text": "Автовыделение вводимого текста",
1668+ "Enable auto-select of input text in some text fields when clicking/selecting them. Applies to popup input textboxes, and possible other custom input fields.": "Автоматически выделять вводимый текст в некоторых текстовых полях при клике/выборе. Работает для вспл. окон и различных кастомных полей ввода.",
1669+ "Reset MovingUI panel sizes/locations.": "Сбросить расположение и размеры панелей MovingUI.",
1670+ "mui_reset": "Сброс",
1671+ "Quick 'Impersonate' button": "Быстрое перевоплощение",
1672+ "Show a button in the input area to ask the AI to impersonate your character for a single message": "Показать в поле ввода кнопку, по нажатии на которую ИИ сгенерирует одно сообщение от лица вашего персонажа.",
1673+ "Separators as Stop Strings": "Разделители как стоп-строки",
1674+ "Names as Stop Strings": "Имена как стоп-строки",
1675+ "Add Character and User names to a list of stopping strings.": "Добавлять имена персонажа и пользователя в список стоп-строк.",
1676+ "Allow Post-History Instructions": "Разрешить инструкции после истории",
1677+ "context_allow_post_history_instructions": "Добавлять в конец промпта инструкции после истории. Работает только при наличии таких инструкций в карточке И при включенной опции ''Приоритет инструкциям из карточек''.\nНЕ РЕКОМЕНДУЕТСЯ ДЛЯ МОДЕЛЕЙ TEXT COMPLETION, МОЖЕТ ПОРТИТЬ ВЫХОДНОЙ ТЕКСТ.",
1678+ "First User Prefix": "Первый префикс пользователя",
1679+ "Inserted before the first User's message.": "Вставляется перед первым сообщением пользователя.",
1680+ "Last User Prefix": "Последний префикс пользователя",
1681+ "instruct_last_input_sequence": "Вставляется перед последним сообщением пользователя.",
1682+ "Inserted before a User message and as a last prompt line when impersonating.": "Вставляется перед сообщением пользователя в качестве последней строки промпта при перевоплощении.",
1683+ "Inserted before a System (added by slash commands or extensions) message.": "Вставляется перед сообщением системы (может быть добавлено слэш-командой или расширением).",
1684+ "Load Asset List": "Загрузить список ресурсов",
1685+ "Never add character names.": "Не вставлять имя персонажа.",
1686+ "Don't add character names unless necessary.": "Вставлять имя персонажа только когда это необходимо.",
1687+ "character_names_none": "Не добавлять имена персонажей в качестве префикса. Может повредить качеству ответов в групповых чатах, используйте с осторожностью.",
1688+ "Auxiliary": "Вспомогательный",
1689+ "Post-History Instructions": "Инструкции после истории",
1690+ "Current persona updated": "Текущая персона изменена",
1691+ "Your messages will now be sent as ${0}": "Ваши сообщения будут отправляться от лица ${0}",
1692+ "Copied!": "Скопировано!",
1693+ "Are you sure you want to delete this message?": "Вы точно хотите удалить это сообщение?",
1694+ "Delete Message": "Удалить сообщение",
1695+ "Delete Swipe": "Удалить свайп",
1696+ "Could not get a reply from API. Check your connection settings / API key and try again.": "Не удалось получить ответ от API. Проверьте настройки соединения и API-ключ и повторите попытку.",
1697+ "Connecting To Proxy": "Подключение к прокси",
1698+ "Are you sure you want to connect to the following proxy URL?": "Вы точно хотите соединиться с прокси по этому адресу?",
1699+ "API connection successful!": "Соединение с API установлено!",
1700+ "Proxy Saved": "Прокси сохранена",
1701+ "Proxy Deleted": "Прокси удалена",
1702+ "Could not find proxy with name '${0}'": "Не удалось найти прокси с названием '${0}'",
1703+ "Proxy preset '${0}' not found in proxies array.": "Пресет с названием '${0}' не найден в списке прокси.",
1704+ "Please wait for the previous request to complete.": "Пожалуйста, дождитесь окончания обработки предыдущего запроса."
1705+ "Start new chat?": "Начать новый чат?",
1706+ "If necessary, you can later restore this chat file from the /backups folder": "При необходимости этот чат можно будет восстановить из папки /backups",
1707+ "Also delete the current chat file": "Также удалить текущий чат",
1708+ "chat_rename_1": "Введите новое имя чата:",
1709+ "chat_rename_2": "!!Не используйте имя уже существующего файла, это приведёт к ошибке!!",
1710+ "chat_rename_3": "Будут разрушены связи между чатами-чекпоинтами.",
1711+ "chat_rename_4": "Расширение '.jsonl' дописывать не нужно."
16651712}
public/script.js+7 -16
@@ -2191,7 +2191,7 @@ export function addCopyToCodeBlocks(messageElement) {
21912191 codeBlocks.get(i).appendChild(copyButton);
21922192 copyButton.addEventListener('pointerup', function (event) {
21932193 navigator.clipboard.writeText(codeBlocks.get(i).innerText);
21942194 toastr.info('t`Copied!'`, '', { timeOut: 2000 });
21952195 });
21962196 }
21972197 }
@@ -6309,7 +6309,7 @@ export function setUserName(value) {
63096309 console.log(`User name changed to ${name1}`);
63106310 $('#your_name').val(name1);
63116311 if (power_user.persona_show_notifications) {
63126312 toastr.success(t`Your messages will now be sent as ${name1}`, 't`Current persona updated'`);
63136313 }
63146314 saveSettingsDebounced();
63156315}
@@ -9530,11 +9530,7 @@ jQuery(async function () {
95309530 const oldFileNameFull = $(this).closest('.select_chat_block_wrapper').find('.select_chat_block_filename').text();
95319531 const oldFileName = oldFileNameFull.replace('.jsonl', '');
95329532
9533- const popupText = `<h3>Enter the new name for the chat:<h3>
9533+ const popupText = await renderTemplateAsync('chatRename');
9534- <small>!!Using an existing filename will produce an error!!<br>
9535- This will break the link between checkpoint chats.<br>
9536- No need to add '.jsonl' at the end.<br>
9537- </small>`;
95389534 const newName = await callPopup(popupText, 'input', oldFileName);
95399535
95409536 if (!newName || newName == oldFileName) {
@@ -9742,12 +9738,7 @@ jQuery(async function () {
97429738 else if (id == 'option_start_new_chat') {
97439739 if ((selected_group || this_chid !== undefined) && !is_send_press) {
97449740 let deleteCurrentChat = false;
97459741 const result = await Popup.show.confirm('t`Start new chat?`, await renderTemplateAsync('newChatConfirm'), `{
9746- <label for="del_chat_checkbox" class="checkbox_label justifyCenter"
9747- title="If necessary, you can later restore this chat file from the /backups folder">
9748- <input type="checkbox" id="del_chat_checkbox" />
9749- <small>Also delete the current chat file</small>
9750- </label>`, {
97519742 onClose: () => deleteCurrentChat = !!$('#del_chat_checkbox').prop('checked'),
97529743 });
97539744 if (!result) {
@@ -10259,10 +10250,10 @@ jQuery(async function () {
1025910250
1026010251 let deleteOnlySwipe = false;
1026110252 if (power_user.confirm_message_delete && fromSlashCommand !== true) {
1026210253 const result = await callGenericPopup('t`Are you sure you want to delete this message?'`, POPUP_TYPE.CONFIRM, null, {
1026310254 okButton: canDeleteSwipe ? 't`Delete Swipe'` : 't`Delete Message'`,
1026410255 cancelButton: 'Cancel',
1026510256 customButtons: canDeleteSwipe ? ['t`Delete Message'`] : null,
1026610257 });
1026710258 if (!result) {
1026810259 return;
public/scripts/openai.js+9 -8
@@ -74,6 +74,7 @@ import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashComma
7474import { renderTemplateAsync } from './templates.js';
7575import { SlashCommandEnumValue } from './slash-commands/SlashCommandEnumValue.js';
7676import { Popup, POPUP_RESULT } from './popup.js';
77+import { t } from './i18n.js';
7778
7879export {
7980 openai_messages_count,
@@ -425,7 +426,7 @@ async function validateReverseProxy() {
425426 const rememberKey = `Proxy_SkipConfirm_${getStringHash(oai_settings.reverse_proxy)}`;
426427 const skipConfirm = localStorage.getItem(rememberKey) === 'true';
427428
428429 const confirmation = skipConfirm || await Popup.show.confirm('t`Connecting To Proxy', `<span>Are you sure you want to connect to the, followingawait proxyrenderTemplateAsync('proxyConnectionWarning', URL?</span><var>${proxyURL: DOMPurify.sanitize(oai_settings.reverse_proxy)}</var>`));
429430
430431 if (!confirmation) {
431432 toastr.error('Update or remove your reverse proxy settings.');
@@ -4673,17 +4674,17 @@ function toggleChatCompletionForms() {
46734674async function testApiConnection() {
46744675 // Check if the previous request is still in progress
46754676 if (is_send_press) {
46764677 toastr.info('t`Please wait for the previous request to complete.'`);
46774678 return;
46784679 }
46794680
46804681 try {
46814682 const reply = await sendOpenAIRequest('quiet', [{ 'role': 'user', 'content': 'Hi' }]);
46824683 console.log(reply);
46834684 toastr.success('t`API connection successful!'`);
46844685 }
46854686 catch (err) {
46864687 toastr.error('t`Could not get a reply from API. Check your connection settings / API key and try again.'`);
46874688 }
46884689}
46894690
@@ -4837,7 +4838,7 @@ function onProxyPresetChange() {
48374838 if (selectedPreset) {
48384839 setProxyPreset(selectedPreset.name, selectedPreset.url, selectedPreset.password);
48394840 } else {
48404841 console.error(t`Proxy preset "'${value}"' not found in proxies array.`);
48414842 }
48424843 saveSettingsDebounced();
48434844}
@@ -4849,7 +4850,7 @@ $('#save_proxy').on('click', async function () {
48494850
48504851 setProxyPreset(presetName, reverseProxy, proxyPassword);
48514852 saveSettingsDebounced();
48524853 toastr.success('t`Proxy Saved'`);
48534854 if ($('#openai_proxy_preset').val() !== presetName) {
48544855 const option = document.createElement('option');
48554856 option.text = presetName;
@@ -4883,9 +4884,9 @@ $('#delete_proxy').on('click', async function () {
48834884
48844885 saveSettingsDebounced();
48854886 $('#openai_proxy_preset').val(selected_proxy.name);
48864887 toastr.success('t`Proxy Deleted'`);
48874888 } else {
48884889 toastr.error(t`Could not find proxy with name "'${presetName}"'`);
48894890 }
48904891});
48914892
public/scripts/templates/chatRename.html+6 -0
@@ -0,0 +1,6 @@
1+<h3 data-i18n="chat_rename_1">Enter the new name for the chat:</h3>
2+<small>
3+ <span data-i18n="chat_rename_2">!!Using an existing filename will produce an error!!</span><br>
4+ <span data-i18n="chat_rename_3">This will break the link between checkpoint chats.</span><br>
5+ <span data-i18n="chat_rename_4">No need to add '.jsonl' at the end.</span><br>
6+</small>
6 \ No newline at end of file
public/scripts/templates/newChatConfirm.html+4 -0
@@ -0,0 +1,4 @@
1+<label for="del_chat_checkbox" class="checkbox_label justifyCenter" data-i18n="[title]If necessary, you can later restore this chat file from the /backups folder" title="If necessary, you can later restore this chat file from the /backups folder">
2+ <input type="checkbox" id="del_chat_checkbox" />
3+ <small data-i18n="Also delete the current chat file">Also delete the current chat file</small>
4+</label>
4 \ No newline at end of file
public/scripts/templates/proxyConnectionWarning.html+1 -0
@@ -0,0 +1 @@
1+<span data-i18n="Are you sure you want to connect to the following proxy URL?">Are you sure you want to connect to the following proxy URL?</span><var>{{proxyURL}}</var>
1 \ No newline at end of file