Extract templates, replace pagination format

This commit is contained in:
Cohee
2025-05-01 17:46:02 +03:00
parent e4d389a5b6
commit a089727591
5 changed files with 33 additions and 46 deletions

View File

@ -18,21 +18,8 @@ import { getCurrentLocale, t, translate } from './i18n.js';
/**
* Function returning pagination status string template.
* @type {function}
*/
export const PAGINATION_TEMPLATE = function() {
let translated_of;
try {
translated_of = translate('pagination_of');
if (translated_of == 'pagination_of') {
translated_of = 'of';
}
} catch (e) {
console.error(e);
translated_of = 'of';
}
return `<%= rangeStart %>-<%= rangeEnd %> ${translated_of} <%= totalNumber %>`;
};
export const PAGINATION_TEMPLATE = '<%= rangeStart %>-<%= rangeEnd %> .. <%= totalNumber %>';
export const localizePagination = function(container) {
let options = container.find('option');