User language control via userlang query param

This is a draft commit enabling the testing of the support for
kiwix-serve internationalization.
This commit is contained in:
Veloman Yunkan
2022-01-17 00:28:24 +04:00
committed by Matthieu Gautier
parent 507e111f34
commit e4a0a029ff
7 changed files with 33 additions and 4 deletions

View File

@ -12,9 +12,10 @@ jq(document).ready(() => {
? (new URLSearchParams(window.location.search)).get('content')
: window.location.pathname.split(`${root}/`)[1].split('/')[0];
const userlang = (new URLSearchParams(window.location.search)).get('userlang') || "en";
$( "#kiwixsearchbox" ).autocomplete({
source: `${root}/suggest?content=${bookName}`,
source: `${root}/suggest?content=${bookName}&userlang=${userlang}`,
dataType: "json",
cache: false,