Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(i18n): added i18n support for project module (part 1) (#190)
Luke Zhou8847bb6ef534
diff --git a/frontend/src/components/DatabaseTable.vue b/frontend/src/components/DatabaseTable.vueindex c6fa385c64..326fb42c66 100644--- a/frontend/src/components/DatabaseTable.vue+++ b/frontend/src/components/DatabaseTable.vue@@ -75,7 +75,7 @@</template><script lang="ts">-import { computed, PropType } from "vue";+import { computed, PropType, reactive } from "vue";import { useStore } from "vuex";import { useRouter } from "vue-router";import { consoleLink, databaseSlug } from "../utils";@@ -83,103 +83,10 @@ import { Database } from "../types";import { BBTableColumn } from "../bbkit/types";import InstanceEngineIcon from "./InstanceEngineIcon.vue";import { cloneDeep, isEmpty } from "lodash";+import { useI18n } from "vue-i18n";type Mode = "ALL" | "ALL_SHORT" | "INSTANCE" | "PROJECT" | "PROJECT_SHORT";-const columnListMap: Map<Mode, BBTableColumn[]> = new Map([- [- "ALL",- [- {- title: "Name",- },- {- title: "Project",- },- {- title: "Environment",- },- {- title: "Instance",- },- {- title: "Sync status",- },- {- title: "Last successful sync",- },- ],- ],- [- "ALL_SHORT",- [- {- title: "Name",- },- {- title: "Project",- },- {- title: "Environment",- },- {- title: "Instance",- },- ],- ],- [- "INSTANCE",- [- {- title: "Name",- },- {- title: "Project",- },- {- title: "Sync status",- },- {- title: "Last successful sync",- },- ],- ],- [- "PROJECT",- [- {- title: "Name",- },- {- title: "Environment",- },- {- title: "Instance",- },- {- title: "Sync status",- },- {- title: "Last successful sync",- },- ],- ],- [- "PROJECT_SHORT",- [- {- title: "Name",- },- {- title: "Environment",- },- {- title: "Instance",- },- ],- ],-]);-export default {name: "DatabaseTable",components: { InstanceEngineIcon },@@ -209,6 +116,103 @@ export default {setup(props, { emit }) {const store = useStore();const router = useRouter();+ const { t } = useI18n();++ const columnListMap = computed(() => {+ return new Map([+ [+ "ALL",+ [+ {+ title: t("common.name"),+ },+ {+ title: t("common.project"),+ },+ {+ title: t("common.environment"),+ },+ {+ title: t("common.instance"),+ },+ {+ title: t("db.sync-status"),+ },+ {+ title: t("db.last-successful-sync"),+ },+ ],+ ],+ [+ "ALL_SHORT",+ [+ {+ title: t("common.name"),+ },+ {+ title: t("common.project"),+ },+ {+ title: t("common.environment"),+ },+ {+ title: t("common.instance"),+ },+ ],+ ],+ [+ "INSTANCE",+ [+ {+ title: t("common.name"),+ },+ {+ title: t("common.project"),+ },+ {+ title: t("db.sync-status"),+ },+ {+ title: t("db.last-successful-sync"),+ },+ ],+ ],+ [+ "PROJECT",+ [+ {+ title: t("common.name"),+ },+ {+ title: t("common.environment"),+ },+ {+ title: t("common.instance"),+ },+ {+ title: t("db.sync-status"),+ },+ {+ title: t("db.last-successful-sync"),+ },+ ],+ ],+ [+ "PROJECT_SHORT",+ [+ {+ title: t("common.name"),+ },+ {+ title: t("common.environment"),+ },+ {+ title: t("common.instance"),+ },+ ],+ ],+ ]);+ });// const currentUser = computed(() => store.getters["auth/currentUser"]());@@ -229,7 +233,7 @@ export default {});const columnList = computed(() => {- var list: BBTableColumn[] = columnListMap.get(props.mode)!;+ var list: BBTableColumn[] = columnListMap.value.get(props.mode)!;if (showConsoleLink.value) {// Use cloneDeep, otherwise it will alter the one in columnListMaplist = cloneDeep(list);diff --git a/frontend/src/components/ProjectActivityPanel.vue b/frontend/src/components/ProjectActivityPanel.vueindex b375185c41..4c65664b91 100644--- a/frontend/src/components/ProjectActivityPanel.vue+++ b/frontend/src/components/ProjectActivityPanel.vue@@ -1,7 +1,9 @@<template><div><div class="space-y-2">- <p class="text-lg font-medium leading-7 text-main">Activities</p>+ <p class="text-lg font-medium leading-7 text-main">+ {{ $t("common.activity") }}+ </p><ActivityTable :activity-list="state.activityList" /></div></div>diff --git a/frontend/src/components/ProjectCreate.vue b/frontend/src/components/ProjectCreate.vueindex 387c5bc8b5..ae35418121 100644--- a/frontend/src/components/ProjectCreate.vue+++ b/frontend/src/components/ProjectCreate.vue@@ -3,7 +3,8 @@<div class="grid gap-y-6 gap-x-4 grid-cols-1"><div class="col-span-1"><label for="name" class="text-lg leading-6 font-medium text-control">- Project Name <span class="text-red-600">*</span>+ {{ $t("project.create-modal.project-name")+ }}<span class="text-red-600">*</span></label><BBTextFieldclass="mt-4 w-full"@@ -15,15 +16,15 @@</div><div class="col-span-1"><label for="name" class="text-lg leading-6 font-medium text-control">- Key <span class="text-red-600">*</span>+ {{ $t("project.create-modal.key") }}+ <span class="text-red-600">*</span><span class="text-sm font-normal">- (Uppercase letters identifying your project)</span+ {{ $t("project.create-modal.key-hint") }}</span></label><BBTextFieldclass="mt-4 w-full uppercase":required="true"- :placeholder="'JFK'":value="state.project.key"@input="state.project.key = $event.target.value"/>diff --git a/frontend/src/components/ProjectGeneralSettingPanel.vue b/frontend/src/components/ProjectGeneralSettingPanel.vueindex 6968208a45..6e00342739 100644--- a/frontend/src/components/ProjectGeneralSettingPanel.vue+++ b/frontend/src/components/ProjectGeneralSettingPanel.vue@@ -1,10 +1,12 @@<template><form class="max-w-md space-y-4">- <p class="text-lg font-medium leading-7 text-main">General</p>+ <p class="text-lg font-medium leading-7 text-main">+ {{ $t("common.general") }}+ </p><div class="flex justify-between"><dl class=""><dt class="text-sm font-medium text-control-light">- Name <span class="text-red-600">*</span>+ {{ $t("common.name") }} <span class="text-red-600">*</span></dt><dd class="mt-1 text-sm text-main"><input@@ -21,7 +23,7 @@<dl class=""><dt class="text-sm font-medium text-control-light">- Key <span class="text-red-600">*</span>+ {{ $t("common.key") }} <span class="text-red-600">*</span></dt><dd class="mt-1 text-sm text-main"><input@@ -44,7 +46,7 @@:disabled="!allowSave"@click.prevent="save">- Save+ {{ $t("common.save") }}</button></div></form>diff --git a/frontend/src/components/ProjectMemberPanel.vue b/frontend/src/components/ProjectMemberPanel.vueindex c18403d22d..3d064cf4f1 100644--- a/frontend/src/components/ProjectMemberPanel.vue+++ b/frontend/src/components/ProjectMemberPanel.vue@@ -1,6 +1,8 @@<template><div>- <p class="text-lg font-medium leading-7 text-main">Manage members</p>+ <p class="text-lg font-medium leading-7 text-main">+ {{ $t("project.settings.manage-member") }}+ </p><div v-if="allowAddMember" class="mt-4 w-full flex justify-start"><!-- To prevent jiggling when showing the error text --><div :class="state.error ? 'space-y-1' : 'space-y-6'">@@ -14,7 +16,7 @@id="user"name="user":required="false"- :placeholder="'Select user'"+ :placeholder="$t('project.settings.member-placeholder')":selectedId="state.principalId"@select-principal-id="(principalId) => {@@ -35,7 +37,7 @@class="btn"value="OWNER"/>- <label class="label"> Owner </label>+ <label class="label"> {{ $t("common.role.owner") }} </label></div><div class="radio"><input@@ -46,7 +48,7 @@class="btn"value="DEVELOPER"/>- <label class="label"> Developer </label>+ <label class="label"> {{ $t("common.role.developer") }} </label></div></div><button@@ -56,7 +58,7 @@@click.prevent="addMember"><heroicons-outline:user-add class="mr-2 w-5 h-5" />- Add member+ {{ $t("project.settings.add-member") }}</button></div></div>diff --git a/frontend/src/components/ProjectMemberTable.vue b/frontend/src/components/ProjectMemberTable.vueindex 77aa426465..b6dfc864f4 100644--- a/frontend/src/components/ProjectMemberTable.vue+++ b/frontend/src/components/ProjectMemberTable.vue@@ -43,19 +43,9 @@<div class="flex flex-row items-center space-x-2"><template v-if="'INVITED' == member.principal.status"><span- class="- inline-flex- items-center- px-2- py-0.5- rounded-lg- text-xs- font-semibold- bg-main- text-main-text- "+ class="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-semibold bg-main text-main-text">- Invited+ {{ $t("settings.members.invited") }}</span><span class="textlabel">{{ member.principal.email }}@@ -72,19 +62,9 @@</router-link><spanv-if="currentUser.id == member.principal.id"- class="- inline-flex- items-center- px-2- py-0.5- rounded-lg- text-xs- font-semibold- bg-green-100- text-green-800- "+ class="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-semibold bg-green-100 text-green-800">- You+ {{ $t("common.you") }}</span></div><span class="textlabel">@@ -143,6 +123,7 @@ import {} from "../types";import { BBTableColumn, BBTableSectionDataSource } from "../bbkit/types";import { isOwner, isProjectOwner } from "../utils";+import { useI18n } from "vue-i18n";// eslint-disable-next-line @typescript-eslint/no-empty-interfaceinterface LocalState {}@@ -158,6 +139,7 @@ export default {},setup(props) {const store = useStore();+ const { t } = useI18n();const currentUser = computed(() => store.getters["auth/currentUser"]());@@ -184,19 +166,19 @@ export default {const dataSource: BBTableSectionDataSource<ProjectMember>[] = [];if (hasAdminFeature.value) {dataSource.push({- title: "Owner",+ title: t("common.role.owner"),list: ownerList,});dataSource.push({- title: "Developer",+ title: t("common.role.developer"),list: developerList,});} else {ownerList.push(...developerList);dataSource.push({- title: "Member",+ title: t("common.role.member"),list: ownerList,});}@@ -208,13 +190,13 @@ export default {return hasAdminFeature.value? [{- title: "Account",+ title: t("settings.members.table.account"),},{- title: "Role",+ title: t("settings.members.table.role"),},{- title: "Granted Time",+ title: t("settings.members.table.granted-time"),},{title: "",@@ -222,10 +204,10 @@ export default {]: [{- title: "Account",+ title: t("settings.members.table.account"),},{- title: "Granted Time",+ title: t("settings.members.table.granted-time"),},{title: "",diff --git a/frontend/src/components/ProjectMigrationHistoryPanel.vue b/frontend/src/components/ProjectMigrationHistoryPanel.vueindex da11828c69..819a41a7eb 100644--- a/frontend/src/components/ProjectMigrationHistoryPanel.vue+++ b/frontend/src/components/ProjectMigrationHistoryPanel.vue@@ -2,7 +2,7 @@<div class="flex flex-col space-y-4"><template v-if="state.migrationHistorySectionList.length > 0"><div class="text-center textinfolabel">- {{ $t('migration-history.list-limit') }}+ {{ $t("migration-history.list-limit") }}</div><MigrationHistoryTable:mode="'PROJECT'"@@ -15,10 +15,10 @@<div class="text-center"><heroicons-outline:inbox class="mx-auto w-16 h-16 text-control-light" /><h3 class="mt-2 text-sm font-medium text-main">- {{ $t('migration-history.no-history-in-project') }}+ {{ $t("migration-history.no-history-in-project") }}</h3><p class="mt-1 text-sm text-control-light">- {{ $t('migration-history.recording-info') }}+ {{ $t("migration-history.recording-info") }}</p></div></template>diff --git a/frontend/src/components/ProjectOverviewPanel.vue b/frontend/src/components/ProjectOverviewPanel.vueindex 66d6f54812..c7f6d08d72 100644--- a/frontend/src/components/ProjectOverviewPanel.vue+++ b/frontend/src/components/ProjectOverviewPanel.vue@@ -1,23 +1,27 @@<template><div class="space-y-6"><div class="space-y-2">- <p class="text-lg font-medium leading-7 text-main">Recent activities</p>+ <p class="text-lg font-medium leading-7 text-main">+ {{ $t("project.overview.recent-activity") }}+ </p><ActivityTable :activity-list="state.activityList" /><router-link:to="`#activity`"class="mt-2 flex justify-end normal-link"exact-active-class="">- View all+ {{ $t("project.overview.view-all") }}</router-link></div><div class="space-y-2">- <p class="text-lg font-medium leading-7 text-main">Databases</p>+ <p class="text-lg font-medium leading-7 text-main">+ {{ $t("common.database") }}+ </p><BBAttentionv-if="project.id == DEFAULT_PROJECT_ID":style="`INFO`"- :title="'Bytebase periodically syncs the instance schema. Newly synced databases are first placed in this default project. User should transfer them to the proper application project.'"+ :title="$t('project.overview.info-slot-content')"/><DatabaseTablev-if="databaseList.length > 0"@@ -25,23 +29,34 @@:database-list="databaseList"/><div v-else class="text-center textinfolabel">- No database belongs to this project. You can add database by clicking- <span class="text-main">New DB</span> or- <span class="text-main">Transfer in DB</span> from the top action bar.+ <i18n-t keypath="project.overview.no-db-prompt" tag="p">+ <template #newDb>+ <span class="text-main">{{+ $t("quick-action.new-db")+ }}</span></template+ >+ <template #transferInDb>+ <span class="text-main">{{+ $t("quick-action.transfer-in-db")+ }}</span></template+ >+ </i18n-t></div></div><div class="space-y-2">- <p class="text-lg font-medium leading-7 text-main">Issues</p>+ <p class="text-lg font-medium leading-7 text-main">+ {{ $t("common.issue") }}+ </p><IssueTable:mode="'PROJECT'":issue-section-list="[{- title: 'In progress',+ title: $t('project.overview.in-progress'),list: state.progressIssueList,},{- title: 'Recently Closed',+ title: $t('project.overview.recently-closed'),list: state.closedIssueList,},]"@@ -50,7 +65,7 @@:to="`/issue?status=closed&project=${project.id}`"class="mt-2 flex justify-end normal-link">- View all closed+ {{ $t("project.overview.view-all-closed") }}</router-link></div></div>diff --git a/frontend/src/components/ProjectRoleSelect.vue b/frontend/src/components/ProjectRoleSelect.vueindex 4acaba1579..b34a884f79 100644--- a/frontend/src/components/ProjectRoleSelect.vue+++ b/frontend/src/components/ProjectRoleSelect.vue@@ -1,8 +1,8 @@<template><BBSelect:selected-item="selectedRole"- :item-list="['OWNER', 'DEVELOPER']"- :placeholder="'Select role'"+ :item-list="[$t('project.settings.owner'), 'DEVELOPER']"+ :placeholder="$t('settings.members.select-role')":disabled="disabled"@select-item="(role) => $emit('change-role', role)">diff --git a/frontend/src/components/ProjectSettingPanel.vue b/frontend/src/components/ProjectSettingPanel.vueindex 394381b5e2..6d033a1804 100644--- a/frontend/src/components/ProjectSettingPanel.vue+++ b/frontend/src/components/ProjectSettingPanel.vue@@ -8,7 +8,7 @@<template v-if="project.rowStatus == 'NORMAL'"><BBButtonConfirm:style="'ARCHIVE'"- :button-text="'Archive this project'"+ :button-text="$t('project.settings.archive.btn-text')":ok-text="'Archive'":confirm-title="`Archive project '${project.name}'?`":confirm-description="'Archived project will not be shown on the normal interface. You can still restore later from the Archive page.'"@@ -19,7 +19,7 @@<template v-else-if="project.rowStatus == 'ARCHIVED'"><BBButtonConfirm:style="'RESTORE'"- :button-text="'Restore this project'"+ :button-text="$t('project.settings.restore.btn-text')":ok-text="'Restore'":confirm-title="`Restore project '${project.name}' to normal state?`":confirm-description="''"diff --git a/frontend/src/components/ProjectTable.vue b/frontend/src/components/ProjectTable.vueindex 2568222f4d..9bb1c9c65d 100644--- a/frontend/src/components/ProjectTable.vue+++ b/frontend/src/components/ProjectTable.vue@@ -40,18 +40,7 @@ import { PropType } from "vue";import { useRouter } from "vue-router";import { projectSlug } from "../utils";import { Project } from "../types";--const COLUMN_LIST = [- {- title: "Key",- },- {- title: "Name",- },- {- title: "Created",- },-];+import { useI18n } from "vue-i18n";export default {name: "ProjectTable",@@ -62,8 +51,21 @@ export default {type: Object as PropType<Project[]>,},},+setup(props) {const router = useRouter();+ const { t } = useI18n();+ const COLUMN_LIST = [+ {+ title: t("project.table.key"),+ },+ {+ title: t("project.table.name"),+ },+ {+ title: t("project.table.created-at"),+ },+ ];const clickProject = function (section: number, row: number) {const project = props.projectList[row];diff --git a/frontend/src/components/ProjectWebhookCard.vue b/frontend/src/components/ProjectWebhookCard.vueindex ba86552f10..3cc37d4e93 100644--- a/frontend/src/components/ProjectWebhookCard.vue+++ b/frontend/src/components/ProjectWebhookCard.vue@@ -37,7 +37,7 @@class="btn-normal py-2 px-4"@click.prevent="viewProjectWebhook">- View+ {{ $t("common.view") }}</button></div><div class="border-t border-block-border">@@ -50,7 +50,7 @@</div><div class="grid grid-cols-5 gap-4 px-4 py-2 items-center"><dt class="text-sm font-medium text-control-light">- Triggering activities+ {{ $t("project.webhook.triggering-activity") }}</dt><dd class="py-0.5 flex text-sm text-main col-span-4">{{ activityListStr }}@@ -58,7 +58,7 @@</div><div class="grid grid-cols-5 gap-4 px-4 py-2 items-center"><dt class="text-sm font-medium text-control-light">- Last updated by+ {{ $t("project.webhook.last-updated-by") }}</dt><dd class="py-0.5 flex items-center text-sm text-main col-span-4"><div class="flex flex-row items-center space-x-2 mr-1">diff --git a/frontend/src/components/ProjectWebhookForm.vue b/frontend/src/components/ProjectWebhookForm.vueindex ec9b20b050..7d73160d35 100644--- a/frontend/src/components/ProjectWebhookForm.vue+++ b/frontend/src/components/ProjectWebhookForm.vue@@ -1,22 +1,16 @@<template><div class="space-y-4"><div v-if="create">- <label class="textlabel"> Destination </label>+ <label class="textlabel">+ {{ $t("project.webhook.destination") }}+ </label><div class="mt-1 grid grid-cols-1 gap-4 sm:grid-cols-6"><templatev-for="(item, index) in PROJECT_HOOK_TYPE_ITEM_LIST":key="index"><div- class="- flex- justify-center- px-2- py-4- border border-control-border- hover:bg-control-bg-hover- cursor-pointer- "+ class="flex justify-center px-2 py-4 border border-control-border hover:bg-control-bg-hover cursor-pointer"@click.capture="state.webhook.type = item.type"><div class="flex flex-col items-center">@@ -57,7 +51,7 @@</div><div><label for="name" class="textlabel">- Name <span class="text-red-600">*</span>+ {{ $t("common.name") }} <span class="text-red-600">*</span></label><inputid="name"@@ -71,67 +65,109 @@</div><div><label for="url" class="textlabel">- Webhook URL <span class="text-red-600">*</span>+ {{ $t("project.webhook.webhook-url") }}+ <span class="text-red-600">*</span></label><div class="mt-1 textinfolabel"><template v-if="state.webhook.type == 'bb.plugin.webhook.slack'">- Create the corresponding webhook for the Slack channel receiving the- message.+ {{+ $t("project.webhook.creation.desc", {+ destination: $t("common.slack"),+ })+ }}<ahref="https://api.slack.com/messaging/webhooks"target="__blank"class="normal-link"- >View Slack's doc</a+ >{{+ $t("project.webhook.creation.view-doc", {+ destination: $t("common.slack"),+ })+ }}</a>.</template><template v-else-if="state.webhook.type == 'bb.plugin.webhook.discord'">- Create the corresponding webhook for the Discord channel receiving the- message.+ {{+ $t("project.webhook.creation.desc", {+ destination: $t("common.discord"),+ })+ }}<ahref="https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks"target="__blank"class="normal-link"- >View Discord's doc</a+ >{{+ $t("project.webhook.creation.view-doc", {+ destination: $t("common.discord"),+ })+ }}</a>.</template><template v-else-if="state.webhook.type == 'bb.plugin.webhook.teams'">- Create the corresponding webhook for the Teams channel receiving the- message.+ {{+ $t("project.webhook.creation.desc", {+ destination: $t("common.teams"),+ })+ }}<ahref="https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook"target="__blank"class="normal-link"- >View Teams's doc</a+ >{{+ $t("project.webhook.creation.view-doc", {+ destination: $t("common.teams"),+ })+ }}</a>.</template><templatev-else-if="state.webhook.type == 'bb.plugin.webhook.dingtalk'">- Create the corresponding webhook for the DingTalk group receiving the- message. If you want to use keyword list to protect the webhook, you- can add "Bytebase" to that list.+ {{+ $t("project.webhook.creation.desc", {+ destination: $t("common.dingtalk"),+ }) ++ ". " ++ $t("project.webhook.creation.how-to-protect")+ }}<ahref="https://developers.dingtalk.com/document/robots/custom-robot-access"target="__blank"class="normal-link"- >View DingTalk's doc</a+ >{{+ $t("project.webhook.creation.view-doc", {+ destination: $t("common.dingtalk"),+ })+ }}</a>.</template><template v-else-if="state.webhook.type == 'bb.plugin.webhook.feishu'">- Create the corresponding webhook for the Feishu group receiving the- message. If you want to use keyword list to protect the webhook, you- can add "Bytebase" to that list.+ {{+ $t("project.webhook.creation.desc", {+ destination: $t("common.feishu"),+ }) ++ ". " ++ $t("project.webhook.creation.how-to-protect")+ }}+<ahref="https://www.feishu.cn/hc/zh-CN/articles/360024984973"target="__blank"class="normal-link"- >View Feishu's doc</a+ >{{+ $t("project.webhook.creation.view-doc", {+ destination: $t("common.feishu"),+ })+ }}</a>.</template><!-- WeCom doesn't seem to provide official webhook setup guide for the enduser --><template v-else-if="state.webhook.type == 'bb.plugin.webhook.wecom'">- Create the corresponding webhook for the WeCom group receiving the- message.+ {{+ $t("project.webhook.creation.desc", {+ destination: $t("common.wecom"),+ })+ }}</template></div><input@@ -146,7 +182,7 @@</div><div><div class="text-md leading-6 font-medium text-main">- Triggering activities+ {{ $t("project.webhook.triggering-activity") }}</div><divv-for="(item, index) in PROJECT_HOOK_ACTIVITY_ITEM_LIST"@@ -172,7 +208,7 @@<BBButtonConfirmv-if="!create && allowEdit":style="'DELETE'"- :button-text="'Delete this webhook'"+ :button-text="$t('project.webhook.deletion.btn-text')":ok-text="'Delete'":confirm-title="`Delete webhook '${webhook.name}' and all its execution history?`":require-confirm="true"@@ -180,7 +216,7 @@/><div><button type="button" class="btn-normal" @click.prevent="cancel">- {{ allowEdit ? "Cancel" : "Back" }}+ {{ allowEdit ? $t("common.cancel") : $t("common.back") }}</button><template v-if="allowEdit"><button@@ -190,7 +226,7 @@:disabled="!allowCreate"@click.prevent="createWebhook">- Create+ {{ $t("common.create") }}</button><buttonv-else@@ -199,7 +235,7 @@:disabled="!valueChanged"@click.prevent="updateWebhook">- Update+ {{ $t("common.update") }}</button></template></div>@@ -222,6 +258,7 @@ import { cloneDeep, isEmpty, isEqual } from "lodash";import { useRouter } from "vue-router";import { projectWebhookSlug, projectSlug } from "../utils";import { useStore } from "vuex";+import { useI18n } from "vue-i18n";interface LocalState {webhook: ProjectWebhook | ProjectWebhookCreate;@@ -251,6 +288,7 @@ export default {setup(props) {const store = useStore();const router = useRouter();+ const { t } = useI18n();const state = reactive<LocalState>({webhook: cloneDeep(props.webhook),@@ -265,17 +303,17 @@ export default {const namePlaceholder = computed(() => {if (state.webhook.type == "bb.plugin.webhook.slack") {- return "Slack Webhook";+ return `${t("common.slack")} Webhook`;} else if (state.webhook.type == "bb.plugin.webhook.discord") {- return "Discord Webhook";+ return `${t("common.discord")} Webhook`;} else if (state.webhook.type == "bb.plugin.webhook.teams") {- return "Teams Webhook";+ return `${t("common.teams")} Webhook`;} else if (state.webhook.type == "bb.plugin.webhook.dingtalk") {- return "DingTalk Webhook";+ return `${t("common.dingtalk")} Webhook`;} else if (state.webhook.type == "bb.plugin.webhook.feishu") {- return "Feishu Webhook";+ return `${t("common.feishu")} Webhook`;} else if (state.webhook.type == "bb.plugin.webhook.wecom") {- return "WeCom Webhook";+ return `${t("common.wecom")} Webhook`;}return "My Webhook";diff --git a/frontend/src/components/ProjectWebhookPanel.vue b/frontend/src/components/ProjectWebhookPanel.vueindex e3f8ae94a5..f5160b708a 100644--- a/frontend/src/components/ProjectWebhookPanel.vue+++ b/frontend/src/components/ProjectWebhookPanel.vue@@ -6,7 +6,7 @@class="btn-primary ml-3 inline-flex justify-center py-2 px-4"@click.prevent="addProjectWebhook">- Add a webhook+ {{ $t("project.webhook.create-webhook") }}</button></div><div class="pt-4">@@ -24,11 +24,10 @@class="mx-auto w-16 h-16 text-control-light"/><h3 class="mt-2 text-sm font-medium text-main">- No webhook configured for this project.+ {{ $t("project.webhook.no-webhook.title") }}</h3><p class="mt-1 text-sm text-control-light">- Configure webhooks to let Bytebase post notification to the external- systems on various events.+ {{ $t("project.webhook.no-webhook.content") }}</p></div></template>diff --git a/frontend/src/layouts/ProjectLayout.vue b/frontend/src/layouts/ProjectLayout.vueindex ebdcda0335..8d36df9aa0 100644--- a/frontend/src/layouts/ProjectLayout.vue+++ b/frontend/src/layouts/ProjectLayout.vue@@ -34,6 +34,7 @@ import { useRouter } from "vue-router";import { idFromSlug, isProjectOwner } from "../utils";import ArchiveBanner from "../components/ArchiveBanner.vue";import { BBTabFilterItem } from "../bbkit/types";+import { useI18n } from "vue-i18n";const OVERVIEW_TAB = 0;const WEBHOOK_TAB = 4;@@ -43,15 +44,6 @@ type ProjectTabItem = {hash: string;};-const projectTabItemList: ProjectTabItem[] = [- { name: "Overview", hash: "overview" },- { name: "Migration History", hash: "migration-history" },- { name: "Activities", hash: "activity" },- { name: "Version Control", hash: "version-control" },- { name: "Webhooks", hash: "webhook" },- { name: "Settings", hash: "setting" },-];-interface LocalState {selectedIndex: number;}@@ -73,9 +65,21 @@ export default {setup(props) {const store = useStore();const router = useRouter();+ const { t } = useI18n();const currentUser = computed(() => store.getters["auth/currentUser"]());+ const projectTabItemList = computed((): ProjectTabItem[] => {+ return [+ { name: t("common.overview"), hash: "overview" },+ { name: t("common.migration-history"), hash: "migration-history" },+ { name: t("common.activities"), hash: "activity" },+ { name: t("common.version-control"), hash: "version-control" },+ { name: t("common.webhooks"), hash: "webhook" },+ { name: t("common.settings"), hash: "setting" },+ ];+ });+const state = reactive<LocalState>({selectedIndex: OVERVIEW_TAB,});@@ -106,7 +110,7 @@ export default {});const tabItemList = computed((): BBTabFilterItem[] => {- return projectTabItemList.map((item) => {+ return projectTabItemList.value.map((item) => {return {title: item.name,alert: false,@@ -117,9 +121,9 @@ export default {const selectProjectTabOnHash = () => {if (router.currentRoute.value.name == "workspace.project.detail") {if (router.currentRoute.value.hash) {- for (let i = 0; i < projectTabItemList.length; i++) {+ for (let i = 0; i < projectTabItemList.value.length; i++) {if (- projectTabItemList[i].hash ==+ projectTabItemList.value[i].hash ==router.currentRoute.value.hash.slice(1)) {selectTab(i);@@ -152,7 +156,7 @@ export default {state.selectedIndex = index;router.replace({name: "workspace.project.detail",- hash: "#" + projectTabItemList[index].hash,+ hash: "#" + projectTabItemList.value[index].hash,});};diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.ymlindex b1ae8aa3b8..cf7531170c 100644--- a/frontend/src/locales/en.yml+++ b/frontend/src/locales/en.yml@@ -1,8 +1,23 @@common:+ view: view+ you: you+ general: General+ slack: Slack+ discord: Discord+ teams: Teams+ dingtalk: DingTalk+ feishu: Feishu+ wecom: WeCom+ overview: Overview+ migration-history: Migration History+ webhooks: Webhooks+ key: Key+ workflow: Workflowunread: Unreadread: Readinbox: Inboxactivity: Activity+ activities: Activitiessign-in: Sign insign-up: Sign upemail: Email@@ -11,7 +26,7 @@ common:activate: Activatesave: Savecancel: Cancel- comment: 评论+ comment: Commenthome: Homesettings: Settingsproject: Project@@ -196,6 +211,7 @@ settings:account: Accountrole: Roleupdate-time: Updated Time+ granted-time: Granted Timeaction:deactivate: Deactivatedeactivate-confirm-title: Are you sure to deactivate@@ -331,6 +347,8 @@ db:select: Select databaseselect-instance-first: Select instance firstselect-environment-first: Select environment first+ last-successful-sync: Last successful sync+ sync-status: Sync statusinstance:select: Select instanceenvironment:@@ -526,6 +544,92 @@ anomaly:view-diff: View difflast-seen: Last seenfirst-seen: First seen+project:+ dashboard:+ modal:+ title: How to setup \'@:{'common.project'}\' ?+ content: >-+ Bytebase project is similar to the project concept in other common dev tools.+++ A project has its own members, and every issue and database always belongs to a single project.+++ A project can also be configured to link to a repository to enable version control workflow.+ cancel: Dismiss+ confirm: Do not show again+ search-bar-placeholder: Search project name+ table:+ key: "@:common.key"+ name: "@:common.name"+ created-at: Created At+ create-modal:+ project-name: "@:common.project @:common.name"+ key: "@:common.key"+ key-hint: (Uppercase letters identifying your project)+ cancel: "@:common.cancel"+ confirm: "@:common.create"+ overview:+ view-all: View all+ view-all-closed: View all closed+ recent-activity: "Recent @.lower:{'common.activities'}"+ in-progress: In progress+ recently-closed: Recently Closed+ info-slot-content: >-+ Bytebase periodically syncs the instance schema.+ Newly synced databases are first placed in this default project.+ User should transfer them to the proper application project.+ no-db-prompt: >-+ No database belongs to this project.+ You can add database by clicking {newDb} or {transferInDb} from the top action bar.+ webhook:+ create-webhook: Add a webhook+ last-updated-by: Last updated bu+ destination: Destination+ webhook-url: Webhook url+ triggering-activity: Triggering activities+ test-webhook: Test Webhook+ no-webhook:+ title: No webhook configured for this project.+ content: >-+ Configure webhooks to let Bytebase post notification to the external+ systems on various events.+ creation:+ title: Create webhook+ desc: >-+ Create the corresponding webhook for the {destination} channel receiving the message.+ how-to-protect: >-+ If you want to use keyword list to protect the webhook, you can add+ "Bytebase" to that list.+ view-doc: View {destination}'s doc+ deletion:+ btn-text: Delete this webhook+ activity-item:+ issue-creation:+ title: Issue creation+ label: When new issue has been created+ issue-status-change:+ title: Issue status change+ label: When issue status has changed+ issue-task-status-change:+ title: Issue task status change+ label: When issue's enclosing task status has changed+ issue-info-change:+ title: Issue info change+ label: When issue info (e.g. assignee, title, description) has changed+ issue-comment-creation:+ title: Issue comment creation+ label: When new issue comment has been created+ settings:+ member-placeholder: Select user+ manage-member: Manage members+ add-member: Add member+ owner: "@.upper:common.role.owner"+ developer: "@.upper:common.role.developer"+ archive:+ btn-text: Archive this @.lower:{'common.project'}+ restore:+ btn-text: Restore this @.lower:{'common.project'}inbox:mark-all-as-read: Mark all as readview-older: View olderdiff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.ymlindex d9dfd66927..44823bcd9b 100644--- a/frontend/src/locales/zh-CN.yml+++ b/frontend/src/locales/zh-CN.yml@@ -1,4 +1,20 @@common:+ view: 查看+ you: 您+ general: 通用+ slack: Slack+ discord: Discord+ teams: Teams+ dingtalk: 钉钉+ feishu: 飞书+ wecom: 企业微信+ overview: 概览+ migration-history: 迁移历史+ webhooks: Webhook+ key: 键值+ workflow: 工作流+ activity: 活动+ activities: 活动unread: 未读read: 已读inbox: 通知@@ -8,7 +24,6 @@ common:username: 用户名password: 密码activate: 激活- activity: 活动save: 保存cancel: 取消comment: 评论@@ -192,6 +207,7 @@ settings:account: 账户role: 角色update-time: 更新时间+ granted-time: 批准时间action:deactivate: 禁用deactivate-confirm-title: 确定禁用@@ -316,6 +332,8 @@ db:select: 选择数据库select-instance-first: 先选择实例select-environment-first: 先选择环境+ last-successful-sync: 上次成功同步于+ sync-status: 同步状态instance:select: 选择实例environment:@@ -470,6 +488,91 @@ anomaly:view-diff: 查看差异last-seen: 上次出现first-seen: 首次出现+ contact-dba: 请联系您的 DBA 进行配置。+project:+ dashboard:+ modal:+ title: 如何创建您的'@:{'common.project'}' ?+ content: >-+ 在 Bytebase 中,项目的概念与其他常见的的开发工具类似+++ 一个项目会有属于他的协作成员,并且每一个数据库和工单总是归属于某一个项目+++ 同时,一个项目可以关联一个代码仓库,并以此来进行版本控制+ cancel: 关闭+ confirm: 不再出现+ search-bar-placeholder: 搜索项目名称+ table:+ key: "@:common.key"+ name: "@:common.name"+ created-at: 创建于+ create-modal:+ project-name: "@:common.project @:common.name"+ key: "@:common.key"+ key-hint: ( 请使用大写字母来命名您的项目 )+ cancel: "@:common.cancel"+ confirm: "@:common.create"+ overview:+ view-all: 查看所有+ view-all-closed: 查看所有结束的工单+ recent-activity: "近期@.lower:{'common.activities'}"+ in-progress: 进行中+ recently-closed: 近期结束+ info-slot-content: >-+ Bytebase periodically syncs the instance schema.+ Newly synced databases are first placed in this default project.+ User should transfer them to the proper application project.+ no-db-prompt: >-+ 没有数据库属于当前项目+ 您可以通过点击位于上方菜单栏中的 {newDb} 或者 {transferInDb} 来添加数据库.+ webhook:+ create-webhook: 添加 webhook+ last-updated-by: 最后修改人+ destination: 外部应用+ webhook-url: Webhook url+ triggering-activity: 触发事件+ test-webhook: 测试 Webhook+ no-webhook:+ title: 当前项目暂未配置 webhook+ content: >-+ 配置 webhook 来让 Bytebase 在完成任务后向您的外部系统推送通知+ creation:+ title: 创建 webhook+ desc: >-+ 为 {destination} 创建一个 webhook+ how-to-protect: >-+ 您可以通过添加 'Bytebase' 到您的 webhook 关键字白名单中来保护您的 webhook+ view-doc: '{destination} 的官方文档'+ deletion:+ btn-text: Delete this webhook+ activity-item:+ issue-creation:+ title: Issue creation+ label: When new issue has been created+ issue-status-change:+ title: Issue status change+ label: When issue status has changed+ issue-task-status-change:+ title: Issue task status change+ label: When issue's enclosing task status has changed+ issue-info-change:+ title: Issue info change+ label: When issue info (e.g. assignee, title, description) has changed+ issue-comment-creation:+ title: Issue comment creation+ label: When new issue comment has been created+ settings:+ member-placeholder: 选择用户+ manage-member: 管理成员+ add-member: 添加成员+ owner: "@.upper:commo project.setting.add-membern.role.owner"+ developer: "@.upper:common.role.developer"+ archive:+ btn-text: 收藏这个@:common.project+ restore:+ btn-text: 取消收藏这个@:common.projectinbox:mark-all-as-read: 全部标记为已读view-older: 查看更早diff --git a/frontend/src/views/ProjectDashboard.vue b/frontend/src/views/ProjectDashboard.vueindex 27c8a32543..3506090797 100644--- a/frontend/src/views/ProjectDashboard.vue+++ b/frontend/src/views/ProjectDashboard.vue@@ -3,7 +3,7 @@<div class="px-2 py-2 flex justify-end items-center"><BBTableSearchref="searchField"- :placeholder="'Search project name'"+ :placeholder="$t('project.dashboard.search-bar-placeholder')"@change-text="(text) => changeSearchText(text)"/></div>@@ -13,10 +13,10 @@<BBAlertv-if="state.showGuide":style="'INFO'"- :ok-text="'Do not show again'"- :cancel-text="'Dismiss'"- :title="'How to setup \'Project\' ?'"- :description="'Bytebase project is similar to the project concept in other common dev tools.\n\nA project has its own members, and every issue and database always belongs to a single project.\n\nA project can also be configured to link to a repository to enable version control workflow.'"+ :ok-text="$t('project.dashboard.modal.confirm')"+ :cancel-text="$t('project.dashboard.modal.cancel')"+ :title="$t('project.dashboard.modal.title')"+ :description="$t('project.dashboard.modal.content')"@ok="() => {doDismissGuide();diff --git a/frontend/src/views/ProjectWebhookCreate.vue b/frontend/src/views/ProjectWebhookCreate.vueindex 57abdcb4d3..4380cd0d50 100644--- a/frontend/src/views/ProjectWebhookCreate.vue+++ b/frontend/src/views/ProjectWebhookCreate.vue@@ -1,6 +1,8 @@<template><div class="space-y-4 divide-y divide-block-border">- <div class="text-xl leading-6 font-medium text-main">Create webhook</div>+ <div class="text-xl leading-6 font-medium text-main">+ {{ $t("project.webhook.creation.title") }}+ </div><ProjectWebhookFormclass="pt-4":create="true"diff --git a/frontend/src/views/ProjectWebhookDetail.vue b/frontend/src/views/ProjectWebhookDetail.vueindex f6ad44292a..c3ac75fda3 100644--- a/frontend/src/views/ProjectWebhookDetail.vue+++ b/frontend/src/views/ProjectWebhookDetail.vue@@ -35,7 +35,7 @@class="btn-normal whitespace-nowrap items-center"@click.prevent="testWebhook">- Test Webhook+ {{ $t("project.webhook.test-webhook") }}</button></div><ProjectWebhookFormdiff --git a/frontend/src/views/TableDetail.vue b/frontend/src/views/TableDetail.vueindex c4b45dfd24..00cebde684 100644--- a/frontend/src/views/TableDetail.vue+++ b/frontend/src/views/TableDetail.vue@@ -3,12 +3,7 @@<main class="flex-1 relative pb-8 overflow-y-auto"><!-- Highlight Panel --><div- class="- px-4- pb-4- border-b border-block-border- md:flex md:items-center md:justify-between- "+ class="px-4 pb-4 border-b border-block-border md:flex md:items-center md:justify-between"><div class="flex-1 min-w-0"><!-- Summary -->@@ -16,15 +11,7 @@<div><div class="flex items-center"><h1- class="- pt-2- pb-2.5- text-xl- font-bold- leading-6- text-main- truncate- "+ class="pt-2 pb-2.5 text-xl font-bold leading-6 text-main truncate">{{ table.name }}</h1>@@ -32,11 +19,7 @@</div></div><dl- class="- flex flex-col- space-y-1- md:space-y-0 md:flex-row md:flex-wrap- "+ class="flex flex-col space-y-1 md:space-y-0 md:flex-row md:flex-wrap"><dt class="sr-only">Environment</dt><dd class="flex items-center text-sm md:mr-4">