diff --git a/static/skin/i18n/en.json b/static/skin/i18n/en.json index e2ce7a463..b8f8abf4b 100644 --- a/static/skin/i18n/en.json +++ b/static/skin/i18n/en.json @@ -29,4 +29,8 @@ , "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 reset filter?" + , "powered-by-kiwix-html": "Powered by Kiwix" + , "search": "Search" + , "book-filtering-all-categories": "All categories" + , "book-filtering-all-languages": "All languages" } diff --git a/static/skin/i18n/qqq.json b/static/skin/i18n/qqq.json index 6a1c17236..b33b3929b 100644 --- a/static/skin/i18n/qqq.json +++ b/static/skin/i18n/qqq.json @@ -29,5 +29,10 @@ "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 in the viewer" , "welcome-page-overzealous-filter": "Text shown when book filtering on the welcome page produces zero results" + , "powered-by-kiwix-html": "Link to Kiwix website" + , "search": "A general search action (text displayed on search buttons or as aplaceholder in searchboxes)" + , "book-filtering-all-categories": "Choosing this filter will disable filtering of books by category" + , "book-filtering-all-languages": "Choosing this filter will disable filtering of books by language" } diff --git a/static/skin/i18n/test.json b/static/skin/i18n/test.json index bf8bd49f0..6e5c42d74 100644 --- a/static/skin/i18n/test.json +++ b/static/skin/i18n/test.json @@ -18,4 +18,8 @@ , "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. Reset filter" + , "powered-by-kiwix-html": "[I18N TESTING] Powered by Kiwix (nominal power: 1.23 kW)" + , "search": "[I18N Search TESTING]" + , "book-filtering-all-categories": "All [I18N TESTING] categories" + , "book-filtering-all-languages": "All [I18N TESTING] languages" } diff --git a/static/skin/index.js b/static/skin/index.js index 9c7fe5613..1ce0973b4 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -462,6 +462,15 @@ } }); + function updateUIText() { + footer.innerHTML = $t("powered-by-kiwix-html"); + const searchText = $t("search"); + document.getElementById('searchFilter').placeholder = searchText; + document.getElementById('searchButton').value = searchText; + document.getElementById('categoryFilter').children[0].innerHTML = $t("book-filtering-all-categories"); + document.getElementById('languageFilter').children[0].innerHTML = $t("book-filtering-all-languages"); + } + async function onload() { iso = new Isotope( '.book__list', { itemSelector: '.book', @@ -478,6 +487,7 @@ } }); footer = document.getElementById('kiwixfooter'); + updateUIText(); fadeOutDiv = document.getElementById('fadeOut'); loader = document.querySelector('.loader'); await loadAndDisplayOptions('#languageFilter', `${root}/catalog/v2/languages`, 'language'); diff --git a/static/templates/index.html b/static/templates/index.html index f2a80342e..2b2039a19 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -62,7 +62,7 @@