diff --git a/src/pages/KeyValue/KeyValueSecretsEdit.js b/src/pages/KeyValue/KeyValueSecretsEdit.js index 0309b27..f7a39da 100644 --- a/src/pages/KeyValue/KeyValueSecretsEdit.js +++ b/src/pages/KeyValue/KeyValueSecretsEdit.js @@ -6,7 +6,6 @@ import { makeElement } from "../../htmlUtils.js"; import { CodeJar } from "codejar"; import i18next from 'i18next'; - export class KeyValueSecretEditPage extends Page { constructor() { super(); diff --git a/src/pages/KeyValue/KeyValueView.js b/src/pages/KeyValue/KeyValueView.js index cb63658..09f2d0a 100644 --- a/src/pages/KeyValue/KeyValueView.js +++ b/src/pages/KeyValue/KeyValueView.js @@ -2,6 +2,7 @@ import { Page } from "../../types/Page.js"; import { DoesNotExistError, getSecrets } from "../../api.js"; import { setErrorText, setTitleElement, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; +import i18next from 'i18next'; export class KeyValueViewPage extends Page { constructor() { @@ -23,13 +24,13 @@ export class KeyValueViewPage extends Page { if (pageState.currentMountType == "cubbyhole") { pageContent.appendChild(makeElement({ tag: "p", - text: "In cubbyhole, secrets can be stored as long as the lease of your token is valid. They will be deleted when lease is expired and can only be viewed by your current token.", + text: i18next.t("kv_view_cubbyhole_text"), })); } let newButton = makeElement({ tag: "button", - text: "New", + text: i18next.t("kv_view_new_btn"), class: ["uk-button", "uk-button-primary", "uk-margin-bottom"], onclick: () => { changePage("KEY_VALUE_NEW_SECRET"); @@ -72,7 +73,7 @@ export class KeyValueViewPage extends Page { } else { pageContent.appendChild(makeElement({ tag: "p", - text: "You seem to have no secrets here, would you like to create one?" + text: i18next.t("kv_view_none_here_text") })); } } else { @@ -82,6 +83,6 @@ export class KeyValueViewPage extends Page { } get name() { - return "K/V View"; + return i18next.t("kv_view_title"); } } diff --git a/src/translations/en.js b/src/translations/en.js index 60aa29b..e84ce3d 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -77,10 +77,15 @@ module.exports = { "kv_sec_edit_suffix": " (edit)", // Key Value Secret Versions Page - "kv_sec_versions_title": "K/V Edit", - "kv_sec_edit_btn": "Edit", - "kv_sec_edit_loading": "Loading Editor..", - "kv_sec_edit_invalid_json_err": "Invalid JSON", + "kv_sec_versions_title": "K/V Versions", "kv_sec_versions_suffix": " (edit)", + // Key Value View/List Secrets Page + "kv_view_title": "K/V View", + "kv_view_cubbyhole_text": "In cubbyhole, secrets can be stored as long as the lease of your token is valid. They will be deleted when lease is expired and can only be viewed by your current token.", + "kv_view_new_btn": "New", + "kv_view_none_here_text": "You seem to have no secrets here, would you like to create one?", + + + } \ No newline at end of file