Veloman Yunkan
c2bfeb4030
"Go to welcome page" is internationalized
2022-04-13 16:40:20 +02:00
Veloman Yunkan
901664b097
"Go to welcome page" in taskbar isn't translated
...
The (failing) tests now demonstrate that some text in the taskbar is not
translated. Will fix in the next commit.
2022-04-13 16:40:20 +02:00
Veloman Yunkan
6f3db20078
Internationalized "Fulltext search unavailable" page
2022-04-13 16:40:20 +02:00
Veloman Yunkan
fbd23a8329
Fully internationalized 400, 404 & 500 error pages
2022-04-13 16:40:20 +02:00
Veloman Yunkan
d2c864b010
Internationalized raw-entry-not-found message
2022-04-13 16:40:20 +02:00
Veloman Yunkan
779382642b
Internationalized bad raw access datatype message
2022-04-13 16:40:20 +02:00
Veloman Yunkan
ca7e0fb4a0
Internationalized random article failure message
2022-04-13 16:40:20 +02:00
Veloman Yunkan
52d4f73e89
RIP searchSuggestionHTML() & English-only message
2022-04-13 16:40:20 +02:00
Veloman Yunkan
1ace16229d
Internationalized search suggestion message
2022-04-13 16:40:20 +02:00
Veloman Yunkan
cb5ae01fd8
Localized "No such book" 404 message for /random
...
However the title and the heading of the 404 page are not localized yet.
2022-04-13 16:40:20 +02:00
Veloman Yunkan
b2526c7a98
Translation of the url-not-found message
2022-04-13 16:40:20 +02:00
Veloman Yunkan
387f977d6c
Enter ParameterizedMessage
2022-04-13 16:40:20 +02:00
Veloman Yunkan
202ec81d8b
URL-not-found message went into i18n JSON resource
...
Yet, the URL-not-found message is not yet fully internationalized
since its usage is hardcoded to English.
2022-04-13 16:40:20 +02:00
Veloman Yunkan
577b6e29f9
kiwix::i18n::expandParameterizedString()
2022-04-13 16:40:20 +02:00
Veloman Yunkan
e4a0a029ff
User language control via userlang query param
...
This is a draft commit enabling the testing of the support for
kiwix-serve internationalization.
2022-04-13 16:40:20 +02:00
Veloman Yunkan
507e111f34
i18n data is kept in and generated from JSON files
...
Introduced a new resource compiler script kiwix-compile-i18n that
processes i18n string data stored in JSON files and generates sorted C++
tables of string keys and values for all languages.
2022-04-13 16:40:20 +02:00
Veloman Yunkan
d029c2b8d5
Enter I18nStringDB
2022-04-13 16:40:20 +02:00
Veloman Yunkan
c574735f51
makeFulltextSearchSuggestion() works via mustache
2022-04-13 16:40:20 +02:00
Veloman Yunkan
a18dd82d82
Introduced makeFulltextSearchSuggestion() helper
2022-04-13 16:40:20 +02:00
Matthieu Gautier
e22e073d43
Merge pull request #747 from kiwix/version_10.1.1
2022-04-12 11:32:06 +02:00
Matthieu Gautier
6dcf4ee034
New version 10.1.1
2022-04-11 17:13:58 +02:00
Kelson
61ccbc65fb
Merge pull request #743 from kiwix/fix_article_count
...
Correctly detect the number of article for zim version <= 6
2022-04-06 17:28:51 +02:00
Matthieu Gautier
85a9d35488
Correctly detect the number of article for zim version <= 6
2022-04-06 17:21:14 +02:00
Matthieu Gautier
a17258fcc9
Merge pull request #744 from kiwix/fullsearch_text_unavailable_error
2022-04-06 15:14:18 +02:00
Veloman Yunkan
ae1bf39023
Got rid of static/templates/no_search_result.html
...
The "Fulltext search unavailable" error page is now generated using the
static/templates/error.html template. Also added two test cases checking
that error page.
2022-04-06 14:42:29 +02:00
Veloman Yunkan
dbcbdff275
Added an optional CSS link to error.html
2022-04-05 20:49:09 +04:00
Matthieu Gautier
c1823b8ee4
Merge pull request #738 from kiwix/HTTPErrorHtmlResponse
2022-04-04 18:47:12 +02:00
Veloman Yunkan
3f41ce8337
Unit test for HTTP 500 Internal Server Error
...
Currently an internal server error can be triggered by accessing an
entry belonging to a redirect loop. The ZIM file (test/data/poor.zim)
containing such a loop was copied from openzim/zim-tools repository
(test/data/zimfiles/poor.zim).
2022-04-04 18:35:20 +02:00
Veloman Yunkan
2a20e87341
Got rid of Response::build_500()
...
This change is not tested (mostly due to the difficulties of triggering
an internal server error).
2022-04-04 18:35:20 +02:00
Veloman Yunkan
2028bf3a98
Fixed the CI build failure under android_arm*
2022-04-04 18:35:20 +02:00
Veloman Yunkan
545d409150
Reused HTTPErrorHtmlResponse in HTTP400HtmlResponse
2022-04-04 18:35:20 +02:00
Veloman Yunkan
89dc9afc28
Renamed 404.html to error.html
...
404.html no longer contains anything specific to the 404 error and will
henceforth serve (with some enhancements) as a general purpose error
page template.
2022-04-04 18:35:20 +02:00
Veloman Yunkan
647118dd5e
Enter HTTPErrorHtmlResponse
...
In addition to serving as a base class for `HTTP404HtmlResponse`,
`HTTPErrorHtmlResponse` is going to be used for a couple of other error
pages.
2022-04-04 18:35:20 +02:00
Veloman Yunkan
d8a60db739
Preparing for a single error page template
2022-04-04 18:35:20 +02:00
Veloman Yunkan
f4059f3faf
Got rid of withTaskbarInfo()
2022-04-04 18:35:20 +02:00
Veloman Yunkan
800cc5b68a
Got rid of Response::build_404()
2022-04-04 18:35:19 +02:00
Kelson
b1f03385e4
Merge pull request #739 from kiwix/fix_windows_extern
2022-04-03 13:36:21 +02:00
Matthieu Gautier
feb30d08aa
Correctly define the variable `urlNotFoundMsg` and `invalidUrlMsg`.
...
As we must declare the two variables as `extern` in response.h,
we must define it somewhere (and `response.cpp` is a good place).
2022-04-01 11:58:57 +02:00
Matthieu Gautier
95d4dd63ac
Merge pull request #724 from kiwix/search_improvement
2022-03-29 14:42:24 +02:00
Matthieu Gautier
311f783ea9
Always use the search pattern when searching in the server.
...
There is no reason to not use the pattern if there is a geo_query.
If both the pattern and the qeo_query are provided, we must use both.
2022-03-29 14:06:19 +02:00
Matthieu Gautier
f2a1c0f106
Add braces around for loop's body.
2022-03-29 14:05:45 +02:00
Matthieu Gautier
2cc4befb12
Correctly display searchpattern in search result page.
...
The `searchPattern` is already "diples encoded".
So we can simply using it without protecting us from script injection.
Fix #723
2022-03-29 14:05:45 +02:00
Matthieu Gautier
3641dbf14d
Handle book without xapian index.
2022-03-29 14:05:45 +02:00
Matthieu Gautier
1962262f94
Correctly handle invalid book.
...
If user request for a non existent book, we must return a 400 page.
(This is done by throwing a `std::invalid_argument` and let the catch
handle it)
2022-03-29 14:05:45 +02:00
Matthieu Gautier
7407f30790
Better cache usage.
...
It is better to directly try to get the `Search` from the cache instead
of getting the `Searcher` first which could be useless in Search already
exist.
2022-03-29 14:05:45 +02:00
Matthieu Gautier
d740ffe465
Introduce SearchInfo.
...
SearchInfo is a small helper structure to store information about the
queried search. It regroup already existing information (`patternString`,
geo query, ...) in one structure.
It is also used as key in the cache instead of using a generated string.
2022-03-29 14:05:39 +02:00
Matthieu Gautier
e7293346be
Return http 400 error response when needed.
2022-03-28 17:37:41 +02:00
Matthieu Gautier
b1643e422e
Introduce HTTP400HtmlResponse.
...
HTTP400HtmlResponse is build on the same design than HTTP404HtmlResponse.
2022-03-28 17:35:15 +02:00
Kelson
574c1ad690
Merge pull request #736 from kiwix/pin_jinja2_doc
...
Remove pinning of Sphinx<4
2022-03-28 15:50:17 +02:00
Matthieu Gautier
59364a737a
[WIP] Remove pinning of Sphinx<4
...
It seems we add this pinning to fix a dependencies issue.
Let's remove it.
2022-03-28 15:37:05 +02:00