From 70f26da106441cbc27bef8ff89cc7cbd8da5395b Mon Sep 17 00:00:00 2001 From: Kitteh Date: Thu, 20 May 2021 14:35:16 +0100 Subject: [PATCH] Add i18n in auth view. --- src/pages/Access/Auth/AuthViewConfig.ts | 42 +++++++++++++++++++------ src/translations/en.js | 12 ++++++- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/pages/Access/Auth/AuthViewConfig.ts b/src/pages/Access/Auth/AuthViewConfig.ts index e961ac6..4501b97 100644 --- a/src/pages/Access/Auth/AuthViewConfig.ts +++ b/src/pages/Access/Auth/AuthViewConfig.ts @@ -47,28 +47,50 @@ export class AuthViewConfigPage extends Page { const authList = objectToMap(await listAuth()) as Map; const authMethod = authList.get(this.state.baseMount); - contentElement.appendChild(HeaderAndContent("Type", authMethod.type)); - contentElement.appendChild(HeaderAndContent("Path", this.state.baseMount)); - contentElement.appendChild(HeaderAndContent("Description", authMethod.description)); - contentElement.appendChild(HeaderAndContent("Accessor", authMethod.accessor)); - contentElement.appendChild(HeaderAndContent("Local", String(authMethod.local).toString())); contentElement.appendChild( - HeaderAndContent("Seal Wrap", String(authMethod.seal_wrap).toString()), + HeaderAndContent(i18next.t("auth_view_config_type"), authMethod.type), + ); + contentElement.appendChild( + HeaderAndContent(i18next.t("auth_view_config_path"), this.state.baseMount), + ); + contentElement.appendChild( + HeaderAndContent(i18next.t("auth_view_config_description"), authMethod.description), + ); + contentElement.appendChild( + HeaderAndContent(i18next.t("auth_view_config_accessor"), authMethod.accessor), + ); + contentElement.appendChild( + HeaderAndContent(i18next.t("auth_view_config_local"), String(authMethod.local).toString()), ); contentElement.appendChild( HeaderAndContent( - "List when unauthenticated?", + i18next.t("auth_view_config_seal_wrap"), + String(authMethod.seal_wrap).toString(), + ), + ); + contentElement.appendChild( + HeaderAndContent( + i18next.t("auth_view_config_list_when_unauth"), String(authMethod.config.listing_visibility).toString(), ), ); contentElement.appendChild( - HeaderAndContent("Default Lease TTL", String(authMethod.config.default_lease_ttl).toString()), + HeaderAndContent( + i18next.t("auth_view_config_default_lease_ttl"), + String(authMethod.config.default_lease_ttl).toString(), + ), ); contentElement.appendChild( - HeaderAndContent("Max Lease TTL", String(authMethod.config.max_lease_ttl).toString()), + HeaderAndContent( + i18next.t("auth_view_config_max_lease_ttl"), + String(authMethod.config.max_lease_ttl).toString(), + ), ); contentElement.appendChild( - HeaderAndContent("Token Type", authMethod.config.token_type as string), + HeaderAndContent( + i18next.t("auth_view_config_token_type"), + authMethod.config.token_type as string, + ), ); } diff --git a/src/translations/en.js b/src/translations/en.js index 862b27c..9df14f7 100644 --- a/src/translations/en.js +++ b/src/translations/en.js @@ -223,9 +223,19 @@ module.exports = { auth_home_view_config: "View Config", auth_home_edit_config: "Edit Config", - // Auth View Conig Page + // Auth View Config Page auth_view_config_title: "Auth View Config", auth_view_config_suffix: " (view config)", + auth_view_config_type: "Type", + auth_view_config_path: "Path", + auth_view_config_description: "Description", + auth_view_config_accessor: "Accessor", + auth_view_config_local: "Local", + auth_view_config_seal_wrap: "Seal Wrap", + auth_view_config_list_when_unauth: "List when unauthenticated?", + auth_view_config_default_lease_ttl: "Default Lease TTL", + auth_view_config_max_lease_ttl: "Max Lease TTL", + auth_view_config_token_type: "Token Type", // userpass Users List userpass_users_list_title: "Users List",