From 5d4cb7864dc3ca19669877def6c298eb96d19b16 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 22 Mar 2025 14:27:25 +0100 Subject: new translation system --- client-web/source/room_watches.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'client-web/source/room_watches.ts') diff --git a/client-web/source/room_watches.ts b/client-web/source/room_watches.ts index d738359..66d11fd 100644 --- a/client-web/source/room_watches.ts +++ b/client-web/source/room_watches.ts @@ -5,7 +5,7 @@ */ /// import { array_swap, e } from "./helper.ts"; -import { PO } from "./locale/mod.ts"; +import { tr } from "./locale.ts"; import { PREFS, change_pref } from "./preferences/mod.ts"; import { room_hash } from "./protocol/crypto.ts"; import { SignalingConnection } from "./protocol/mod.ts"; @@ -61,8 +61,8 @@ export function ui_room_watches(conn: SignalingConnection): HTMLElement { e("div", { class: "users" }, ...ucont), )) if (edit) el.append(e("button", { onclick(_) { watches = watches.filter(e => e != w); update_listing() } }, "X")) - if (edit && wi > 0) el.append(e("button", { onclick(_) { array_swap(watches, wi, wi - 1); update_listing() } }, PO.move_up)) - if (edit && wi < watches.length - 1) el.append(e("button", { onclick(_) { array_swap(watches, wi, wi + 1); update_listing() } }, PO.move_down)) + if (edit && wi > 0) el.append(e("button", { onclick(_) { array_swap(watches, wi, wi - 1); update_listing() } }, tr("room_watches.edit.move_up"))) + if (edit && wi < watches.length - 1) el.append(e("button", { onclick(_) { array_swap(watches, wi, wi + 1); update_listing() } }, tr("room_watches.edit.move_down"))) listing.append(el) } @@ -77,14 +77,14 @@ export function ui_room_watches(conn: SignalingConnection): HTMLElement { update_watches() input.value = "" } - }, PO.add), + }, tr("room_watches.edit.add")), e("button", { async onclick() { if (!conn.room) return await add_watch(conn.room) update_watches() } - }, PO.add_current_room) + }, tr("room_watches.edit.add_current_room")) )) } } @@ -98,7 +98,7 @@ export function ui_room_watches(conn: SignalingConnection): HTMLElement { edit = e; } return e("div", { class: "room-watches", role: "dialog", aria_label: "known rooms" }, - e("h2", {}, PO.known_rooms), + e("h2", {}, tr("room_watches")), listing, button_edit = e("button", { icon: "edit", @@ -106,7 +106,7 @@ export function ui_room_watches(conn: SignalingConnection): HTMLElement { set_edit(true) update_listing() } - }, PO.edit), + }, tr("room_watches.edit")), button_finish = e("button", { icon: "check", hidden: true, @@ -116,6 +116,6 @@ export function ui_room_watches(conn: SignalingConnection): HTMLElement { update_watches() update_listing() } - }, PO.finish_edit), + }, tr("room_watches.edit.finish")), ) } -- cgit v1.2.3-70-g09d2