mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
feat: add language selection to system settings
Add a language selector to the System Settings page supporting English, Japanese, and Chinese. The i18n dictionary already contained zh translations but lacked the UI to switch languages. Changes: - html/i18n.js: add sys_language key to en/ja/zh - html/system.html: add language selector dropdown - html/system.js: add changeLang() and selector initialization - tools/httpd_sim.c: fix cookie parsing for multi-cookie headers; fix Set-Cookie response (missing Path=/, missing \r\n\r\n); add SO_REUSEADDR for faster port reuse
This commit is contained in:
@@ -2,6 +2,11 @@ var systemInterval = Number();
|
||||
var isSaving = false;
|
||||
const ips = ["ip", "netmask", "gw"];
|
||||
|
||||
function changeLang() {
|
||||
var lang = document.getElementById('lang-select').value;
|
||||
setLang(lang);
|
||||
}
|
||||
|
||||
function checkIp(ip) {
|
||||
const ipv4 = /^(\d{1,3}\.){3}\d{1,3}$/;
|
||||
if (!ipv4.test(ip)) {alert(t('sys_invalid_ip') + ip); return false };
|
||||
@@ -146,5 +151,7 @@ function resetSwitch() {
|
||||
}
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
var langSel = document.getElementById('lang-select');
|
||||
if (langSel) langSel.value = rtlLang;
|
||||
systemInterval = setInterval(fetchIP, 1000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user