diff --git a/static/skin/i18n/en.json b/static/skin/i18n/en.json index b8f8abf4b..332c25ab8 100644 --- a/static/skin/i18n/en.json +++ b/static/skin/i18n/en.json @@ -33,4 +33,5 @@ , "search": "Search" , "book-filtering-all-categories": "All categories" , "book-filtering-all-languages": "All languages" + , "count-of-matching-books": "{{COUNT}} book(s)" } diff --git a/static/skin/i18n/qqq.json b/static/skin/i18n/qqq.json index b33b3929b..ebf8bfbc1 100644 --- a/static/skin/i18n/qqq.json +++ b/static/skin/i18n/qqq.json @@ -35,4 +35,5 @@ , "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" + , "count-of-matching-books": "Reporting the count of books matching the filter" } diff --git a/static/skin/i18n/test.json b/static/skin/i18n/test.json index 6e5c42d74..2609b945d 100644 --- a/static/skin/i18n/test.json +++ b/static/skin/i18n/test.json @@ -22,4 +22,5 @@ , "search": "[I18N Search TESTING]" , "book-filtering-all-categories": "All [I18N TESTING] categories" , "book-filtering-all-languages": "All [I18N TESTING] languages" + , "count-of-matching-books": "[I18N TESTING] Number of matching books: {{COUNT}}" } diff --git a/static/skin/index.js b/static/skin/index.js index 1ce0973b4..0f8237f1c 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -262,16 +262,10 @@ } else { toggleFooter(); } - const kiwixResultText = document.querySelector('.kiwixHomeBody__results') - if (results) { - let resultText = `${results} books`; - if (results === 1) { - resultText = `${results} book`; - } - kiwixResultText.innerHTML = resultText; - } else { - kiwixResultText.innerHTML = ``; - } + const text = results + ? $t("count-of-matching-books", {COUNT: results}) + : ''; + document.querySelector('.kiwixHomeBody__results').innerHTML = text; loader.style.display = 'none'; return books; }); diff --git a/test/server.cpp b/test/server.cpp index 4eb7e2056..7f171cdcf 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=73356624" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=e0a31131" }, { 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" }, @@ -283,7 +283,7 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=316dbc21" - + )EXPECTEDRESULT" },