Add translations to TransitViewSecretPage.
This commit is contained in:
parent
61954536e5
commit
76d58d1850
|
@ -2,6 +2,7 @@ import { Page } from "../../types/Page.js";
|
|||
import { DoesNotExistError, getTransitKeys } from "../../api.js";
|
||||
import { setErrorText, setTitleElement, changePage } from "../../pageUtils.js";
|
||||
import { makeElement } from "../../htmlUtils.js";
|
||||
import i18next from 'i18next';
|
||||
|
||||
export class TransitViewPage extends Page {
|
||||
constructor() {
|
||||
|
@ -51,7 +52,7 @@ export class TransitViewPage extends Page {
|
|||
if (e == DoesNotExistError) {
|
||||
pageContent.appendChild(makeElement({
|
||||
tag: "p",
|
||||
text: "You seem to have no transit keys here, would you like to create one?"
|
||||
text: i18next.t("transit_view_none_here_text")
|
||||
}));
|
||||
} else {
|
||||
setErrorText(e.message);
|
||||
|
@ -60,6 +61,6 @@ export class TransitViewPage extends Page {
|
|||
}
|
||||
|
||||
get name() {
|
||||
return "Transit View";
|
||||
return i18next.t("transit_view_title");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Page } from "../../types/Page.js";
|
||||
import { changePage, setPageContent, setTitleElement } from "../../pageUtils.js";
|
||||
import { makeElement } from "../../htmlUtils.js";
|
||||
import i18next from 'i18next';
|
||||
|
||||
export class TransitViewSecretPage extends Page {
|
||||
constructor() {
|
||||
|
@ -10,7 +11,7 @@ export class TransitViewSecretPage extends Page {
|
|||
changePage("TRANSIT_VIEW");
|
||||
}
|
||||
|
||||
makeTile(title, description, icon = "code", onclick = _ => { }) {
|
||||
makeTile(title, description, icon, iconText, onclick = _ => { }) {
|
||||
return makeElement({
|
||||
tag: "a",
|
||||
class: "uk-link-heading",
|
||||
|
@ -54,15 +55,17 @@ export class TransitViewSecretPage extends Page {
|
|||
tag: "div",
|
||||
children: [
|
||||
this.makeTile(
|
||||
"Encrypt",
|
||||
"Encrypt some plaintext or base64 encoded binary.",
|
||||
i18next.t("transit_view_encrypt_text"),
|
||||
i18next.t("transit_view_encrypt_description"),
|
||||
"lock",
|
||||
i18next.t("transit_view_encrypt_icon_text"),
|
||||
_ => { changePage("TRANSIT_ENCRYPT"); }
|
||||
),
|
||||
this.makeTile(
|
||||
"Decrypt",
|
||||
"Decrypt some cyphertext.",
|
||||
i18next.t("transit_view_decrypt_text"),
|
||||
i18next.t("transit_view_decrypt_description"),
|
||||
"mail",
|
||||
i18next.t("transit_view_decrypt_icon_text"),
|
||||
_ => { changePage("TRANSIT_DECRYPT"); }
|
||||
),
|
||||
]
|
||||
|
@ -72,6 +75,6 @@ export class TransitViewSecretPage extends Page {
|
|||
}
|
||||
|
||||
get name() {
|
||||
return "Transit Secret View";
|
||||
return i18next.t("transit_view_secret_title");
|
||||
}
|
||||
}
|
|
@ -111,5 +111,18 @@ module.exports = {
|
|||
"totp_new_key_input": "Key",
|
||||
"totp_new_add_btn": "Add TOTP Key",
|
||||
|
||||
// Transit View Page
|
||||
"transit_view_title": "Transit View",
|
||||
"transit_view_none_here_text": "You seem to have no transit keys here, would you like to create one?",
|
||||
|
||||
// Transit View Secret Page
|
||||
"transit_view_secret_title": "Transit Secret View",
|
||||
"transit_view_encrypt_text": "Encrypt",
|
||||
"transit_view_encrypt_icon_text": "Encryption Icon",
|
||||
"transit_view_encrypt_description": "Encrypt some plaintext or base64 encoded binary.",
|
||||
"transit_view_decrypt_text": "Decrypt",
|
||||
"transit_view_decrypt_description": "Decrypt some cyphertext.",
|
||||
"transit_view_decrypt_icon_text": "Decryption Icon",
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue