diff options
author | metamuffin <metamuffin@disroot.org> | 2025-03-22 14:27:25 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-03-22 14:27:25 +0100 |
commit | 5d4cb7864dc3ca19669877def6c298eb96d19b16 (patch) | |
tree | 92444bfd31c9080e8c09aa7368e3f6cb4156ed35 /client-web/source/user | |
parent | 2f5d47d21dfc308c1b930cf45e13b34445d3a8e5 (diff) | |
download | keks-meet-5d4cb7864dc3ca19669877def6c298eb96d19b16.tar keks-meet-5d4cb7864dc3ca19669877def6c298eb96d19b16.tar.bz2 keks-meet-5d4cb7864dc3ca19669877def6c298eb96d19b16.tar.zst |
new translation system
Diffstat (limited to 'client-web/source/user')
-rw-r--r-- | client-web/source/user/local.ts | 4 | ||||
-rw-r--r-- | client-web/source/user/mod.ts | 6 | ||||
-rw-r--r-- | client-web/source/user/remote.ts | 20 |
3 files changed, 15 insertions, 15 deletions
diff --git a/client-web/source/user/local.ts b/client-web/source/user/local.ts index 371efff..462edd3 100644 --- a/client-web/source/user/local.ts +++ b/client-web/source/user/local.ts @@ -13,7 +13,7 @@ import { User } from "./mod.ts"; import { create_camera_res, create_mic_res, create_screencast_res } from "../resource/track.ts"; import { LocalResource } from "../resource/mod.ts"; import { PREFS } from "../preferences/mod.ts"; -import { PO } from "../locale/mod.ts"; +import { tr } from "../locale.ts"; export class LocalUser extends User { resources: Map<string, LocalResource> = new Map() @@ -21,7 +21,7 @@ export class LocalUser extends User { constructor(room: Room, id: number) { super(room, id) this.el.classList.add("local") - this.status_el.textContent = PO.local + this.status_el.textContent = tr("res.local") this.name = PREFS.username log("users", `added local user: ${this.display_name}`) this.add_initial_tracks() diff --git a/client-web/source/user/mod.ts b/client-web/source/user/mod.ts index daf3772..90a45b8 100644 --- a/client-web/source/user/mod.ts +++ b/client-web/source/user/mod.ts @@ -6,19 +6,19 @@ /// <reference lib="dom" /> import { e } from "../helper.ts"; -import { PO } from "../locale/mod.ts"; +import { tr } from "../locale.ts"; import { Room } from "../room.ts"; export class User { private _name?: string set name(v: string | undefined) { this._name = v; this.name_el.textContent = this.display_name; this.el.ariaLabel = "user " + this.display_name } get name() { return this._name } - get display_name() { return this.name ?? PO.unknown_user } + get display_name() { return this.name ?? tr("unknown_user") } name_el = e("span", {}, this.display_name) status_el = e("span", { class: ["connection-status", "status-neutral"] }, "") stats_el = e("pre", {}) - el = e("div", { class: "user", role: "group", aria_label: PO.unknown_user, aria_live: "polite" }) + el = e("div", { class: "user", role: "group", aria_label: tr("unknown_user"), aria_live: "polite" }) constructor(public room: Room, public id: number) { const info_el = e("div", { class: "info" }) diff --git a/client-web/source/user/remote.ts b/client-web/source/user/remote.ts index aa5b1b4..b247511 100644 --- a/client-web/source/user/remote.ts +++ b/client-web/source/user/remote.ts @@ -7,7 +7,7 @@ import { RelayMessage } from "../../../common/packets.d.ts"; import { notify } from "../helper.ts"; -import { PO } from "../locale/mod.ts"; +import { tr } from "../locale.ts"; import { log } from "../logger.ts" import { PREFS } from "../preferences/mod.ts"; import { new_remote_resource, RemoteResource } from "../resource/mod.ts"; @@ -79,7 +79,7 @@ export class RemoteUser extends User { this.pc.close() this.room.remote_users.delete(this.id) this.room.element.removeChild(this.el) - if (PREFS.notify_leave) notify(PO.leave_message(this.display_name).join("")) + if (PREFS.notify_leave) notify(tr("chat.leave_message", { name: this.display_name })) this.room.chat.add_control_message({ leave: this }) } on_relay(message: RelayMessage) { @@ -89,7 +89,7 @@ export class RemoteUser extends User { if (message.answer) this.on_answer(message.answer) if (message.identify) { this.name = message.identify.username - if (PREFS.notify_join) notify(PO.join_message(this.display_name).join("")) + if (PREFS.notify_join) notify(tr("chat.join_message", { name: this.display_name })) this.room.chat.add_control_message({ join: this }) } if (message.preview_response) { @@ -187,13 +187,13 @@ export class RemoteUser extends User { async update_status() { const states: { [key in RTCIceConnectionState]: [string, string] } = { - new: [PO.status_no_conn, "neutral"], - checking: [PO.status_checking, "neutral"], - failed: [PO.status_failed, "fail"], - closed: [PO.status_disconnected, "neutral"], - completed: [PO.status_connected, "good"], - connected: [PO.status_connected, "good"], - disconnected: [PO.status_disconnected, "neutral"] + new: [tr("status.no_conn"), "neutral"], + checking: [tr("status.checking"), "neutral"], + failed: [tr("status.failed"), "fail"], + closed: [tr("status.disconnected"), "neutral"], + completed: [tr("status.connected"), "good"], + connected: [tr("status.connected"), "good"], + disconnected: [tr("status.disconnected"), "neutral"] } this.status_el.classList.value = "" this.status_el.classList.add("connection-status", "status-" + states[this.pc.iceConnectionState][1]) |