mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Detecting language from querystring
This commit is contained in:
parent
f6dbae1cef
commit
13a3a581d8
2 changed files with 18 additions and 3 deletions
|
@ -64,8 +64,10 @@
|
|||
</select>
|
||||
<script>
|
||||
$(function () {
|
||||
$(".cmblang").val('de-DE');
|
||||
changeLanguage('de-DE');
|
||||
if (urlParams.lang) {
|
||||
$(".cmblang").val(urlParams.lang);
|
||||
changeLanguage(urlParams.lang);
|
||||
}
|
||||
|
||||
$('select').prettyDropdown({
|
||||
classic: false,
|
||||
|
@ -113,7 +115,8 @@
|
|||
qrcode: VueQr
|
||||
},
|
||||
data: {
|
||||
srvModel: srvModel
|
||||
srvModel: srvModel,
|
||||
expiringSoon: false
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
12
BTCPayServer/wwwroot/js/checkout/querystring.js
Normal file
12
BTCPayServer/wwwroot/js/checkout/querystring.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
var urlParams;
|
||||
(window.onpopstate = function () {
|
||||
var match,
|
||||
pl = /\+/g, // Regex for replacing addition symbol with a space
|
||||
search = /([^&=]+)=?([^&]*)/g,
|
||||
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
|
||||
query = window.location.search.substring(1);
|
||||
|
||||
urlParams = {};
|
||||
while (match = search.exec(query))
|
||||
urlParams[decode(match[1])] = decode(match[2]);
|
||||
})();
|
Loading…
Add table
Reference in a new issue