Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: update i18n for secure token (#7305)

boojack36882c7104ec
diff --git a/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue b/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
index e57b83e0af..59fe9ada25 100644
--- a/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
+++ b/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
@@ -1,10 +1,15 @@
<template>
- <div class="mb-7 mt-5 lg:mt-0">
- <p class="font-medium">{{ "Sign-in frequency" }}</p>
- <p class="text-sm text-gray-400">
- {{ "Sign-in frequency is the period before a user must sign in again." }}
+ <div class="mb-7 mt-5 lg:mt-0" @click="handleValueFieldClick">
+ <p class="font-medium flex flex-row justify-start items-center">
+ <span class="mr-2">{{
+ $t("settings.general.workspace.sign-in-frequency.self")
+ }}</span>
+ <FeatureBadge feature="bb.feature.secure-token" />
</p>
- <div class="mt-4 w-full flex flex-row justify-start items-center">
+ <p class="text-sm text-gray-400 mt-1">
+ {{ $t("settings.general.workspace.sign-in-frequency.description") }}
+ </p>
+ <div class="mt-3 w-full flex flex-row justify-start items-center">
<NInputNumber
v-model:value="state.inputValue"
class="w-20 mr-4"
@@ -14,8 +19,14 @@
:precision="0"
/>
<NRadioGroup v-model:value="state.timeFormat" :disabled="!allowEdit">
- <NRadio :value="'HOURS'" :label="'Hour(s)'" />
- <NRadio :value="'DAYS'" :label="'Day(s)'" />
+ <NRadio
+ :value="'HOURS'"
+ :label="$t('settings.general.workspace.sign-in-frequency.hours')"
+ />
+ <NRadio
+ :value="'DAYS'"
+ :label="$t('settings.general.workspace.sign-in-frequency.days')"
+ />
</NRadioGroup>
</div>
</div>
@@ -67,22 +78,26 @@ const settingV1Store = useSettingV1Store();
const currentUserV1 = useCurrentUserV1();
const state = reactive<LocalState>(getInitialState());
-// TODO(steven): update feature name.
const hasSecureTokenFeature = featureToRef("bb.feature.secure-token");
const allowEdit = computed((): boolean => {
- return hasWorkspacePermissionV1(
- "bb.permission.workspace.manage-general",
- currentUserV1.value.userRole
+ return (
+ hasSecureTokenFeature.value &&
+ hasWorkspacePermissionV1(
+ "bb.permission.workspace.manage-general",
+ currentUserV1.value.userRole
+ )
);
});
-const handleFrequencySettingChange = useDebounceFn(async () => {
+const handleValueFieldClick = () => {
if (!hasSecureTokenFeature.value) {
state.featureNameForModal = "bb.feature.secure-token";
return;
}
+};
+const handleFrequencySettingChange = useDebounceFn(async () => {
const seconds =
state.timeFormat === "HOURS"
? state.inputValue * 60 * 60
@@ -109,6 +124,11 @@ watch(
watch(
() => [state.inputValue, state.timeFormat],
() => {
+ if (!hasSecureTokenFeature.value) {
+ state.featureNameForModal = "bb.feature.secure-token";
+ return;
+ }
+
handleFrequencySettingChange();
}
);
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 4b2793c0e2..a4f649f7c6 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -555,6 +555,12 @@
"self": "GitOps Webhook URL",
"description": "The URL used for sending GitOps webhooks to the Bytebase instance."
},
+ "sign-in-frequency": {
+ "self": "Sign-in frequency",
+ "description": "Sign-in frequency is the period before a user must sign in again.",
+ "hours": "Hour(s)",
+ "days": "Day(s)"
+ },
"config-updated": "Configuration is updated",
"plugin": {
"openai": {
@@ -2127,6 +2133,10 @@
"bb-feature-schema-template": {
"title": "Schema Template",
"desc": "Pre-define the field template, then apply the template during the schema change."
+ },
+ "bb-feature-secure-token": {
+ "title": "Sign-in frequency",
+ "desc": "Sign-in frequency is the period before a user must sign in again."
}
}
},
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index c3cf3df837..97f4f464d7 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -569,6 +569,12 @@
"gitops-webhook-url": {
"self": "URL del webhook GitOps",
"description": "La URL utilizada para enviar webhooks de GitOps a la instancia de Bytebase."
+ },
+ "sign-in-frequency": {
+ "self": "Frecuencia de inicio de sesión",
+ "description": "La frecuencia de inicio de sesión es el período antes de que un usuario deba iniciar sesión nuevamente.",
+ "hours": "Horas",
+ "days": "Días"
}
}
},
@@ -2125,6 +2131,10 @@
"bb-feature-schema-template": {
"title": "Plantilla de esquema",
"desc": "Predefina la plantilla de campo, luego aplique la plantilla durante el cambio de esquema."
+ },
+ "bb-feature-secure-token": {
+ "title": "Frecuencia de inicio de sesión",
+ "desc": "La frecuencia de inicio de sesión es el período antes de que un usuario deba iniciar sesión nuevamente."
}
}
},
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index a0a2b4e66a..86938da561 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -551,6 +551,12 @@
"self": "GitOps Webhook URL",
"description": "用于 GitOps 中第三方服务向 Bytebase 发送 Webhook 的 URL。"
},
+ "sign-in-frequency": {
+ "self": "登录频率",
+ "description": "登录频率指定用户必须再次登录的间隔。",
+ "hours": "小时",
+ "days": "天数"
+ },
"config-updated": "配置已更新",
"plugin": {
"openai": {
@@ -2120,6 +2126,10 @@
"bb-feature-schema-template": {
"title": "Schema 模板",
"desc": "预定义 Schema 模板,之后可以在变更或设计 Schema 时应用这些模板。"
+ },
+ "bb-feature-secure-token": {
+ "title": "登录频率",
+ "desc": "登录频率指定用户必须再次登录的间隔。"
}
},
"feature-require-subscription": "{feature} 需要 {requiredPlan}。"