1
0
Fork 0

Add key value secret page translations.

This commit is contained in:
Kitteh 2021-04-20 22:49:33 +01:00
parent 7d677b6b19
commit 646487610f
8 changed files with 41 additions and 23 deletions

View file

@ -34,11 +34,11 @@ import {
TransitEncryptPage,
TransitDecryptPage,
KeyValueViewPage,
KeyValueSecretsPage,
KeyValueSecretPage,
KeyValueVersionsPage,
KeyValueNewPage,
KeyValueDeletePage,
KeyValueSecretsEditPage,
KeyValueSecretEditPage,
PwGenPage,
SetLanguagePage,
} from "./pages";
@ -57,11 +57,11 @@ const pages = {
TRANSIT_ENCRYPT: new TransitEncryptPage(),
TRANSIT_DECRYPT: new TransitDecryptPage(),
KEY_VALUE_VIEW: new KeyValueViewPage(),
KEY_VALUE_SECRETS: new KeyValueSecretsPage(),
KEY_VALUE_SECRET: new KeyValueSecretPage(),
KEY_VALUE_VERSIONS: new KeyValueVersionsPage(),
KEY_VALUE_NEW_SECRET: new KeyValueNewPage(),
KEY_VALUE_DELETE: new KeyValueDeletePage(),
KEY_VALUE_SECRETS_EDIT: new KeyValueSecretsEditPage(),
KEY_VALUE_SECRET_EDIT: new KeyValueSecretEditPage(),
PW_GEN: new PwGenPage(),
};

View file

