Revert "Avoid leaking user locale preference to the web"

This reverts commit 66c34ddb6e.
This commit is contained in:
sledgehammer999 2024-06-16 23:14:21 +03:00
parent a126a7b493
commit ec6eac2ba1
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2
2 changed files with 8 additions and 8 deletions

View file

@ -7,7 +7,7 @@
<meta name="description" content="qBittorrent WebUI">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>qBittorrent WebUI</title>
<title>qBittorrent QBT_TR(WebUI)QBT_TR[CONTEXT=OptionsDialog]</title>
<link rel="icon" type="image/png" href="images/qbittorrent32.png" />
<link rel="icon" type="image/svg+xml" href="images/qbittorrent-tray.svg" />
@ -22,25 +22,25 @@
<body>
<noscript id="noscript">
<h1>JavaScript Required! You must enable JavaScript for the WebUI to work properly</h1>
<h1>QBT_TR(JavaScript Required! You must enable JavaScript for the WebUI to work properly)QBT_TR[CONTEXT=HttpServer]</h1>
</noscript>
<div id="main">
<h1>qBittorrent WebUI</h1>
<h1>qBittorrent QBT_TR(WebUI)QBT_TR[CONTEXT=OptionsDialog]</h1>
<div id="logo" class="col">
<img src="images/qbittorrent-tray.svg" alt="qBittorrent logo" />
</div>
<div id="formplace" class="col">
<form id="loginform">
<div class="row">
<label for="username" class="qbt-translatable" data-i18n="Username">Username</label><br />
<label for="username">QBT_TR(Username)QBT_TR[CONTEXT=HttpServer]</label><br />
<input type="text" id="username" name="username" autocomplete="username" autofocus required />
</div>
<div class="row">
<label for="password" class="qbt-translatable" data-i18n="Password">Password</label><br />
<label for="password">QBT_TR(Password)QBT_TR[CONTEXT=HttpServer]</label><br />
<input type="password" id="password" name="password" autocomplete="current-password" required />
</div>
<div class="row">
<input type="submit" id="loginButton" class="qbt-translatable" data-i18n="Login" value="Login" />
<input type="submit" id="loginButton" value="QBT_TR(Login)QBT_TR[CONTEXT=HttpServer]" />
</div>
</form>
</div>

View file

@ -111,13 +111,13 @@ function submitLoginForm(event) {
if ((xhr.status === 200) && (xhr.responseText === "Ok."))
location.replace(location);
else
errorMsgElement.textContent = i18next.t('Invalid Username or Password.');
errorMsgElement.textContent = 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]';
}
});
xhr.addEventListener('error', () => {
errorMsgElement.textContent = (xhr.responseText !== "")
? xhr.responseText
: i18next.t('Unable to log in, server is probably unreachable.');
: 'QBT_TR(Unable to log in, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]';
});
const usernameElement = document.getElementById('username');