From a0fdaabb1f4da1f968d8762c303a5d1f6afefb21 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 8 Sep 2024 22:04:22 +0300 Subject: [PATCH] client: Translate protected switch --- src/public/app/widgets/protected_note_switch.js | 9 +++++---- src/public/translations/en/translation.json | 6 ++++++ src/public/translations/ro/translation.json | 6 ++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/public/app/widgets/protected_note_switch.js b/src/public/app/widgets/protected_note_switch.js index e06bf973d..c7cd5c41a 100644 --- a/src/public/app/widgets/protected_note_switch.js +++ b/src/public/app/widgets/protected_note_switch.js @@ -1,3 +1,4 @@ +import { t } from "../services/i18n.js"; import protectedSessionService from "../services/protected_session.js"; import SwitchWidget from "./switch.js"; @@ -5,11 +6,11 @@ export default class ProtectedNoteSwitchWidget extends SwitchWidget { doRender() { super.doRender(); - this.$switchOnName.text("Protect the note"); - this.$switchOnButton.attr("title", "Note is not protected, click to make it protected"); + this.$switchOnName.text(t("protect_note.toggle-on")); + this.$switchOnButton.attr("title", t("protect_note.toggle-on-hint")); - this.$switchOffName.text("Unprotect the note"); - this.$switchOffButton.attr("title", "Note is protected, click to make it unprotected"); + this.$switchOffName.text(t("protect_note.toggle-off")); + this.$switchOffButton.attr("title", t("protect_note.toggle-off-hint")); } switchOn() { diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 73bcc112d..48a0fd5cc 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1299,5 +1299,11 @@ "launcher": "Launcher", "doc": "Doc", "widget": "Widget" + }, + "protect_note": { + "toggle-on": "Protect the note", + "toggle-off": "Unprotect the note", + "toggle-on-hint": "Note is not protected, click to make it protected", + "toggle-off-hint": "Note is protected, click to make it unprotected" } } diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index a4c174456..6cf3863af 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -1299,5 +1299,11 @@ "image": "Imagine", "launcher": "Scurtătură", "widget": "Widget" + }, + "protect_note": { + "toggle-off": "Deprotejează notița", + "toggle-off-hint": "Notița este protejată, click pentru a o deproteja", + "toggle-on": "Protejează notița", + "toggle-on-hint": "Notița nu este protejată, clic pentru a o proteja" } }