Make pagination numbers locale aware for #1056

This commit is contained in:
the-djmaze
2023-05-08 13:01:16 +02:00
parent 85bb5348c0
commit bf6f342ffd
2 changed files with 9 additions and 8 deletions

View File

@@ -72,14 +72,15 @@ computedPaginatorHelper = (koCurrentPage, koPageCount) => {
const currentPage = koCurrentPage(),
pageCount = koPageCount(),
result = [],
lang = doc.documentElement.lang,
fAdd = (index, push = true, customName = '') => {
const data = {
current: index === currentPage,
name: customName ? customName.toString() : index.toString(),
custom: !!customName,
title: customName ? index.toString() : '',
value: index.toString()
};
const name = index.toLocaleString(lang),
data = {
current: index === currentPage,
name: customName || name,
title: customName ? name : '',
value: index
};
push ? result.push(data) : result.unshift(data);
};

View File

@@ -1,3 +1,3 @@
<nav class="e-paginator g-ui-user-select-none" data-bind="foreach: $data">
<a data-bind="css: { 'current': current, 'custom': custom }, title: title, text: name"></a>
<a data-bind="css: { 'current': current }, title: title, text: name"></a>
</nav>