From 7d677b6b190aa9680f11877faf1ec33f1e24a8ef Mon Sep 17 00:00:00 2001 From: Kitteh Date: Tue, 20 Apr 2021 20:38:30 +0100 Subject: [PATCH] Add translations on KeyValueNew page. --- src/pages/KeyValue/KeyValueNew.js | 9 +++++---- src/translations/en.js | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pages/KeyValue/KeyValueNew.js b/src/pages/KeyValue/KeyValueNew.js index 9b355d7..0d7ca07 100644 --- a/src/pages/KeyValue/KeyValueNew.js +++ b/src/pages/KeyValue/KeyValueNew.js @@ -2,6 +2,7 @@ import { Page } from "../../types/Page.js"; import { createOrUpdateSecret } from "../../api.js"; import { setPageContent, setTitleElement, setErrorText, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; +import i18next from 'i18next'; export class KeyValueNewPage extends Page { constructor() { @@ -25,7 +26,7 @@ export class KeyValueNewPage extends Page { attributes: { required: true, type: "text", - placeholder: "Relative Path", + placeholder: i18next.t("kv_new_path"), name: "path" } }) @@ -38,7 +39,7 @@ export class KeyValueNewPage extends Page { makeElement({ tag: "button", class: ["uk-button", "uk-button-primary"], - text: "Create Empty Secret", + text: i18next.t("kv_new_create_btn"), attributes: { type: "submit", } @@ -77,10 +78,10 @@ export class KeyValueNewPage extends Page { } get titleSuffix() { - return " (new)"; + return i18next.t("kv_new_suffix"); } get name() { - return "K/V New"; + return i18next.t("kv_new_title"); } } \ No newline at end of file diff --git a/src/translations/en.js b/src/translations/en.js index e38c637..814c754 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -45,5 +45,8 @@ module.exports = { "kv_delete_btn": "Delete", "kv_delete_suffix": " (delete)", - + "kv_new_title": "K/V New", + "kv_new_suffix": " (new)", + "kv_new_path": "Relative Path", + "kv_new_create_btn": "Create Empty Secret" } \ No newline at end of file