Backend translates the search results page

Now the search results page is presented by the backend in the language
controlled by the value of the `userlang` URL query parameter (or, if
the latter is missing, the value of the `Accept-Language:` HTTP header).

Note that the front-end doesn't yet take advantage of this
functionality.
This commit is contained in:
Veloman Yunkan
2024-01-30 17:21:05 +04:00
parent 33a3277400
commit 958067d94d
5 changed files with 56 additions and 16 deletions

View File

@ -72,6 +72,13 @@ class SearchRenderer
this->pageLength = pageLength;
}
/**
* set user language
*/
void setUserLang(const std::string& lang){
this->userlang = lang;
}
/**
* Generate the html page with the resutls of the search.
*
@ -105,6 +112,7 @@ class SearchRenderer
unsigned int pageLength;
unsigned int estimatedResultCount;
unsigned int resultStart;
std::string userlang = "en";
};