From 06179dd0ca9530e84f0dea4506a4e50bdeabb474 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Tue, 20 Apr 2021 23:23:17 +0100 Subject: [PATCH] Add NewTOTP translations. --- src/pages/TOTP/NewTOTP.js | 15 ++++++++------- src/translations/en.js | 7 +++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/pages/TOTP/NewTOTP.js b/src/pages/TOTP/NewTOTP.js index 9f93a52..27df540 100644 --- a/src/pages/TOTP/NewTOTP.js +++ b/src/pages/TOTP/NewTOTP.js @@ -4,6 +4,7 @@ import { setTitleElement, setPageContent, setErrorText, changePage } from "../.. import { makeElement } from "../../htmlUtils.js"; import { Margin } from "../../elements/Margin.js"; import { MarginInline } from "../../elements/MarginInline.js"; +import i18next from 'i18next'; export class NewTOTPPage extends Page { constructor() { @@ -24,20 +25,20 @@ export class NewTOTPPage extends Page { attributes: { required: true, type: "text", - placeholder: "TOTP Name", + placeholder: i18next.t("totp_new_name_text"), name: "name" } })), makeElement({ tag: "p", - text: "You need either a key or a URI, URI prefered. Just scan the QR code and copy the UI." + text: i18next.t("totp_new_info") }), Margin(makeElement({ tag: "input", class: ["uk-input", "uk-form-width-medium"], attributes: { type: "text", - placeholder: "URI", + placeholder: i18next.t("totp_new_uri_input"), name: "uri" } })), @@ -46,7 +47,7 @@ export class NewTOTPPage extends Page { class: ["uk-input", "uk-form-width-medium"], attributes: { type: "text", - placeholder: "Key", + placeholder: i18next.t("totp_new_key_input"), name: "key" } })), @@ -58,7 +59,7 @@ export class NewTOTPPage extends Page { MarginInline(makeElement({ tag: "button", class: ["uk-button", "uk-button-primary"], - text: "Add", + text: i18next.t("totp_new_add_btn"), attributes: { type: "submit" } @@ -86,10 +87,10 @@ export class NewTOTPPage extends Page { } get titleSuffix() { - return " (new)"; + return i18next.t("totp_new_suffix"); } get name() { - return "Create New TOTP"; + return i18next.t("totp_new_title"); } } \ No newline at end of file diff --git a/src/translations/en.js b/src/translations/en.js index 76ce256..ceaec78 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -93,6 +93,13 @@ module.exports = { "totp_view_empty": "You seem to have no TOTP codes here, would you like to create one?", "totp_view_loading_box": "Loading..", + // New TOTP Key Page + "totp_new_title": "New TOTP Key", + "totp_new_suffix": " (new)", + "totp_new_name_text": "TOTP Key Name", + "totp_new_info": "You need either a key or a URI, URI prefered but may not work. Just scan the QR code and copy the URL.", + "totp_new_uri_input": "URI", + "totp_new_key_input": "Key", } \ No newline at end of file