Add language and theme preferences

This commit is contained in:
seo
2026-06-07 17:54:20 +09:00
parent 4a02f7f354
commit 7af96612ab
5 changed files with 434 additions and 112 deletions
+6 -2
View File
@@ -7,6 +7,10 @@
let wakeLock = null;
let wanted = false;
function tr(key, fallback) {
return typeof window.controlT === 'function' ? window.controlT(key) : fallback;
}
function supported() {
return 'wakeLock' in navigator;
}
@@ -20,7 +24,7 @@
button.disabled = !supported();
button.classList.toggle('wake-active', isActive);
button.textContent = 'WakeLock';
button.title = supported() ? '화면 꺼짐 방지' : '현재 브라우저에서 WakeLock을 지원하지 않습니다.';
button.title = supported() ? tr('wakeLockTitle', 'Prevent screen sleep') : tr('wakeLockUnsupported', 'WakeLock is not supported by this browser.');
}
async function requestWakeLock() {
@@ -57,7 +61,7 @@
wakeLock = null;
const alertFn = window.customAlert || (() => Promise.resolve());
alertFn(error.message || 'WakeLock failed', {
title: 'WakeLock 오류',
title: tr('wakeLockErrorTitle', 'WakeLock Error'),
danger: true,
});
render();