Add language and theme preferences
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user