1
0
Fork 0

Add NewTOTP translations.

This commit is contained in:
Kitteh 2021-04-20 23:23:17 +01:00
parent 19a305d867
commit 06179dd0ca
2 changed files with 15 additions and 7 deletions

View file

@ -4,6 +4,7 @@ import { setTitleElement, setPageContent, setErrorText, changePage } from "../..
import { makeElement } from "../../htmlUtils.js"; import { makeElement } from "../../htmlUtils.js";
import { Margin } from "../../elements/Margin.js"; import { Margin } from "../../elements/Margin.js";
import { MarginInline } from "../../elements/MarginInline.js"; import { MarginInline } from "../../elements/MarginInline.js";
import i18next from 'i18next';
export class NewTOTPPage extends Page { export class NewTOTPPage extends Page {
constructor() { constructor() {
@ -24,20 +25,20 @@ export class NewTOTPPage extends Page {
attributes: { attributes: {
required: true, required: true,
type: "text", type: "text",
placeholder: "TOTP Name", placeholder: i18next.t("totp_new_name_text"),
name: "name" name: "name"
} }
})), })),
makeElement({ makeElement({
tag: "p", 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({ Margin(makeElement({
tag: "input", tag: "input",
class: ["uk-input", "uk-form-width-medium"], class: ["uk-input", "uk-form-width-medium"],
attributes: { attributes: {
type: "text", type: "text",
placeholder: "URI", placeholder: i18next.t("totp_new_uri_input"),
name: "uri" name: "uri"
} }
})), })),
@ -46,7 +47,7 @@ export class NewTOTPPage extends Page {
class: ["uk-input", "uk-form-width-medium"], class: ["uk-input", "uk-form-width-medium"],
attributes: { attributes: {
type: "text", type: "text",
placeholder: "Key", placeholder: i18next.t("totp_new_key_input"),
name: "key" name: "key"
} }
})), })),
@ -58,7 +59,7 @@ export class NewTOTPPage extends Page {
MarginInline(makeElement({ MarginInline(makeElement({
tag: "button", tag: "button",
class: ["uk-button", "uk-button-primary"], class: ["uk-button", "uk-button-primary"],
text: "Add", text: i18next.t("totp_new_add_btn"),
attributes: { attributes: {
type: "submit" type: "submit"
} }
@ -86,10 +87,10 @@ export class NewTOTPPage extends Page {
} }
get titleSuffix() { get titleSuffix() {
return " (new)"; return i18next.t("totp_new_suffix");
} }
get name() { get name() {
return "Create New TOTP"; return i18next.t("totp_new_title");
} }
} }

View file

@ -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_empty": "You seem to have no TOTP codes here, would you like to create one?",
"totp_view_loading_box": "Loading..", "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",
} }