1
0
Fork 0

Add more translations to KeyValueSecret page.

This commit is contained in:
Kitteh 2021-04-20 22:55:07 +01:00
parent 646487610f
commit dc1fa1c815
2 changed files with 13 additions and 6 deletions

View file

@ -48,11 +48,16 @@ export class KeyValueSecretPage extends Page {
let isSecretNestedJson = false;
let caps = await getCapabilities(pageState.currentBaseMount, pageState.currentSecretPath, pageState.currentSecret);
if (caps.includes("delete")) {
let deleteButtonText = "Delete";
let deleteButtonText = i18next.t("kv_secret_delete_btn");
if (pageState.currentMountType == "kv-v2" && pageState.currentSecretVersion == "0") {
deleteButtonText = `Delete All Versions`;
deleteButtonText = i18next.t("kv_secret_delete_all_btn");
} else if (pageState.currentMountType == "kv-v2" && pageState.currentSecretVersion != "0") {
deleteButtonText = `Delete Version ${pageState.currentSecretVersion}`;
deleteButtonText = i18next.t(
"kv_secret_delete_version_btn",
{
"version": pageState.currentSecretVersion
}
);
}
buttonsBlock.appendChild(makeElement({
tag: "button",
@ -69,7 +74,7 @@ export class KeyValueSecretPage extends Page {
id: "editButton",
class: ["uk-button", "uk-margin", "uk-button-primary"],
onclick: _ => { changePage("KEY_VALUE_SECRET_EDIT"); },
text: "Edit"
text: i18next.t("kv_secret_edit_btn")
}));
}
}
@ -79,7 +84,7 @@ export class KeyValueSecretPage extends Page {
id: "versionsButton",
class: ["uk-button", "uk-button-secondary"],
onclick: _ => { changePage("KEY_VALUE_VERSIONS"); },
text: "Versions"
text: i18next.t("kv_secret_versions_btn")
}));
}

View file

@ -63,7 +63,9 @@ module.exports = {
"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": ""
"kv_secret_delete_btn": "Delete",
"kv_secret_delete_all_btn": "Delete All Versions",
"kv_secret_delete_version_btn": "Delete Version {{ version }}"
}