From dc1fa1c8155f92ae6ece8ece347b7cc0c7e6e613 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Tue, 20 Apr 2021 22:55:07 +0100 Subject: [PATCH] Add more translations to KeyValueSecret page. --- src/pages/KeyValue/KeyValueSecret.js | 15 ++++++++++----- src/translations/en.js | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/pages/KeyValue/KeyValueSecret.js b/src/pages/KeyValue/KeyValueSecret.js index d8a88c7..7afab96 100644 --- a/src/pages/KeyValue/KeyValueSecret.js +++ b/src/pages/KeyValue/KeyValueSecret.js @@ -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") })); } diff --git a/src/translations/en.js b/src/translations/en.js index ea2b564..fc93c77 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -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 }}" } \ No newline at end of file