mirror of https://github.com/kiwix/libkiwix.git
Internationalized raw-entry-not-found message
This commit is contained in:
parent
779382642b
commit
d2c864b010
|
@ -467,6 +467,16 @@ ParameterizedMessage invalidRawAccessMsg(const std::string& dt)
|
|||
return ParameterizedMessage("invalid-raw-data-type", { {"DATATYPE", dt} });
|
||||
}
|
||||
|
||||
ParameterizedMessage rawEntryNotFoundMsg(const std::string& dt, const std::string& entry)
|
||||
{
|
||||
return ParameterizedMessage("raw-entry-not-found",
|
||||
{
|
||||
{"DATATYPE", dt},
|
||||
{"ENTRY", entry},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
ParameterizedMessage nonParameterizedMessage(const std::string& msgId)
|
||||
{
|
||||
return ParameterizedMessage(msgId, {});
|
||||
|
@ -967,10 +977,9 @@ std::unique_ptr<Response> InternalServer::handle_raw(const RequestContext& reque
|
|||
if (m_verbose.load()) {
|
||||
printf("Failed to find %s\n", itemPath.c_str());
|
||||
}
|
||||
const std::string error_details = "Cannot find " + kind + " entry " + itemPath;
|
||||
return HTTP404HtmlResponse(*this, request)
|
||||
+ urlNotFoundMsg
|
||||
+ error_details;
|
||||
+ rawEntryNotFoundMsg(kind, itemPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,4 +10,5 @@
|
|||
, "suggest-search" : "Make a full text search for <a href=\"{{{SEARCH_URL}}}\">{{PATTERN}}</a>"
|
||||
, "random-article-failure" : "Oops! Failed to pick a random article :("
|
||||
, "invalid-raw-data-type" : "{{DATATYPE}} is not a valid request for raw content."
|
||||
, "raw-entry-not-found" : "Cannot find {{DATATYPE}} entry {{ENTRY}}"
|
||||
}
|
||||
|
|
|
@ -11,4 +11,5 @@
|
|||
, "suggest-search" : "Suggest a search when the URL points to a non existing article"
|
||||
, "random-article-failure" : "Failure of the random article selection procedure"
|
||||
, "invalid-raw-data-type" : "Invalid DATATYPE was used with the /raw endpoint (/raw/<book>/DATATYPE/...); allowed values are 'meta' and 'content'"
|
||||
, "raw-entry-not-found" : "Entry requested via the /raw endpoint was not found"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue