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