Add translations on KeyValueView page.
This commit is contained in:
parent
99f2aff7ca
commit
67465967ab
|
@ -6,7 +6,6 @@ import { makeElement } from "../../htmlUtils.js";
|
|||
import { CodeJar } from "codejar";
|
||||
import i18next from 'i18next';
|
||||
|
||||
|
||||
export class KeyValueSecretEditPage extends Page {
|
||||
constructor() {
|
||||
super();
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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?",
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue