Skip to content

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

fix: i18n (#16052)

ecmadao33158f249f1f
diff --git a/frontend/src/bbkit/BBAlert.vue b/frontend/src/bbkit/BBAlert.vue
index ad85de77f9..86b090d5f3 100644
--- a/frontend/src/bbkit/BBAlert.vue
+++ b/frontend/src/bbkit/BBAlert.vue
@@ -5,8 +5,8 @@
:type="type"
:title="title"
:content="description"
- :negative-text="negativeText"
- :positive-text="positiveText"
+ :negative-text="cancelText"
+ :positive-text="okText"
@update:show="$emit('update:show', $event)"
@positive-click="() => $emit('ok')"
@negative-click="() => $emit('cancel')"
@@ -17,10 +17,9 @@
<script lang="ts" setup>
import { NModal } from "naive-ui";
-import { computed } from "vue";
-import { useI18n } from "vue-i18n";
+import { t } from "@/plugins/i18n";
-const props = withDefaults(
+withDefaults(
defineProps<{
show: boolean;
type: "info" | "warning";
@@ -32,8 +31,8 @@ const props = withDefaults(
{
type: "info",
description: "",
- okText: "bbkit.common.ok",
- cancelText: "bbkit.common.cancel",
+ okText: () => t("common.ok"),
+ cancelText: () => t("common.cancel"),
payload: undefined,
}
);
@@ -43,18 +42,4 @@ defineEmits<{
(event: "cancel"): void;
(event: "update:show", val: boolean): void;
}>();
-
-const { t, te } = useI18n();
-
-const negativeText = computed(() => {
- const { cancelText } = props;
- if (te(cancelText)) return t(cancelText);
- return cancelText;
-});
-
-const positiveText = computed(() => {
- const { okText } = props;
- if (te(okText)) return t(okText);
- return okText;
-});
</script>
diff --git a/frontend/src/components/v2/Form/StepTab.vue b/frontend/src/components/v2/Form/StepTab.vue
index 401819219a..4ecd53a640 100644
--- a/frontend/src/components/v2/Form/StepTab.vue
+++ b/frontend/src/components/v2/Form/StepTab.vue
@@ -51,7 +51,7 @@
<heroicons-outline:chevron-left
class="-ml-1 mr-1 h-5 w-5 text-control-light"
/>
- <span> {{ $t("bbkit.common.back") }}</span>
+ <span> {{ $t("common.back") }}</span>
</NButton>
<NButton
v-if="currentIndex == stepList.length - 1"
@@ -69,7 +69,7 @@
v-bind="nextButtonProps"
@click.prevent="$emit('update:currentIndex', currentIndex + 1)"
>
- {{ $t("bbkit.common.next") }}
+ {{ $t("common.next") }}
</NButton>
</div>
</div>
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index a49cddfc11..43cc447c79 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -307,10 +307,6 @@
"external-url": "Bytebase has not configured --external-url"
},
"bbkit": {
- "common": {
- "back": "Back",
- "next": "Next"
- },
"confirm-button": {
"sure-to-delete": "Are you sure to delete?",
"sure-to-archive": "Are you sure to archive?",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index db7ee6374e..b303d0d9b6 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -307,10 +307,6 @@
"external-url": "Bytebase no ha configurado --external-url"
},
"bbkit": {
- "common": {
- "back": "Volver",
- "next": "Siguiente"
- },
"confirm-button": {
"sure-to-delete": "¿Estás seguro de que deseas eliminar?",
"sure-to-archive": "¿Estás seguro de archivar?",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 06de3cf335..e0999c7e8e 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -307,10 +307,6 @@
"external-url": "Bytebase は --extern-url を設定していません"
},
"bbkit": {
- "common": {
- "back": "戻る",
- "next": "次のステップ"
- },
"confirm-button": {
"sure-to-delete": "本当に削除してもよろしいですか?",
"sure-to-archive": "本当にアーカイブしますか?",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 9fb8b08a35..fe3b28b4c4 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -307,10 +307,6 @@
"external-url": "Bytebase chưa được cấu hình --external-url"
},
"bbkit": {
- "common": {
- "back": "Quay lại",
- "next": "Tiếp"
- },
"confirm-button": {
"sure-to-delete": "Bạn có chắc chắn muốn xóa?",
"sure-to-archive": "Bạn có chắc chắn muốn lưu trữ?",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 45f08afb78..4f9ed68e3b 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -307,10 +307,6 @@
"external-url": "Bytebase 还没有配置 --external-url"
},
"bbkit": {
- "common": {
- "back": "退回",
- "next": "下一步"
- },
"confirm-button": {
"sure-to-delete": "确定要删除吗?",
"sure-to-archive": "确定要归档吗?",