@ -11,7 +11,7 @@ export class KeyValueDeletePage extends Page {
goBack() {
if (pageState.currentSecretVersion != "0") {
pageState.currentSecretVersion = "0";
changePage("KEY_VALUE_SECRETS");
changePage("KEY_VALUE_SECRET");
} else {
pageState.currentSecret = "";
changePage("KEY_VALUE_VIEW");

View file

@ -4,9 +4,10 @@ import { setPageContent, setTitleElement, changePage } from "../../pageUtils.js"
import { CopyableInputBox } from "../../elements/CopyableInputBox.js";
import { makeElement } from "../../htmlUtils.js";
import Prism from "prismjs";
import i18next from 'i18next';
export class KeyValueSecretsPage extends Page {
export class KeyValueSecretPage extends Page {
constructor() {
super();
}
@ -32,7 +33,7 @@ export class KeyValueSecretsPage extends Page {
}),
makeElement({
tag: "p",
text: "Loading..",
text: i18next.t("kv_secret_loading"),
id: "loadingText"
}),
makeElement({
@ -67,7 +68,7 @@ export class KeyValueSecretsPage extends Page {
tag: "button",
id: "editButton",
class: ["uk-button", "uk-margin", "uk-button-primary"],
onclick: _ => { changePage("KEY_VALUE_SECRETS_EDIT"); },
onclick: _ => { changePage("KEY_VALUE_SECRET_EDIT"); },
text: "Edit"
}));
}
@ -94,12 +95,12 @@ export class KeyValueSecretsPage extends Page {
kvList.appendChild(makeElement({
tag: "p",
text: "This secret version has been soft deleted but remains restorable, do you want to restore it?"
text: i18next.t("kv_secret_deleted_text")
}));
kvList.appendChild(makeElement({
tag: "button",
text: "Restore Secret Version",
text: i18next.t("kv_secret_restore_btn"),
id: "restoreButton",
class: ["uk-button", "uk-button-primary"],
onclick: () => {
@ -147,6 +148,6 @@ export class KeyValueSecretsPage extends Page {
}
get name() {
return "K/V Secret";
return i18next.t("kv_secret_title");
}
}

View file

@ -5,12 +5,12 @@ import { setPageContent, setTitleElement, setErrorText, changePage } from "../..
import { makeElement } from "../../htmlUtils.js";
import { CodeJar } from "codejar";
export class KeyValueSecretsEditPage extends Page {
export class KeyValueSecretEditPage extends Page {
constructor() {
super();
}
goBack() {
changePage("KEY_VALUE_SECRETS");
changePage("KEY_VALUE_SECRET");
}
render() {
setTitleElement(pageState);
@ -55,7 +55,7 @@ export class KeyValueSecretsEditPage extends Page {
pageState.currentSecret,
JSON.parse(jar.toString())
).then(_ => {
changePage("KEY_VALUE_SECRETS");
changePage("KEY_VALUE_SECRET");
return;
}).catch(e => {
setErrorText(e.message);

View file

@ -8,7 +8,7 @@ export class KeyValueVersionsPage extends Page {
super();
}
goBack() {
changePage("KEY_VALUE_SECRETS");
changePage("KEY_VALUE_SECRET");
}
async render() {
setTitleElement(pageState);
@ -34,7 +34,7 @@ export class KeyValueVersionsPage extends Page {
text: `v${ver}`,
onclick: _ => {
pageState.currentSecretVersion = ver;
changePage("KEY_VALUE_SECRETS");
changePage("KEY_VALUE_SECRET");
}
})
}));

View file

@ -56,7 +56,7 @@ export class KeyValueViewPage extends Page {
changePage("KEY_VALUE_VIEW");
} else {
pageState.currentSecret = secret;
changePage("KEY_VALUE_SECRETS");
changePage("KEY_VALUE_SECRET");
}
}
})

View file

@ -8,11 +8,11 @@ export { SetLanguagePage } from "./SetLanguage.js";
export { TOTPViewPage } from "./TOTP/TOTPView.js";
export { NewTOTPPage } from "./TOTP/NewTOTP.js";
export { KeyValueViewPage } from "./KeyValue/KeyValueView.js";
export { KeyValueSecretsPage } from "./KeyValue/KeyValueSecrets.js";
export { KeyValueSecretPage } from "./KeyValue/KeyValueSecrets.js";
export { KeyValueVersionsPage } from "./KeyValue/KeyValueVersions.js";
export { KeyValueNewPage } from "./KeyValue/KeyValueNew.js";
export { KeyValueDeletePage } from "./KeyValue/KeyValueDelete.js";
export { KeyValueSecretsEditPage } from "./KeyValue/KeyValueSecretsEdit.js";
export { KeyValueSecretEditPage } from "./KeyValue/KeyValueSecretsEdit.js";
export { TransitViewPage } from "./Transit/TransitView.js";
export { TransitViewSecretPage } from "./Transit/TransitViewSecret.js";
export { TransitEncryptPage } from "./Transit/TransitEncrypt.js";

View file

@ -7,31 +7,37 @@ module.exports = {
"back_btn": "Back",
"refresh_btn": "Refresh",
"me_btn": "Me/Settings",
// These are the page titles
"me_page_title": "Me/Settings",
"home_page_title": "Home",
// These are all o the other translations
// Me Page
"me_page_title": "Me/Settings",
"log_out_btn": "Log Out",
"copy_token_btn": "Copy Token",
"renew_lease_btn": "Renew Token Lease",
"change_language_btn": "Change Language",
// Home Page
"vaulturl_text": "Vault URL: {{text}}",
"password_generator_btn": "Password Generator",
"change_language_btn": "Change Language",
"your_token_expires_in": "Your token expires in {{date, until_date}}",
// Unseal Page
"unseal_vault_text": "Unseal the Vault",
"submit_key_btn": "Submit Key",
"key_input_placeholder": "Key",
"unseal_keys_progress": "Keys: {{progress}}/{{keys_needed}}",
// Language Selector Page
"set_language_title": "Set Language",
"set_language_btn": "Set Language",
// Password Generator Page
"password_generator_title": "Password Generator",
"gen_password_btn": "Generate Password",
// Login Page
"log_in_title": "Login",
"log_in_with_token": "Token",
"log_in_with_username": "Username",
@ -40,13 +46,24 @@ module.exports = {
"password_input": "Password",
"log_in_btn": "Login",
// Key Value Delete Page
"kv_delete_title": "K/V Delete",
"kv_delete_text": "Are you sure you want to delete this?",
"kv_delete_btn": "Delete",
"kv_delete_suffix": " (delete)",
// Key Value New Page
"kv_new_title": "K/V New",
"kv_new_suffix": " (new)",
"kv_new_path": "Relative Path",
"kv_new_create_btn": "Create Empty Secret"
"kv_new_create_btn": "Create Empty Secret",
// Key Value Secret Page
"kv_secret_title": "K/V Secret",
"kv_secret_deleted_text": "This secret version has been soft deleted but remains restorable, do you want to restore it?",
"kv_secret_restore_btn": "Restore Secret Version",
"kv_secret_loading": "Loading Secret..",
"kv_secret_delete_btn": ""
}