I18n: Localize QR scanner error messages

This commit is contained in:
dyzulk
2026-01-12 09:14:03 +07:00
parent 9891d6a06e
commit 1036249082
2 changed files with 19 additions and 6 deletions

View File

@@ -55,24 +55,24 @@ function handleDecodedText(decodedText) {
}
} else {
isUnauthorized = true;
blockReason = "Invalid Hotspot Login URL";
blockReason = getTranslation('qr_err_invalid_url');
}
} else {
// ILLEGAL DOMAIN: Strict blocking
console.warn(`Blocked unauthorized domain: ${hostname}`);
isUnauthorized = true;
blockReason = `Unauthorized Domain: ${hostname}`;
blockReason = getTranslation('qr_err_unauthorized') + `: ${hostname}`;
}
} else {
// NOT A URL: Block plain text / WiFi SSIDs per requirement
isUnauthorized = true;
blockReason = "Invalid Content (Only URL allowed)";
blockReason = getTranslation('qr_err_invalid_content');
console.warn("Blocked non-URL content:", decodedText);
}
} catch (e) {
console.error("Error parsing QR URL:", e);
isUnauthorized = true;
blockReason = "QR Parse Error";
blockReason = getTranslation('qr_err_parse');
}
// Fill inputs (only if authorized)