Work on tl
| @@ -2401,7 +2401,8 @@ | |||
| 2401 | "Kiwibunga": "Настолько пусто, что киви прилетела посидеть", | 2401 | "Kiwibunga": "Настолько пусто, что киви прилетела посидеть", |
| 2402 | "Pump-a-Rum": "Пу-пу-пу", | 2402 | "Pump-a-Rum": "Пу-пу-пу", |
| 2403 | "Croak it": "Только кваканье лягушек и стрёкот сверчков", | 2403 | "Croak it": "Только кваканье лягушек и стрёкот сверчков", |
| 2404 | "${0} ${1} hidden.": "Персонажей скрыто: ${0}.", | 2404 | "${0} character hidden.": "Персонажей скрыто: ${0}.", |
| 2405 | "${0} characters hidden.": "Персонажей скрыто: ${0}.", | ||
| 2405 | "pagination_of": "из", | 2406 | "pagination_of": "из", |
| 2406 | "/ page": "/ стр.", | 2407 | "/ page": "/ стр.", |
| 2407 | "Context Length": "Размер контекста", | 2408 | "Context Length": "Размер контекста", |
| @@ -2412,7 +2413,7 @@ | |||
| 2412 | "Duplicate": "Клонировать", | 2413 | "Duplicate": "Клонировать", |
| 2413 | "Next page": "След. страница", | 2414 | "Next page": "След. страница", |
| 2414 | "Previous page": "Пред. страница", | 2415 | "Previous page": "Пред. страница", |
| 2415 | "Group:": "Группа:", | 2416 | "Group: ${0}": "Группа: ${0}", |
| 2416 | "You deleted a character/chat and arrived back here for safety reasons! Pick another character!": "Вы удалили персонажа или чат, и мы из соображений безопасности перенесли вас на эту страницу! Выберите другого персонажа!", | 2417 | "You deleted a character/chat and arrived back here for safety reasons! Pick another character!": "Вы удалили персонажа или чат, и мы из соображений безопасности перенесли вас на эту страницу! Выберите другого персонажа!", |
| 2417 | "Group is empty.": "Группа пуста.", | 2418 | "Group is empty.": "Группа пуста.", |
| 2418 | "No characters available": "Персонажей нет", | 2419 | "No characters available": "Персонажей нет", |
| @@ -1446,7 +1446,7 @@ function getHiddenBlock(hidden) { | |||
| 1446 | const hiddenBlock = ` | 1446 | const hiddenBlock = ` |
| 1447 | <div class="text_block hidden_block"> | 1447 | <div class="text_block hidden_block"> |
| 1448 | <small> | 1448 | <small> |
| 1449 | <p>` + t`${hidden} ${hidden > 1 ? 'characters' : 'character'} hidden.` + `</p> | 1449 | <p>` + (hidden > 1 ? t`${hidden} characters hidden.` : t`${hidden} character hidden.`) + `</p> |
| 1450 | <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Characters and groups hidden by filters or closed folders" title="Characters and groups hidden by filters or closed folders"></div> | 1450 | <div class="fa-solid fa-circle-info opacity50p" data-i18n="[title]Characters and groups hidden by filters or closed folders" title="Characters and groups hidden by filters or closed folders"></div> |
| 1451 | </small> | 1451 | </small> |
| 1452 | </div>`; | 1452 | </div>`; |
| @@ -8429,15 +8429,15 @@ export function callPopup(text, type, inputValue = '', { okButton, rows, wide, w | |||
| 8429 | function getOkButtonText() { | 8429 | function getOkButtonText() { |
| 8430 | if (['text', 'char_not_selected'].includes(popup_type)) { | 8430 | if (['text', 'char_not_selected'].includes(popup_type)) { |
| 8431 | $dialoguePopupCancel.css('display', 'none'); | 8431 | $dialoguePopupCancel.css('display', 'none'); |
| 8432 | return okButton ?? 'Ok'; | 8432 | return okButton ?? t`Ok`; |
| 8433 | } else if (['delete_extension'].includes(popup_type)) { | 8433 | } else if (['delete_extension'].includes(popup_type)) { |
| 8434 | return okButton ?? 'Ok'; | 8434 | return okButton ?? t`Ok`; |
| 8435 | } else if (['new_chat', 'confirm'].includes(popup_type)) { | 8435 | } else if (['new_chat', 'confirm'].includes(popup_type)) { |
| 8436 | return okButton ?? t`Yes`; | 8436 | return okButton ?? t`Yes`; |
| 8437 | } else if (['input'].includes(popup_type)) { | 8437 | } else if (['input'].includes(popup_type)) { |
| 8438 | return okButton ?? t`Save`; | 8438 | return okButton ?? t`Save`; |
| 8439 | } | 8439 | } |
| 8440 | return okButton ?? 'Delete'; | 8440 | return okButton ?? t`Delete`; |
| 8441 | } | 8441 | } |
| 8442 | 8442 | ||
| 8443 | dialogueCloseStop = true; | 8443 | dialogueCloseStop = true; |
| @@ -6,6 +6,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js'; | |||
| 6 | import { SlashCommandParser } from './slash-commands/SlashCommandParser.js'; | 6 | import { SlashCommandParser } from './slash-commands/SlashCommandParser.js'; |
| 7 | import { flashHighlight, stringFormat } from './utils.js'; | 7 | import { flashHighlight, stringFormat } from './utils.js'; |
| 8 | import { t } from './i18n.js'; | 8 | import { t } from './i18n.js'; |
| 9 | import { Popup } from './popup.js'; | ||
| 9 | 10 | ||
| 10 | const BG_METADATA_KEY = 'custom_background'; | 11 | const BG_METADATA_KEY = 'custom_background'; |
| 11 | const LIST_METADATA_KEY = 'chat_backgrounds'; | 12 | const LIST_METADATA_KEY = 'chat_backgrounds'; |
| @@ -291,7 +292,7 @@ async function onDeleteBackgroundClick(e) { | |||
| 291 | const bgToDelete = $(this).closest('.bg_example'); | 292 | const bgToDelete = $(this).closest('.bg_example'); |
| 292 | const url = bgToDelete.data('url'); | 293 | const url = bgToDelete.data('url'); |
| 293 | const isCustom = bgToDelete.attr('custom') === 'true'; | 294 | const isCustom = bgToDelete.attr('custom') === 'true'; |
| 294 | const confirm = await callPopup('<h3>' + t`Delete the background?` + '</h3>', 'confirm'); | 295 | const confirm = await Popup.show.confirm(t`Delete the background?`, null); |
| 295 | const bg = bgToDelete.attr('bgfile'); | 296 | const bg = bgToDelete.attr('bgfile'); |
| 296 | 297 | ||
| 297 | if (confirm) { | 298 | if (confirm) { |
| @@ -1808,7 +1808,7 @@ async function createGroup() { | |||
| 1808 | const memberNames = characters.filter(x => members.includes(x.avatar)).map(x => x.name).join(', '); | 1808 | const memberNames = characters.filter(x => members.includes(x.avatar)).map(x => x.name).join(', '); |
| 1809 | 1809 | ||
| 1810 | if (!name) { | 1810 | if (!name) { |
| 1811 | name = t`Group:` + ` ${memberNames}`; | 1811 | name = t`Group: ${memberNames}`; |
| 1812 | } | 1812 | } |
| 1813 | 1813 | ||
| 1814 | const avatar_url = $('#group_avatar_preview img').attr('src'); | 1814 | const avatar_url = $('#group_avatar_preview img').attr('src'); |
| @@ -3851,7 +3851,7 @@ function createLogitBiasListItem(entry) { | |||
| 3851 | } | 3851 | } |
| 3852 | 3852 | ||
| 3853 | async function createNewLogitBiasPreset() { | 3853 | async function createNewLogitBiasPreset() { |
| 3854 | const name = await callPopup(t`Preset name:`, 'input'); | 3854 | const name = await Popup.show.input(t`Preset name:`, null); |
| 3855 | 3855 | ||
| 3856 | if (!name) { | 3856 | if (!name) { |
| 3857 | return; | 3857 | return; |
| @@ -1656,14 +1656,7 @@ async function onTagDeleteClick() { | |||
| 1656 | const tag = tags.find(x => x.id === id); | 1656 | const tag = tags.find(x => x.id === id); |
| 1657 | const otherTags = sortTags(tags.filter(x => x.id !== id).map(x => ({ id: x.id, name: x.name }))); | 1657 | const otherTags = sortTags(tags.filter(x => x.id !== id).map(x => ({ id: x.id, name: x.name }))); |
| 1658 | 1658 | ||
| 1659 | const popupContent = $(` | 1659 | const popupContent = $(await renderTemplateAsync('deleteTag', {otherTags})); |
| 1660 | <h3>` + t`Delete Tag` + `</h3> | ||
| 1661 | <div>` + t`Do you want to delete the tag` + ` <div id="tag_to_delete" class="tags_inline inline-flex margin-r2"></div>?</div> | ||
| 1662 | <div class="m-t-2 marginBot5">` + t`If you want to merge all references to this tag into another tag, select it below:` + `</div> | ||
| 1663 | <select id="merge_tag_select"> | ||
| 1664 | <option value="">--- None ---</option> | ||
| 1665 | ${otherTags.map(x => `<option value="${x.id}">${x.name}</option>`).join('')} | ||
| 1666 | </select>`); | ||
| 1667 | 1660 | ||
| 1668 | appendTagToList(popupContent.find('#tag_to_delete'), tag); | 1661 | appendTagToList(popupContent.find('#tag_to_delete'), tag); |
| 1669 | 1662 | ||
| @@ -0,0 +1,9 @@ | |||
| 1 | <h3 data-i18n="Delete Tag">Delete Tag</h3> | ||
| 2 | <div><span data-i18n="Do you want to delete the tag">Do you want to delete the tag</span> <div id="tag_to_delete" class="tags_inline inline-flex margin-r2"></div>?</div> | ||
| 3 | <div class="m-t-2 marginBot5" data-i18n="If you want to merge all references to this tag into another tag, select it below:">If you want to merge all references to this tag into another tag, select it below:</div> | ||
| 4 | <select id="merge_tag_select"> | ||
| 5 | <option value="">--- None ---</option> | ||
| 6 | {{#each otherTags}} | ||
| 7 | <option value="{{this.id}}">{{this.name}}</option> | ||
| 8 | {{/each}} | ||
| 9 | </select> | ||
| \ No newline at end of file | 9 | \ No newline at end of file | |