From 53b3124288fe3035c8dd684ff284598b2f87f134 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Thu, 10 Oct 2024 17:31:01 +0800 Subject: [PATCH] feat: improve built-in auth providers' i18n in detail page (#6816) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area ui /kind improvement /milestone 2.20.x #### What this PR does / why we need it: 完善内置的认证提供商详情页面的 i18n,在 https://github.com/halo-dev/halo/pull/6814 中遗漏了详情页面。 image #### Does this PR introduce a user-facing change? ```release-note None ``` --- .../auth-providers/AuthProviderDetail.vue | 33 +++++++++++++++---- .../components/AuthProviderListItem.vue | 4 +-- ui/src/locales/en.yaml | 11 +++---- ui/src/locales/zh-CN.yaml | 11 +++---- ui/src/locales/zh-TW.yaml | 11 +++---- 5 files changed, 44 insertions(+), 26 deletions(-) diff --git a/ui/console-src/modules/system/auth-providers/AuthProviderDetail.vue b/ui/console-src/modules/system/auth-providers/AuthProviderDetail.vue index eab704f8e..e12214d19 100644 --- a/ui/console-src/modules/system/auth-providers/AuthProviderDetail.vue +++ b/ui/console-src/modules/system/auth-providers/AuthProviderDetail.vue @@ -136,15 +136,36 @@ const handleSaveConfigMap = async () => { await handleFetchConfigMap(); saving.value = false; }; + +const displayName = computed(() => { + if (!authProvider.value) { + return t("core.common.status.loading"); + } + + return t( + `core.identity_authentication.fields.display_name.${authProvider.value?.metadata.name}`, + authProvider.value?.spec.displayName || "" + ); +}); + +const description = computed(() => { + if (!authProvider.value) { + return t("core.common.status.loading"); + } + + return t( + `core.identity_authentication.fields.description.${authProvider.value?.metadata.name}`, + authProvider.value?.spec.description || "" + ); +});