First translation on the welcome page

This commit is contained in:
Veloman Yunkan
2022-11-25 14:11:19 +04:00
parent bf80367b5a
commit 7307a9a1b7
6 changed files with 16 additions and 5 deletions

View File

@ -28,4 +28,5 @@
, "random-page-button-text": "Go to a randomly selected page"
, "searchbox-tooltip": "Search '{{BOOK_TITLE}}'"
, "confusion-of-tongues": "Two or more books in different languages would participate in search, which may lead to confusing results."
, "welcome-page-overzealous-filter": "No result. Would you like to <a href=\"?lang=\">reset filter</a>?"
}

View File

@ -29,5 +29,5 @@
"library-button-text": "Tooltip of the button leading to the welcome page",
"home-button-text": "Tooltip of the button leading to the main page of a book",
"random-page-button-text": "Tooltip of the button opening a randomly selected page",
"searchbox-tooltip": "Tooltip displayed for the search box"
, "welcome-page-overzealous-filter": "Text shown when book filtering on the welcome page produces zero results"
}

View File

@ -17,4 +17,5 @@
, "home-button-text": "[I18N TESTING] Jump to the main page of '{{BOOK_TITLE}}'"
, "random-page-button-text": "[I18N TESTING] I am tired of determinism"
, "searchbox-tooltip": "[I18N TESTING] Let's search in '{{BOOK_TITLE}}'"
, "welcome-page-overzealous-filter": "[I18N TESTING] Nothing found. <a href=\"?lang=\">Reset filter</a>"
}

View File

@ -298,7 +298,7 @@
const kiwixHomeBody = document.querySelector('.kiwixHomeBody');
const divTag = document.createElement('div');
divTag.setAttribute('class', 'noResults');
divTag.innerHTML = `No result. Would you like to <a href="?lang=">reset filter</a>?`;
divTag.innerHTML = $t("welcome-page-overzealous-filter");
kiwixHomeBody.append(divTag);
kiwixHomeBody.setAttribute('style', 'display: flex; justify-content: center; align-items: center');
loader.setAttribute('style', 'position: absolute; top: 50%');
@ -462,7 +462,7 @@
}
});
window.onload = async () => {
async function onload() {
iso = new Isotope( '.book__list', {
itemSelector: '.book',
getSortData:{
@ -508,6 +508,13 @@
}
updateFeedLink();
setCookie(filterCookieName, params.toString());
};
// required by i18n.js:setUserLanguage()
window.setPermanentGlobalCookie = function(name, value) {
document.cookie = `${name}=${value};path=${root};max-age=31536000`;
}
window.onload = () => { setUserLanguage(getUserLanguage(), onload); }
})();