aboutsummaryrefslogtreecommitdiff
path: root/client-web/source/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client-web/source/index.ts')
-rw-r--r--client-web/source/index.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index 73572cb..1e16d23 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -14,8 +14,8 @@ import { SignalingConnection } from "./protocol/mod.ts";
import { Room } from "./room.ts"
import { control_bar, info_br } from "./menu.ts";
import { Chat } from "./chat.ts"
-import { init_locale } from "./locale/mod.ts";
-import { PO } from "./locale/mod.ts";
+import { init_locale } from "./locale.ts";
+import { tr } from "./locale.ts";
export const VERSION = "1.0.4"
globalThis.addEventListener("DOMContentLoaded", () => main())
@@ -54,7 +54,7 @@ function set_room(state: AppState, secret: string, rtc_config: RTCConfiguration)
state.center.removeChild(state.room.element)
state.room.destroy()
}
- if (secret.length < 8) log({ scope: "crypto", warn: true }, PO.warn_short_secret)
+ if (secret.length < 8) log({ scope: "crypto", warn: true }, tr("warn.short_secret"))
if (secret.split("#").length > 1) document.title = `${secret.split("#")[0]} | keks-meet`
state.room = new Room(state.conn, state.chat, rtc_config)
state.chat.room = state.room
@@ -72,15 +72,15 @@ export async function main() {
const config: ClientConfig = await config_res.json()
log("*", "config loaded. starting")
- init_locale(PREFS.language ?? "en-US")
+ await init_locale()
document.body.querySelectorAll(".loading").forEach(e => e.remove())
- if (!globalThis.isSecureContext) log({ scope: "*", warn: true }, PO.warn_secure_context)
- if (!globalThis.RTCPeerConnection) return log({ scope: "webrtc", error: true }, PO.warn_no_webrtc)
- if (!globalThis.crypto.subtle) return log({ scope: "crypto", error: true }, PO.warn_no_crypto)
- if (!globalThis.navigator.serviceWorker) log({ scope: "*", warn: true }, PO.warn_no_sw)
- if (PREFS.warn_redirect) log({ scope: "crypto", warn: true }, PO.warn_old_url)
+ if (!globalThis.isSecureContext) log({ scope: "*", warn: true }, tr("warn.secure_context"))
+ if (!globalThis.RTCPeerConnection) return log({ scope: "webrtc", error: true }, tr("warn.no_webrtc"))
+ if (!globalThis.crypto.subtle) return log({ scope: "crypto", error: true }, tr("warn.no_crypto"))
+ if (!globalThis.navigator.serviceWorker) log({ scope: "*", warn: true }, tr("warn.no_sw"))
+ if (PREFS.warn_redirect) log({ scope: "crypto", warn: true }, tr("warn.old_url"))
const sud = e("div", { class: "side-ui" })
const state: AppState = {
@@ -112,7 +112,7 @@ export async function main() {
globalThis.onbeforeunload = ev => {
if (state.room && state.room.local_user.resources.size != 0 && PREFS.enable_onbeforeunload) {
ev.preventDefault()
- return PO.confirm_quit
+ return tr("confirm_quit")
}
}