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 @@
- +
diff --git a/test/server.cpp b/test/server.cpp index c0d3fa7a9..4eb7e2056 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -63,7 +63,7 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=316dbc21" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=ffc9a141" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=73356624" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js" }, @@ -78,6 +78,9 @@ const ResourceCollection resources200Compressible{ { STATIC_CONTENT, "/ROOT%23%3F/skin/fonts/Poppins.ttf?cacheid=af705837" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/fonts/Roboto.ttf" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/fonts/Roboto.ttf?cacheid=84d10248" }, + { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n/test.json" }, + // TODO: implement cache management of i18n resources + //{ STATIC_CONTENT, "/ROOT%23%3F/skin/i18n/test.json?cacheid=unknown" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/catalog/search" }, @@ -141,9 +144,6 @@ const ResourceCollection resources200Uncompressible{ { STATIC_CONTENT, "/ROOT%23%3F/skin/search-icon.svg?cacheid=b10ae7ed" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/search_results.css" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/search_results.css?cacheid=76d39c84" }, - { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n/test.json" }, - // TODO: implement cache management of i18n resources - //{ STATIC_CONTENT, "/ROOT%23%3F/skin/i18n/test.json?cacheid=unknown" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/languages.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/languages.js?cacheid=fe100348" }, @@ -283,7 +283,7 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=316dbc21" - + )EXPECTEDRESULT" },