Add translations on KeyValueDelete and rename titlePrefix to titleSuffix.
This commit is contained in:
parent
cc61c26264
commit
93fcb693b5
|
@ -48,7 +48,7 @@ export function setPageTitle(title) {
|
||||||
|
|
||||||
function currentTitleSecretText() {
|
function currentTitleSecretText() {
|
||||||
let currentSecretText = pageState.currentSecret;
|
let currentSecretText = pageState.currentSecret;
|
||||||
currentSecretText += pageState.currentPage.titlePrefix;
|
currentSecretText += pageState.currentPage.titleSuffix;
|
||||||
|
|
||||||
if (pageState.currentSecretVersion != "0") currentSecretText += ` (v${pageState.currentSecretVersion})`;
|
if (pageState.currentSecretVersion != "0") currentSecretText += ` (v${pageState.currentSecretVersion})`;
|
||||||
return currentSecretText;
|
return currentSecretText;
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { Page } from "../../types/Page.js";
|
||||||
import { deleteSecret } from "../../api.js";
|
import { deleteSecret } from "../../api.js";
|
||||||
import { setPageContent, setTitleElement, changePage } from "../../pageUtils.js";
|
import { setPageContent, setTitleElement, changePage } from "../../pageUtils.js";
|
||||||
import { makeElement } from "../../htmlUtils.js";
|
import { makeElement } from "../../htmlUtils.js";
|
||||||
|
import i18next from 'i18next';
|
||||||
|
|
||||||
export class KeyValueDeletePage extends Page {
|
export class KeyValueDeletePage extends Page {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -23,12 +24,12 @@ export class KeyValueDeletePage extends Page {
|
||||||
children: [
|
children: [
|
||||||
makeElement({
|
makeElement({
|
||||||
tag: "h5",
|
tag: "h5",
|
||||||
text: "Are you sure you want to delete this?"
|
text: i18next.t("kv_delete_text")
|
||||||
}),
|
}),
|
||||||
makeElement({
|
makeElement({
|
||||||
tag: "button",
|
tag: "button",
|
||||||
class: ["uk-button", "uk-button-danger"],
|
class: ["uk-button", "uk-button-danger"],
|
||||||
text: "Delete",
|
text: i18next.t("kv_delete_btn"),
|
||||||
onclick: _ => {
|
onclick: _ => {
|
||||||
deleteSecret(pageState.currentBaseMount, pageState.currentSecretPath, pageState.currentSecret, pageState.currentSecretVersion).then(() => {
|
deleteSecret(pageState.currentBaseMount, pageState.currentSecretPath, pageState.currentSecret, pageState.currentSecretVersion).then(() => {
|
||||||
this.goBack();
|
this.goBack();
|
||||||
|
@ -38,10 +39,10 @@ export class KeyValueDeletePage extends Page {
|
||||||
]
|
]
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
get titlePrefix() {
|
get titleSuffix() {
|
||||||
return " (delete)";
|
return i18next.t("kv_delete_suffix");
|
||||||
}
|
}
|
||||||
get name() {
|
get name() {
|
||||||
return "K/V Delete";
|
return i18next.t("kv_delete_title");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -76,7 +76,7 @@ export class KeyValueNewPage extends Page {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get titlePrefix() {
|
get titleSuffix() {
|
||||||
return " (new)";
|
return " (new)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ export class KeyValueSecretsEditPage extends Page {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get titlePrefix() {
|
get titleSuffix() {
|
||||||
return " (edit)";
|
return " (edit)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ export class KeyValueVersionsPage extends Page {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get titlePrefix() {
|
get titleSuffix() {
|
||||||
return " (versions)";
|
return " (versions)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ export class NewTOTPPage extends Page {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get titlePrefix() {
|
get titleSuffix() {
|
||||||
return " (new)";
|
return " (new)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ export class TransitDecryptPage extends Page {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get titlePrefix() {
|
get titleSuffix() {
|
||||||
return " (decrypt)";
|
return " (decrypt)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ export class TransitEncryptPage extends Page {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get titlePrefix() {
|
get titleSuffix() {
|
||||||
return " (encrypt)";
|
return " (encrypt)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,12 @@ module.exports = {
|
||||||
"token_input": "Token",
|
"token_input": "Token",
|
||||||
"username_input": "Username",
|
"username_input": "Username",
|
||||||
"password_input": "Password",
|
"password_input": "Password",
|
||||||
"log_in_btn": "Login"
|
"log_in_btn": "Login",
|
||||||
|
|
||||||
|
"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)",
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@ export class Page {
|
||||||
get name() {
|
get name() {
|
||||||
return "Page";
|
return "Page";
|
||||||
}
|
}
|
||||||
get titlePrefix() {
|
get titleSuffix() {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
goBack() {
|
goBack() {
|
||||||
|
|
Loading…
Reference in a new issue