diff --git a/public/css/rm-groups.css b/public/css/rm-groups.css
index 499f59873..6e12164b2 100644
--- a/public/css/rm-groups.css
+++ b/public/css/rm-groups.css
@@ -87,7 +87,7 @@
}
#rm_group_members:empty::before {
- content: 'Group is empty';
+ content: attr(group_empty_text);
font-weight: bolder;
width: 100%;
@@ -115,7 +115,7 @@
}
#rm_group_add_members:empty::before {
- content: 'No characters available';
+ content: attr(no_characters_text);
font-weight: bolder;
width: 100%;
diff --git a/public/index.html b/public/index.html
index f3b04f1bc..c8b671eaa 100644
--- a/public/index.html
+++ b/public/index.html
@@ -2052,8 +2052,8 @@
-
-
${texts[roll]}
-
There are no items to display.
-
`;
+ const params = {
+ text: texts[roll],
+ icon: icons[roll],
+ };
+ const emptyBlock = await renderTemplateAsync('emptyBlock', params);
return $(emptyBlock);
}
/**
* @param {number} hidden Number of hidden characters
*/
-function getHiddenBlock(hidden) {
- const hiddenBlock = `
-
-
- ${hidden} ${hidden > 1 ? 'characters' : 'character'} hidden.
-
-
-
`;
+async function getHiddenBlock(hidden) {
+ const params = {
+ text: (hidden > 1 ? t`${hidden} characters hidden.` : t`${hidden} character hidden.`),
+ };
+ const hiddenBlock = await renderTemplateAsync('hiddenBlock', params);
return $(hiddenBlock);
}
@@ -1526,10 +1527,11 @@ export async function printCharacters(fullRefresh = false) {
const entities = getEntitiesList({ doFilter: true });
+ const pageSize = Number(accountStorage.getItem(storageKey)) || per_page_default;
+ const sizeChangerOptions = [10, 25, 50, 100, 250, 500, 1000];
$('#rm_print_characters_pagination').pagination({
dataSource: entities,
- pageSize: Number(accountStorage.getItem(storageKey)) || per_page_default,
- sizeChangerOptions: [10, 25, 50, 100, 250, 500, 1000],
+ pageSize,
pageRange: 1,
pageNumber: saveCharactersPage || 1,
position: 'top',
@@ -1538,14 +1540,16 @@ export async function printCharacters(fullRefresh = false) {
prevText: '<',
nextText: '>',
formatNavigator: PAGINATION_TEMPLATE,
+ formatSizeChanger: renderPaginationDropdown(pageSize, sizeChangerOptions),
showNavigator: true,
- callback: function (/** @type {Entity[]} */ data) {
+ callback: async function (/** @type {Entity[]} */ data) {
$(listId).empty();
if (power_user.bogus_folders && isBogusFolderOpen()) {
$(listId).append(getBackBlock());
}
if (!data.length) {
- $(listId).append(getEmptyBlock());
+ const emptyBlock = await getEmptyBlock();
+ $(listId).append(emptyBlock);
}
let displayCount = 0;
for (const i of data) {
@@ -1566,13 +1570,16 @@ export async function printCharacters(fullRefresh = false) {
const hidden = (characters.length + groups.length) - displayCount;
if (hidden > 0 && entitiesFilter.hasAnyFilter()) {
- $(listId).append(getHiddenBlock(hidden));
+ const hiddenBlock = await getHiddenBlock(hidden);
+ $(listId).append(hiddenBlock);
}
+ localizePagination($('#rm_print_characters_pagination'));
eventSource.emit(event_types.CHARACTER_PAGE_LOADED);
},
- afterSizeSelectorChange: function (e) {
+ afterSizeSelectorChange: function (e, size) {
accountStorage.setItem(storageKey, e.target.value);
+ paginationDropdownChangeHandler(e, size);
},
afterPaging: function (e) {
saveCharactersPage = e;
@@ -8430,15 +8437,15 @@ export function callPopup(text, type, inputValue = '', { okButton, rows, wide, w
function getOkButtonText() {
if (['text', 'char_not_selected'].includes(popup_type)) {
$dialoguePopupCancel.css('display', 'none');
- return okButton ?? 'Ok';
+ return okButton ?? t`Ok`;
} else if (['delete_extension'].includes(popup_type)) {
- return okButton ?? 'Ok';
+ return okButton ?? t`Ok`;
} else if (['new_chat', 'confirm'].includes(popup_type)) {
- return okButton ?? 'Yes';
+ return okButton ?? t`Yes`;
} else if (['input'].includes(popup_type)) {
return okButton ?? t`Save`;
}
- return okButton ?? 'Delete';
+ return okButton ?? t`Delete`;
}
dialogueCloseStop = true;
diff --git a/public/scripts/backgrounds.js b/public/scripts/backgrounds.js
index 308aac532..64ffbeabd 100644
--- a/public/scripts/backgrounds.js
+++ b/public/scripts/backgrounds.js
@@ -6,6 +6,7 @@ import { SlashCommand } from './slash-commands/SlashCommand.js';
import { SlashCommandParser } from './slash-commands/SlashCommandParser.js';
import { flashHighlight, stringFormat } from './utils.js';
import { t } from './i18n.js';
+import { Popup } from './popup.js';
const BG_METADATA_KEY = 'custom_background';
const LIST_METADATA_KEY = 'chat_backgrounds';
@@ -291,7 +292,7 @@ async function onDeleteBackgroundClick(e) {
const bgToDelete = $(this).closest('.bg_example');
const url = bgToDelete.data('url');
const isCustom = bgToDelete.attr('custom') === 'true';
- const confirm = await callPopup('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:
+
+
+
{{text}}
+
+ There are no items to display.
+
+
diff --git a/public/scripts/templates/hiddenBlock.html b/public/scripts/templates/hiddenBlock.html
new file mode 100644
index 000000000..6b1d84406
--- /dev/null
+++ b/public/scripts/templates/hiddenBlock.html
@@ -0,0 +1,6 @@
+