mirror of https://github.com/kiwix/libkiwix.git
Internationalized random article failure message
This commit is contained in:
parent
52d4f73e89
commit
ca7e0fb4a0
|
@ -462,6 +462,11 @@ std::string noSearchResultsMsg()
|
|||
return "The fulltext search engine is not available for this content.";
|
||||
}
|
||||
|
||||
ParameterizedMessage nonParameterizedMessage(const std::string& msgId)
|
||||
{
|
||||
return ParameterizedMessage(msgId, {});
|
||||
}
|
||||
|
||||
} // unnamed namespace
|
||||
|
||||
std::unique_ptr<Response> InternalServer::handle_suggest(const RequestContext& request)
|
||||
|
@ -680,9 +685,8 @@ std::unique_ptr<Response> InternalServer::handle_random(const RequestContext& re
|
|||
auto entry = archive->getRandomEntry();
|
||||
return build_redirect(bookName, getFinalItem(*archive, entry));
|
||||
} catch(zim::EntryNotFound& e) {
|
||||
const std::string error_details = "Oops! Failed to pick a random article :(";
|
||||
return HTTP404HtmlResponse(*this, request)
|
||||
+ error_details
|
||||
+ nonParameterizedMessage("random-article-failure")
|
||||
+ TaskbarInfo(bookName, archive.get());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
, "no-such-book": "No such book: {{BOOK_NAME}}"
|
||||
, "url-not-found" : "The requested URL \"{{url}}\" was not found on this server."
|
||||
, "suggest-search" : "Make a full text search for <a href=\"{{{SEARCH_URL}}}\">{{PATTERN}}</a>"
|
||||
, "random-article-failure" : "Oops! Failed to pick a random article :("
|
||||
}
|
||||
|
|
|
@ -9,4 +9,5 @@
|
|||
, "no-such-book": "Error text when the requested book is not found in the library"
|
||||
, "url-not-found" : "Error text about wrong URL for an HTTP 404 error"
|
||||
, "suggest-search" : "Suggest a search when the URL points to a non existing article"
|
||||
, "random-article-failure" : "Failure of the random article selection procedure"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue