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): database & instance part1 (#193)
p0nyd933bfb57628
diff --git a/frontend/src/components/DatabaseBackupCreateForm.vue b/frontend/src/components/DatabaseBackupCreateForm.vueindex b56d2d88e0..d47db1e74f 100644--- a/frontend/src/components/DatabaseBackupCreateForm.vue+++ b/frontend/src/components/DatabaseBackupCreateForm.vue@@ -7,7 +7,7 @@<div class="grid grid-cols-3 gap-y-6 gap-x-4"><div class="col-span-3"><label for="name" class="textlabel">- Backup name <span class="text-red-600">*</span>+ {{ $t("database.backup-name") }} <span class="text-red-600">*</span></label><inputid="name"@@ -27,14 +27,14 @@class="btn-normal py-2 px-4"@click.prevent="$emit('cancel')">- Cancel+ {{ $t("common.cancel") }}</button><buttontype="submit"class="btn-primary ml-3 inline-flex justify-center py-2 px-4":disabled="!allowCreate">- Create backup+ {{ $t("database.create-backup") }}</button></div></form>diff --git a/frontend/src/components/DatabaseBackupPanel.vue b/frontend/src/components/DatabaseBackupPanel.vueindex 845d73e896..4a35585fa4 100644--- a/frontend/src/components/DatabaseBackupPanel.vue+++ b/frontend/src/components/DatabaseBackupPanel.vue@@ -6,7 +6,7 @@<divclass="flex items-center text-lg leading-6 font-medium text-main">- Automatic weekly backup+ {{ $t("database.automatic-weekly-backup") }}<span class="ml-1 text-success">enabled</span></div><button@@ -15,52 +15,69 @@class="ml-4 btn-normal"@click.prevent="toggleAutoBackup(false)">- Disable automatic backup+ {{ $t("database.disable-automatic-backup") }}</button><router-linkv-elseclass="normal-link text-sm":to="`/environment/${database.instance.environment.id}`">- {{ `${backupPolicy} backup enforced and can't be disabled` }}+ {{+ $t("database.backuppolicy-backup-enforced-and-cant-be-disabled", [+ $t(`database.backup-policy.${backupPolicy}`),+ ])+ }}</router-link></div><div class="mt-2 text-control">- Backup will be taken on every- <span class="text-accent">{{ autoBackupWeekdayText }}</span> at- <span class="text-accent"> {{ autoBackupHourText }}</span>+ <i18n-t keypath="database.backup-info.template">+ <template #dayOrWeek>+ <span class="text-accent">{{ autoBackupWeekdayText }}</span>+ </template>+ <template #time>+ <span class="text-accent"> {{ autoBackupHourText }}</span>+ </template>+ </i18n-t></div><div class="mt-2">- <label for="hookUrl" class="textlabel">- Webhook URL- </label>+ <label for="hookUrl" class="textlabel"> Webhook URL </label><div class="mt-1 textinfolabel">- An HTTP POST request will be sent to it after a successful backup.+ {{+ $t(+ "database.an-http-post-request-will-be-sent-to-it-after-a-successful-backup"+ )+ }}<a- href="https://docs.bytebase.com/use-bytebase/webhook-integration/database-webhook"- class="normal-link inline-flex flex-row items-center"+ href="https://docs.bytebase.com/use-bytebase/webhook-integration/database-webhook"+ class="normal-link inline-flex flex-row items-center">- Learn more.+ {{ $t("common.learn-more") }}<heroicons-outline:external-link class="w-4 h-4" /></a></div><inputid="hookUrl"+ v-model="state.autoBackupUpdatedHookUrl"name="hookUrl"type="text"class="textfield mt-1 w-full"placeholder="https://betteruptime.com/api/v1/heartbeat/...":disabled="!allowEdit"- v-model="state.autoBackupUpdatedHookUrl"/>- <button class="btn-primary mt-2" :disabled="!allowEdit || !UrlChanged" @click.prevent="updateBackupHookUrl()">Update</button>+ <button+ class="btn-primary mt-2"+ :disabled="!allowEdit || !UrlChanged"+ @click.prevent="updateBackupHookUrl()"+ >+ {{ $t("common.update") }}+ </button></div></div><divv-elseclass="flex items-center text-lg leading-6 font-medium text-main">- Automatic weekly backup+ {{ $t("database.automatic-weekly-backup") }}<span class="ml-1 text-control-light">disabled</span><buttonv-if="allowAdmin && !state.autoBackupEnabled"@@ -68,20 +85,22 @@class="ml-4 btn-primary"@click.prevent="toggleAutoBackup(true)">- Enable backup+ {{ $t("database.enable-backup") }}</button></div></div><div class="pt-6 space-y-4"><div class="flex justify-between items-center">- <div class="text-lg leading-6 font-medium text-main">Backups</div>+ <div class="text-lg leading-6 font-medium text-main">+ {{ $t("common.backups") }}+ </div><buttonv-if="allowEdit"type="button"class="btn-normal whitespace-nowrap items-center"@click.prevent="state.showCreateBackupModal = true">- Backup now+ {{ $t("database.backup-now") }}</button></div><BackupTable@@ -92,7 +111,7 @@</div><BBModalv-if="state.showCreateBackupModal"- :title="'Create a manual backup'"+ :title="$t('database.create-a-manual-backup')"@close="state.showCreateBackupModal = false"><DatabaseBackupCreateForm@@ -127,6 +146,7 @@ import {import BackupTable from "../components/BackupTable.vue";import DatabaseBackupCreateForm from "../components/DatabaseBackupCreateForm.vue";import { cloneDeep, isEmpty, isEqual } from "lodash";+import { useI18n } from "vue-i18n";interface LocalState {showCreateBackupModal: boolean;@@ -160,14 +180,15 @@ export default {},setup(props) {const store = useStore();+ const { t } = useI18n();const state = reactive<LocalState>({showCreateBackupModal: false,autoBackupEnabled: false,autoBackupHour: 0,autoBackupDayOfWeek: 0,- autoBackupHookUrl: '',- autoBackupUpdatedHookUrl: '',+ autoBackupHookUrl: "",+ autoBackupUpdatedHookUrl: "",});onUnmounted(() => {@@ -224,28 +245,28 @@ export default {state.autoBackupDayOfWeek);if (dayOfWeek == -1) {- return "day";+ return t("database.week.day");}if (dayOfWeek == 0) {- return "Sunday";+ return t("database.week.Sunday");}if (dayOfWeek == 1) {- return "Monday";+ return t("database.week.Monday");}if (dayOfWeek == 2) {- return "Tuesday";+ return t("database.week.Tuesday");}if (dayOfWeek == 3) {- return "Wednesday";+ return t("database.week.Wednesday");}if (dayOfWeek == 4) {- return "Thursday";+ return t("database.week.Thursday");}if (dayOfWeek == 5) {- return "Friday";+ return t("database.week.Friday");}if (dayOfWeek == 6) {- return "Saturday";+ return t("database.week.Saturday");}return `Invalid day of week: ${dayOfWeek}`;});@@ -275,7 +296,7 @@ export default {const UrlChanged = computed(() => {return !isEqual(state.autoBackupHookUrl, state.autoBackupUpdatedHookUrl);- })+ });const createBackup = (backupName: string) => {// Create backup@@ -356,11 +377,14 @@ export default {}).then((backupSetting: BackupSetting) => {assignBackupSetting(backupSetting);- const action = on ? "Enabled" : "Disabled";+ const action = on ? t("database.enabled") : t("database.disabled");store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `${action} automatic backup for database '${props.database.name}'.`,+ title: t(+ "database.action-automatic-backup-for-database-props-database-name",+ [action, props.database.name]+ ),});});};@@ -382,10 +406,13 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `Updated backup hook URL for database '${props.database.name}'.`,+ title: t(+ "database.updated-backup-webhook-url-for-database-props-database-name",+ [props.database.name]+ ),});});- }+ };function localToUTC(hour: number, dayOfWeek: number) {return alignUTC(hour, dayOfWeek, new Date().getTimezoneOffset() * 60);diff --git a/frontend/src/components/DatabaseOverviewPanel.vue b/frontend/src/components/DatabaseOverviewPanel.vueindex cafb7c4d12..6acc02137f 100644--- a/frontend/src/components/DatabaseOverviewPanel.vue+++ b/frontend/src/components/DatabaseOverviewPanel.vue@@ -2,11 +2,12 @@<div class="space-y-6 divide-y divide-block-border"><div v-if="anomalySectionList.length > 0"><div class="text-lg leading-6 font-medium text-main mb-4 flex flex-row">- Anomalies- <span class="ml-2 textinfolabel items-center flex"- >The list might be out of date and is refreshed roughly every 10- minutes</span- >+ {{ $t("common.anomalies") }}+ <span class="ml-2 textinfolabel items-center flex">{{+ $t(+ "database.the-list-might-be-out-of-date-and-is-refreshed-roughly-every-10-minutes"+ )+ }}</span></div><AnomalyTable :anomaly-section-list="anomalySectionList" /></div>@@ -14,7 +15,7 @@v-elseclass="text-lg leading-6 font-medium text-main mb-4 flex flex-row">- No anomalies detected+ {{ $t("database.no-anomalies-detected") }}<heroicons-outline:check-circle class="ml-1 w-6 h-6 text-success" /></div>@@ -30,8 +31,8 @@<dt class="text-sm font-medium text-control-light">{{database.instance.engine == "POSTGRES"- ? "Encoding"- : "Character set"+ ? $t("db.encoding")+ : $t("db.character-set")}}</dt><dd class="mt-1 text-sm text-main">@@ -40,7 +41,9 @@</div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">Collation</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("db.collation") }}+ </dt><dd class="mt-1 text-sm text-main">{{ database.collation }}</dd>@@ -48,7 +51,9 @@</template><div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">Sync status</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("database.sync-status") }}+ </dt><dd class="mt-1 text-sm text-main"><span>{{ database.syncStatus }}</span></dd>@@ -56,7 +61,7 @@<div class="col-span-1"><dt class="text-sm font-medium text-control-light">- Last successful sync+ {{ $t("database.last-successful-sync") }}</dt><dd class="mt-1 text-sm text-main">{{ humanizeTs(database.lastSuccessfulSyncTs) }}@@ -64,14 +69,18 @@</div><div class="col-span-1 col-start-1">- <dt class="text-sm font-medium text-control-light">Created</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.created-at") }}+ </dt><dd class="mt-1 text-sm text-main">{{ humanizeTs(database.createdTs) }}</dd></div><div class="col-span-1">- <dt class="text-sm font-medium text-control-light">Updated</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("common.updated-at") }}+ </dt><dd class="mt-1 text-sm text-main">{{ humanizeTs(database.updatedTs) }}</dd>@@ -79,10 +88,14 @@</dl><div class="pt-6">- <div class="text-lg leading-6 font-medium text-main mb-4">Tables</div>+ <div class="text-lg leading-6 font-medium text-main mb-4">+ {{ $t("db.tables") }}+ </div><TableTable :table-list="tableList" />- <div class="mt-6 text-lg leading-6 font-medium text-main mb-4">Views</div>+ <div class="mt-6 text-lg leading-6 font-medium text-main mb-4">+ {{ $t("db.views") }}+ </div><ViewTable :view-list="viewList" /></div>@@ -134,7 +147,7 @@class="btn-normal"@click.prevent="cancelEditDataSource">- Cancel+ {{ $t("common.cancel") }}</button><buttontype="button"@@ -146,7 +159,7 @@<heroicons-solid:saveclass="-ml-1 mr-2 h-5 w-5 text-control-light"/>- <span>Save</span>+ <span>{{ $t("common.save") }}</span></button></template><template v-else>@@ -159,7 +172,7 @@<heroicons-solid:pencilclass="-ml-1 mr-2 h-5 w-5 text-control-light"/>- <span>Edit</span>+ <span>{{ $t("common.edit") }}</span></button></template></div>diff --git a/frontend/src/components/DatabaseTable.vue b/frontend/src/components/DatabaseTable.vueindex 326fb42c66..ee9a882fa9 100644--- a/frontend/src/components/DatabaseTable.vue+++ b/frontend/src/components/DatabaseTable.vue@@ -16,10 +16,12 @@{{ database.name }}</span><div v-if="!showMiscColumn && database.syncStatus != 'OK'">- <span class="tooltip"- >Last sync status {{ database.syncStatus }} at- {{ humanizeTs(database.lastSuccessfulSyncTs) }}</span- >+ <span class="tooltip">{{+ $t("database.last-sync-status", [+ database.syncStatus,+ humanizeTs(database.lastSuccessfulSyncTs),+ ])+ }}</span><heroicons-outline:exclamation-circle class="w-5 h-5 text-error" /></div></div>@@ -37,7 +39,9 @@xmlns="http://www.w3.org/2000/svg"></svg><template v-else-if="database.project.workflowType == 'VCS'">- <span class="tooltip">Version control enabled</span>+ <span class="tooltip">{{+ $t("database.version-control-enabled")+ }}</span><heroicons-outline:collectionclass="w-4 h-4 text-control hover:text-control-hover"/>@@ -237,7 +241,7 @@ export default {if (showConsoleLink.value) {// Use cloneDeep, otherwise it will alter the one in columnListMaplist = cloneDeep(list);- list.push({ title: "SQL console" });+ list.push({ title: t("database.sql-console") });}return list;});diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.ymlindex cf7531170c..97dec111d8 100644--- a/frontend/src/locales/en.yml+++ b/frontend/src/locales/en.yml@@ -96,6 +96,11 @@ common:add: Addquery: Querytransfer: Transfer+ migration: Migration+ schema: Schema+ anomalies: Anomalies+ do-not-show-again: Do not show again+ backups: Backupsdetail: Detailtype: Typelanguage: Language@@ -111,6 +116,7 @@ common:restore: Restoredetailed-guide: detailed guideworkspace: workspace+ learn-more: Learn more.error-page:go-back-home: Go back homeanomaly-center: Anomaly Center@@ -189,7 +195,7 @@ settings:plan: (Upgrade to Team plan to enable role management)workspace:url-section: SQL Console URL- url-tip: "Tip: Use {schema} as the placeholder for the actual database name"+ url-tip: 'Tip: Use {schema} as the placeholder for the actual database name'tip: >-If your team use a separate SQL console such as phpMyAdmin, you canprovide its URL pattern here. Once provided, Bytebase will surface the@@ -242,7 +248,7 @@ activity:reopened-issue: reopened issueresolved-issue: resolved issuecanceled-issue: canceled issue- empty: ""+ empty: ''changed: changedupdated: updatedcanceled: canceled@@ -250,7 +256,7 @@ activity:started: startedcompleted: completedfailed: failed- task-name: " task {name}"+ task-name: ' task {name}'committed-to-at: committed {file} to{branch}{'@'}{repo}subject-prefix:task: Task@@ -297,7 +303,7 @@ issue:updated: Updatedassignee: Assigneestage-select:- active: "{name} (active)"+ active: '{name} (active)'alter-schema:vcs-enabled: >-This project has enabled VCS based version control and selecting database@@ -318,14 +324,14 @@ quick-action:create-db: Create databasechoose-db: Choose databasenew-db: New DB- add-instance: "@:common.add @:common.instance"- create-instance: "@:common.create @:common.instance"+ add-instance: '@:common.add @:common.instance'+ create-instance: '@:common.create @:common.instance'manage-user: Manage Userdefault-project: Default Project- add-environment: "@:common.add @:common.environment"- create-environment: "@:common.create @:common.environment"- new-project: "@:common.new @:common.project"- create-project: "@:common.create @:common.project"+ add-environment: '@:common.add @:common.environment'+ create-environment: '@:common.create @:common.environment'+ new-project: '@:common.new @:common.project'+ create-project: '@:common.create @:common.project'edit-data: Edit Datatroubleshoot: Troubleshoottransfer-in-db: Transfer in DB@@ -339,7 +345,7 @@ quick-action:transfer-in-db-alert: Are you sure to transfer "{ dbName }" into our project?create-db:new-database-name: New database name- reserved-db-error: "{databaseName} is a reserved name"+ reserved-db-error: '{databaseName} is a reserved name'db:encoding: Encodingcharacter-set: Character set@@ -347,10 +353,39 @@ db:select: Select databaseselect-instance-first: Select instance firstselect-environment-first: Select environment first+ tables: Tables+ views: Views+ parent: Parentlast-successful-sync: Last successful syncsync-status: Sync statusinstance:select: Select instance+ new-database: New Database+ syncing: Syncing ...+ sync-now: Sync Now+ create-migration-schema: Create migration schema+ missing-migration-schema: Missing migration schema+ unable-to-connect-instance-to-check-migration-schema: Unable to connect instance to check migration schema+ bytebase-relies-on-migration-schema-to-manage-version-control-based-schema-migration-for-databases-belonged-to-this-instance: >-+ Bytebase relies on migration schema to manage version control based schema+ migration for databases belonged to this instance.+ please-contact-your-dba-to-configure-it: Please contact your DBA to configure it.+ please-check-the-instance-connection-info-is-correct: Please check the instance connection info is correct.+ users: Users+ successfully-archived-instance-updatedinstance-name: Successfully archived instance '{0}'.+ successfully-restored-instance-updatedinstance-name: Successfully restored instance '{0}'.+ failed-to-create-migration-schema-for-instance-instance-value-name: Failed to create migration schema for instance '{0}'.+ successfully-created-migration-schema-for-instance-value-name: Successfully created migration schema for '{0}'.+ failed-to-sync-schema-for-instance-instance-value-name: Failed to sync schema for instance '{0}'.+ successfully-synced-schema-for-instance-instance-value-name: Successfully synced schema for instance '{0}'.+ archive-this-instance: Archive this instance+ archive-instance-instance-name: Archive instance '{0}'?+ archived-instances-will-not-be-shown-on-the-normal-interface-you-can-still-restore-later-from-the-archive-page: >-+ Archived instances will not be shown on the normal interface. You can still+ restore later from the Archive page.+ restore-this-instance: Restore this instance+ restore: Restore+ restore-instance-instance-name-to-normal-state: Restore instance '{0}' to normal state?environment:select: Select environmentarchive: Archive this environment@@ -361,10 +396,10 @@ environment:quick-start:bookmark-an-issue: Bookmark an issueadd-a-comment: Add a comment- visit-project: "@:common.visit @:common.projects"- visit-instance: "@:common.visit @:common.instances"- visit-database: "@:common.visit @:common.databases"- visit-environment: "@:common.visit @:common.environments"+ visit-project: '@:common.visit @:common.projects'+ visit-instance: '@:common.visit @:common.instances'+ visit-database: '@:common.visit @:common.databases'+ visit-environment: '@:common.visit @:common.environments'add-a-member: Add a membernotice:title: Quickstart guide dismissed@@ -441,6 +476,56 @@ migration-history:instance-missing-migration-schema: Missing migration history schema on instance "{name}".instance-bad-connection: Unable to connect instance "{name}" to retrieve migration history.contact-dba: Please contact your DBA to config it+database:+ the-list-might-be-out-of-date-and-is-refreshed-roughly-every-10-minutes: The list might be out of date and is refreshed roughly every 10 minutes+ no-anomalies-detected: No anomalies detected+ sync-status: Sync status+ last-successful-sync: Last successful sync+ search-database-name: Search database name+ how-to-setup-database: How to setup \'Database\' ?+ show-guide-description: >-+ Each Bytebase database maps to the one created by \'CREATE DATABASE xxx\'.+ In Bytebase, a database always belongs to a single project.\n\nBytebase will+ periodically sync the database info for every recorded instance. You can+ also create a new database from the dashboard.+ restored-from: 'Restored from '+ database-name-is-restored-from-another-database-backup: '{0} is restored from another database backup'+ database-backup: database backup+ sql-console: SQL Console+ transfer-project: Transfer Project+ alter-schema-in-vcs: Alter Schema in VCS+ successfully-transferred-updateddatabase-name-to-project-updateddatabase-project-name: Successfully transferred '{0}' to project '{1}'.+ backup-name: Backup name+ create-backup: Create backup+ automatic-weekly-backup: Automatic weekly backup+ disable-automatic-backup: Disable automatic backup+ backuppolicy-backup-enforced-and-cant-be-disabled: '{0} backup enforced and can''t be disabled'+ backup-policy:+ DAILY: DAILY+ WEEKLY: WEEKLY+ an-http-post-request-will-be-sent-to-it-after-a-successful-backup: An HTTP POST request will be sent to it after a successful backup.+ backup-info:+ template: Backup will be taken on every {dayOrWeek} at {time}+ week:+ Sunday: Sunday+ Monday: Monday+ Tuesday: Tuesday+ Wednesday: Wednesday+ Thursday: Thursday+ Friday: Friday+ Saturday: Saturday+ day: day+ enable-backup: Enable backup+ backup-now: Backup now+ create-a-manual-backup: Create a manual backup+ disabled: Disabled+ enabled: Enabled+ action-automatic-backup-for-database-props-database-name: '{0} automatic backup for database ''{1}''.'+ updated-backup-webhook-url-for-database-props-database-name: Updated backup webhook URL for database '{0}'.+ last-sync-status: Last sync status {0} at {1}+ version-control-enabled: Version control enabled+t:+ database: {}repository:branch-observe-file-change: The branch where Bytebase observes the file change.branch-specify-tip: 'Tip: You can also use wildcard like ''feature/*'@@ -549,39 +634,42 @@ project:modal:title: How to setup \'@:{'common.project'}\' ?content: >-- Bytebase project is similar to the project concept in other common dev tools.+ 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 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.+ A project can also be configured to link to a repository to enable+ version control workflow.cancel: Dismissconfirm: Do not show againsearch-bar-placeholder: Search project nametable:- key: "@:common.key"- name: "@:common.name"+ key: '@:common.key'+ name: '@:common.name'created-at: Created Atcreate-modal:- project-name: "@:common.project @:common.name"- key: "@:common.key"- key-hint: (Uppercase letters identifying your project)- cancel: "@:common.cancel"- confirm: "@:common.create"+ 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 allview-all-closed: View all closed- recent-activity: "Recent @.lower:{'common.activities'}"+ recent-activity: Recent @.lower:{'common.activities'}in-progress: In progressrecently-closed: Recently Closedinfo-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.+ 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.+ 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 webhooklast-updated-by: Last updated bu@@ -596,8 +684,9 @@ project:systems on various events.creation:title: Create webhook- desc: >-- Create the corresponding webhook for the {destination} channel receiving the message.+ 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.@@ -624,8 +713,8 @@ project:member-placeholder: Select usermanage-member: Manage membersadd-member: Add member- owner: "@.upper:common.role.owner"- developer: "@.upper:common.role.developer"+ owner: '@.upper:common.role.owner'+ developer: '@.upper:common.role.developer'archive:btn-text: Archive this @.lower:{'common.project'}restore:diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.ymlindex 44823bcd9b..c78efcd2e1 100644--- a/frontend/src/locales/zh-CN.yml+++ b/frontend/src/locales/zh-CN.yml@@ -96,6 +96,11 @@ common:add: 添加query: 查询transfer: 转移+ migration: 迁移+ schema: Schema+ anomalies: 异常+ do-not-show-again: 不再显示+ backups: 备份detail: 详情type: 类型language: 语言@@ -111,6 +116,7 @@ common:restore: 重置detailed-guide: 详细指南workspace: 工作空间+ learn-more: 了解更多。error-page:go-back-home: 回到主页anomaly-center: 异常中心@@ -131,7 +137,7 @@ task:checking: 检查中…run-task: 运行检查check-result:- title: "{name} 的检查结果"+ title: '{name} 的检查结果'check-type:fake: Fakesyntax: 语法@@ -186,9 +192,9 @@ settings:plan: (升级到团队方案来开启角色管理)workspace:url-section: SQL Console URL- url-tip: "提示: 用 {schema} 作为真实数据库名称的占位符"+ url-tip: '提示: 用 {schema} 作为真实数据库名称的占位符'tip: >-- 如果您的团队使用一个单独的 SQL 控制台,如 phpMyAdmin,那么可以在这里提供它的 URL 模板,Bytebase+ 如果您的团队使用一个单独的 SQL 控制台,如 phpMyAdmin,那么可以在这里提供他的 URL 模板,Bytebase就可以将控制台链接到相关的数据库和表的界面上。tip-link: 详细指引members:@@ -238,7 +244,7 @@ activity:reopened-issue: 重开工单resolved-issue: 解决工单canceled-issue: 取消工单- empty: ""+ empty: ''changed: 修改updated: 更新canceled: 取消@@ -252,8 +258,8 @@ activity:task: 任务issue:waiting-approval: 等待批准- opened-by-at: "{id} 由 {creator} 开启于 {time}"- commit-by-at: "{id} {title} 由 {author} 提交于 {time}"+ opened-by-at: '{id} 由 {creator} 开启于 {time}'+ commit-by-at: '{id} {title} 由 {author} 提交于 {time}'status-transition:modal:resolve: 解决工单?@@ -269,10 +275,10 @@ issue:subscribe: 订阅unsubscribe: 取消订阅subscriber: 没有订阅者 | 1 个订阅者 | {n} 个订阅者- apply-to-other-stages: "@:{'common.apply'}到其他@:{'common.stage'}"+ apply-to-other-stages: '@:{''common.apply''}到其他@:{''common.stage''}'add-sql-statement: 添加 SQL @:{'common.statement'}…optional-add-sql-statement: (可选)添加 SQL @:{'common.statement'}…- rollback-sql: "@:{'common.rollback'} SQL"+ rollback-sql: '@:{''common.rollback''} SQL'add-rollback-sql-statement: 添加 @:{'common.rollback'} SQL @:{'common.statement'}…edit-description: 编辑描述add-some-description: 添加一些描述…@@ -293,7 +299,7 @@ issue:updated: 更新于assignee: 审核人stage-select:- active: "{name}(活动中)"+ active: '{name}(活动中)'alter-schema:vcs-enabled: 该项目开启了基于 VCS 的版本管理,选择下面的数据库会将您导航到相应的 Git 仓库以创建 schema 变更。vcs-info: 代表项目开启了基于 VCS 的版本管理。选择该类项目下的数据库会将您导航到对应的 Git 仓库以创建 schema 变更。@@ -305,14 +311,14 @@ quick-action:create-db: 创建数据库choose-db: 选择数据库new-db: 创建数据库- add-instance: "@:common.add@:common.instance"- create-instance: "@:common.create@:common.instance"+ add-instance: '@:common.add@:common.instance'+ create-instance: '@:common.create@:common.instance'manage-user: 成员管理default-project: 默认项目- add-environment: "@:common.add@:common.environment"- create-environment: "@:common.create@:common.environment"- new-project: "@:common.new@:common.project"- create-project: "@:common.create@:common.project"+ add-environment: '@:common.add@:common.environment'+ create-environment: '@:common.create@:common.environment'+ new-project: '@:common.new@:common.project'+ create-project: '@:common.create@:common.project'edit-data: 编辑数据troubleshoot: 问题排查transfer-in-db: 转移数据库@@ -324,7 +330,7 @@ quick-action:transfer-in-db-alert: 您确定要转移 "{ dbName }" 到我们的项目中吗?create-db:new-database-name: 新数据库名称- reserved-db-error: "{databaseName} 是一个预留名称"+ reserved-db-error: '{databaseName} 是一个预留名称'db:encoding: 字符编码character-set: 字符集@@ -332,10 +338,38 @@ db:select: 选择数据库select-instance-first: 先选择实例select-environment-first: 先选择环境+ tables: 表+ views: 视图+ parent: 母last-successful-sync: 上次成功同步于sync-status: 同步状态instance:select: 选择实例+ new-database: '@:common.new@:common.database'+ syncing: 同步中 ...+ sync-now: 现在同步+ create-migration-schema: '@:common.create@:common.migration @:{''common.schema''}'+ missing-migration-schema: 缺少@:common.migration @:common.schema+ unable-to-connect-instance-to-check-migration-schema: 无法连接到@:{'common.instance'}以检查@:{'common.migration'} @:{'common.schema'}+ bytebase-relies-on-migration-schema-to-manage-version-control-based-schema-migration-for-databases-belonged-to-this-instance: >-+ Bytebase需要@:{'common.migration'} @:{'common.schema'}+ 来管理属于这个@:{'common.instance'}的@:{'common.database'}的基于版本管理的 schema+ @:common.migration+ please-contact-your-dba-to-configure-it: 请联系 DBA 配置。+ please-check-the-instance-connection-info-is-correct: 请检查实例连接信息是否正确。+ users: 用户+ successfully-archived-instance-updatedinstance-name: 成功归档实例'{0}'。+ successfully-restored-instance-updatedinstance-name: 成功恢复实例'{0}'。+ failed-to-create-migration-schema-for-instance-instance-value-name: 为实例'{0}'创建迁移schema失败。+ successfully-created-migration-schema-for-instance-value-name: 成功为'{0}'创建迁移Schema。+ failed-to-sync-schema-for-instance-instance-value-name: 为实例'{0}'同步 schema 失败。+ successfully-synced-schema-for-instance-instance-value-name: 成功为实例'{0}'同步 schema 。+ archive-instance-instance-name: 归档实例'{0}'?+ archive-this-instance: 归档该实例+ archived-instances-will-not-be-shown-on-the-normal-interface-you-can-still-restore-later-from-the-archive-page: 已归档实例不会在界面上显示。您之后仍可以在归档页中恢复他。+ restore-this-instance: 恢复该实例+ restore: 恢复+ restore-instance-instance-name-to-normal-state: 恢复实例'{0}'到正常状态?environment:select: 选择环境archive: 归档此环境@@ -344,10 +378,10 @@ environment:quick-start:bookmark-an-issue: 收藏工单add-a-comment: 添加评论- visit-project: "@:common.visit@:common.projects"- visit-instance: "@:common.visit@:common.instances"- visit-database: "@:common.visit@:common.databases"- visit-environment: "@:common.visit@:common.environments"+ visit-project: '@:common.visit@:common.projects'+ visit-instance: '@:common.visit@:common.instances'+ visit-database: '@:common.visit@:common.databases'+ visit-environment: '@:common.visit@:common.environments'add-a-member: 添加成员notice:title: 快速入门导览已关闭@@ -413,7 +447,54 @@ migration-history:establish-database-baseline: 建立「{name}」基线instance-missing-migration-schema: 实例「{name}」缺失用于记录迁移历史的 schema。instance-bad-connection: 无法连接实例「{name}」以获取迁移历史。- contact-dba: 请联系你的 DBA 进行配置。+ contact-dba: 请联系您的 DBA 进行配置。+database:+ the-list-might-be-out-of-date-and-is-refreshed-roughly-every-10-minutes: 该表每隔约10分钟刷新一次,所以信息可能已过期。+ last-successful-sync: 最后一次成功的同步+ no-anomalies-detected: 没有检测到异常+ sync-status: 同步状态+ search-database-name: 搜索数据库名称+ how-to-setup-database: 如何设置\'数据库\'?+ show-guide-description: |-+ 每个 Bytebase 数据库都映射到由 \'CREATE DATABASE xxx\' 创建的一个数据库。+ 在 Bytebase 中,一个数据库始终属于单个项目。\n\nBytebase 将定期同步每个实例的数据库信息。+ 您还可以从仪表板创建新数据库。+ restored-from: 恢复于+ database-name-is-restored-from-another-database-backup: '{0}恢复于另一个数据库备份'+ sql-console: SQL控制台+ transfer-project: 转移项目+ alter-schema-in-vcs: 变更 Schema(VCS)+ successfully-transferred-updateddatabase-name-to-project-updateddatabase-project-name: 成功将'{0}'转移到项目'{1}'。+ database-backup: 数据库备份+ backup-name: 备份名称+ create-backup: 创建备份+ automatic-weekly-backup: 每周自动备份+ disable-automatic-backup: 禁用自动备份+ backuppolicy-backup-enforced-and-cant-be-disabled: 强制{0}备份,不能禁用+ backup-policy:+ DAILY: 每日+ WEEKLY: 每周+ an-http-post-request-will-be-sent-to-it-after-a-successful-backup: 备份成功后向其发送 HTTP POST 请求。+ backup-info:+ template: 每{dayOrWeek}{time} 备份+ week:+ Friday: 周五+ Monday: 周一+ Saturday: 周六+ Sunday: 周日+ Thursday: 周四+ Wednesday: 周三+ Tuesday: 周二+ day: 日+ enable-backup: 启用备份+ backup-now: 现在备份+ create-a-manual-backup: 创建手动备份+ action-automatic-backup-for-database-props-database-name: 数据库'{1}'{0}自动备份+ enabled: 启用+ disabled: 禁用+ updated-backup-webhook-url-for-database-props-database-name: 更新了数据库'{0}'的 webhook URL。+ last-sync-status: 最后一次同步在{1},状态为{0}+ version-control-enabled: 已启用版本控制repository:branch-observe-file-change: Bytebase 跟踪文件变更的分支。branch-specify-tip: '诀窍: 可以使用诸如 "feature/*" 这样的通配符'@@ -474,7 +555,7 @@ anomaly:该列表大约每 10 分钟刷新一次。table-search-placeholder: 搜索{type}或者环境table-placeholder: 很棒,没有检测到{type}异常!- tooltip: "{env} 环境有 {criticalCount} 个严重异常, {highCount} 个高等级异常和 {mediumCount} 个中等级异常"+ tooltip: '{env} 环境有 {criticalCount} 个严重异常, {highCount} 个高等级异常和 {mediumCount} 个中等级异常'types:connection-failure: 连接失败missing-migration-schema: 缺少迁移 Schema@@ -493,40 +574,36 @@ project:dashboard:modal:title: 如何创建您的'@:{'common.project'}' ?- content: >-+ content: |-在 Bytebase 中,项目的概念与其他常见的的开发工具类似-一个项目会有属于他的协作成员,并且每一个数据库和工单总是归属于某一个项目-同时,一个项目可以关联一个代码仓库,并以此来进行版本控制cancel: 关闭confirm: 不再出现search-bar-placeholder: 搜索项目名称table:- key: "@:common.key"- name: "@:common.name"+ 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"+ 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'}"+ 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} 来添加数据库.+ 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: 添加 webhooklast-updated-by: 最后修改人@@ -536,14 +613,11 @@ project:test-webhook: 测试 Webhookno-webhook:title: 当前项目暂未配置 webhook- content: >-- 配置 webhook 来让 Bytebase 在完成任务后向您的外部系统推送通知+ content: 配置 webhook 来让 Bytebase 在完成任务后向您的外部系统推送通知creation:title: 创建 webhook- desc: >-- 为 {destination} 创建一个 webhook- how-to-protect: >-- 您可以通过添加 'Bytebase' 到您的 webhook 关键字白名单中来保护您的 webhook+ desc: 为 {destination} 创建一个 webhook+ how-to-protect: 您可以通过添加 'Bytebase' 到您的 webhook 关键字白名单中来保护您的 webhookview-doc: '{destination} 的官方文档'deletion:btn-text: Delete this webhook@@ -567,8 +641,8 @@ project:member-placeholder: 选择用户manage-member: 管理成员add-member: 添加成员- owner: "@.upper:commo project.setting.add-membern.role.owner"- developer: "@.upper:common.role.developer"+ owner: '@.upper:commo project.setting.add-membern.role.owner'+ developer: '@.upper:common.role.developer'archive:btn-text: 收藏这个@:common.projectrestore:diff --git a/frontend/src/views/DatabaseDashboard.vue b/frontend/src/views/DatabaseDashboard.vueindex 8dea8709f5..e376a7ef17 100644--- a/frontend/src/views/DatabaseDashboard.vue+++ b/frontend/src/views/DatabaseDashboard.vue@@ -8,7 +8,7 @@/><BBTableSearchref="searchField"- :placeholder="'Search database name'"+ :placeholder="$t('database.search-database-name')"@change-text="(text) => changeSearchText(text)"/></div>@@ -18,10 +18,10 @@<BBAlertv-if="state.showGuide":style="'INFO'"- :ok-text="'Do not show again'"- :cancel-text="'Dismiss'"- :title="'How to setup \'Database\' ?'"- :description="'Each Bytebase database maps to the one created by \'CREATE DATABASE xxx\'. In Bytebase, a database always belongs to a single project.\n\nBytebase will periodically sync the database info for every recorded instance. You can also create a new database from the dashboard.'"+ :ok-text="$t('common.do-not-show-again')"+ :cancel-text="$t('common.dismiss')"+ :title="$t('database.how-to-setup-database')"+ :description="$t('database.show-guide-description')"@ok="() => {doDismissGuide();diff --git a/frontend/src/views/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail.vueindex f0a48caedc..7551a3a5aa 100644--- a/frontend/src/views/DatabaseDetail.vue+++ b/frontend/src/views/DatabaseDetail.vue@@ -3,12 +3,7 @@<main class="flex-1 relative overflow-y-auto"><!-- Highlight Panel --><div- class="- px-4- pb-4- space-y-2- md:space-y-0 md:flex md:items-center md:justify-between- "+ class="px-4 pb-4 space-y-2 md:space-y-0 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">{{ database.name }}</h1>@@ -32,15 +19,13 @@</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>+ <dt class="sr-only">{{ $t("common.environment") }}</dt><dd class="flex items-center text-sm md:mr-4">- <span class="textlabel">Environment - </span>+ <span class="textlabel"+ >{{ $t("common.environment") }} - </span+ ><router-link:to="`/environment/${environmentSlug(database.instance.environment@@ -50,10 +35,12 @@{{ environmentName(database.instance.environment) }}</router-link></dd>- <dt class="sr-only">Instance</dt>+ <dt class="sr-only">{{ $t("common.instance") }}</dt><dd class="flex items-center text-sm md:mr-4"><InstanceEngineIcon :instance="database.instance" />- <span class="ml-1 textlabel">Instance - </span>+ <span class="ml-1 textlabel"+ >{{ $t("common.instance") }} - </span+ ><router-link:to="`/instance/${instanceSlug(database.instance)}`"class="normal-link"@@ -61,9 +48,11 @@{{ instanceName(database.instance) }}</router-link></dd>- <dt class="sr-only">Project</dt>+ <dt class="sr-only">{{ $t("common.project") }}</dt><dd class="flex items-center text-sm md:mr-4">- <span class="textlabel">Project - </span>+ <span class="textlabel"+ >{{ $t("common.project") }} - </span+ ><router-link:to="`/project/${projectSlug(database.project)}`"class="normal-link"@@ -72,19 +61,23 @@</router-link></dd><template v-if="database.sourceBackup">- <dt class="sr-only">Parent</dt>+ <dt class="sr-only">{{ $t("db.parent") }}</dt><dd class="flex items-center text-sm md:mr-4 tooltip-wrapper">- <span class="textlabel">Restored from </span>+ <span class="textlabel">{{+ $t("database.restored-from")+ }}</span><router-link:to="`/db/${database.sourceBackup.databaseId}`"class="normal-link"><!-- Do not display the name of the backup's database because that requires a fetch -->- <span class="tooltip"- >{{ database.name }} is restored from another database- backup</span- >- database backup+ <span class="tooltip">{{+ $t(+ "database.database-name-is-restored-from-another-database-backup",+ [database.name]+ )+ }}</span>+ {{ $t("database.database-backup") }}</router-link></dd></template>@@ -92,7 +85,7 @@v-if="databaseConsoleLink.length > 0"class="flex items-center text-sm md:mr-4">- <span class="textlabel">SQL Console</span>+ <span class="textlabel">{{ $t("database.sql-console") }}</span><buttonclass="ml-1 btn-icon"@click.prevent="@@ -111,7 +104,7 @@class="btn-normal"@click.prevent="tryTransferProject">- <span>Transfer Project</span>+ <span>{{ $t("database.transfer-project") }}</span><heroicons-outline:switch-horizontalclass="-mr-1 ml-2 h-5 w-5 text-control-light"/>@@ -134,11 +127,11 @@<BBModalv-if="state.showModal"- :title="'Transfer project'"+ :title="$t('database.transfer-project')"@close="state.showModal = false"><div class="col-span-1 w-64">- <label for="user" class="textlabel"> Project </label>+ <label for="user" class="textlabel"> {{ $t("common.project") }} </label><!-- Only allow to transfer database to the project having OWNER role --><!-- eslint-disable vue/attribute-hyphenation --><ProjectSelect@@ -161,7 +154,7 @@class="btn-normal py-2 px-4"@click.prevent="state.showModal = false">- Cancel+ {{ $t("common.cancel") }}</button><buttontype="button"@@ -172,7 +165,7 @@state.showModal = false;">- Transfer+ {{ $t("common.transfer") }}</button></div></BBModal>@@ -227,6 +220,7 @@ import {} from "../types";import { isEmpty } from "lodash";import { BBTabFilterItem } from "../bbkit/types";+import { useI18n } from "vue-i18n";const OVERVIEW_TAB = 0;const MIGRATION_HISTORY_TAB = 1;@@ -237,12 +231,6 @@ type DatabaseTabItem = {hash: string;};-const databaseTabItemList: DatabaseTabItem[] = [- { name: "Overview", hash: "overview" },- { name: "Migration History", hash: "migration-history" },- { name: "Backups", hash: "backup" },-];-interface LocalState {showModal: boolean;editingProjectId: ProjectId;@@ -267,6 +255,13 @@ export default {setup(props) {const store = useStore();const router = useRouter();+ const { t } = useI18n();++ const databaseTabItemList: DatabaseTabItem[] = [+ { name: t("common.overview"), hash: "overview" },+ { name: t("migration-history.self"), hash: "migration-history" },+ { name: t("common.backups"), hash: "backup" },+ ];const state = reactive<LocalState>({showModal: false,@@ -364,9 +359,9 @@ export default {const alterSchemaText = computed(() => {if (database.value.project.workflowType == "VCS") {- return "Alter Schema in VCS";+ return t("database.alter-schema-in-vcs");}- return "Alter Schema";+ return t("quick-action.alter-schema");});const tabItemList = computed((): BBTabFilterItem[] => {@@ -416,7 +411,10 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `Successfully transferred '${updatedDatabase.name}' to project '${updatedDatabase.project.name}'.`,+ title: t(+ "database.successfully-transferred-updateddatabase-name-to-project-updateddatabase-project-name",+ [updatedDatabase.name, updatedDatabase.project.name]+ ),});});};diff --git a/frontend/src/views/InstanceDetail.vue b/frontend/src/views/InstanceDetail.vueindex 3a884dde0d..d38662d1c4 100644--- a/frontend/src/views/InstanceDetail.vue+++ b/frontend/src/views/InstanceDetail.vue@@ -30,7 +30,10 @@/><div class="flex items-center space-x-4"><div>- <BBSpin v-if="state.syncingSchema" :title="'Syncing ...'" />+ <BBSpin+ v-if="state.syncingSchema"+ :title="$t('instance.syncing')"+ /></div><buttonv-if="allowEdit"@@ -38,7 +41,7 @@class="btn-normal"@click.prevent="syncSchema">- Sync Now+ {{ $t("instance.sync-now") }}</button><buttonv-if="instance.rowStatus == 'NORMAL'"@@ -46,7 +49,7 @@class="btn-primary"@click.prevent="createDatabase">- New Database+ {{ $t("instance.new-database") }}</button></div></div>@@ -64,21 +67,31 @@<template v-if="instance.rowStatus == 'NORMAL'"><BBButtonConfirm:style="'ARCHIVE'"- :button-text="'Archive this instance'"- :ok-text="'Archive'"+ :button-text="$t('instance.archive-this-instance')"+ :ok-text="$t('common.archive')":require-confirm="true"- :confirm-title="`Archive instance '${instance.name}'?`"- :confirm-description="'Archived instances will not be shown on the normal interface. You can still restore later from the Archive page.'"+ :confirm-title="+ $t('instance.archive-instance-instance-name', [instance.name])+ "+ :confirm-description="+ $t(+ 'instance.archived-instances-will-not-be-shown-on-the-normal-interface-you-can-still-restore-later-from-the-archive-page'+ )+ "@confirm="doArchive"/></template><template v-else-if="instance.rowStatus == 'ARCHIVED'"><BBButtonConfirm:style="'RESTORE'"- :button-text="'Restore this instance'"- :ok-text="'Restore'"+ :button-text="$t('instance.restore-this-instance')"+ :ok-text="$t('instance.restore')":require-confirm="true"- :confirm-title="`Restore instance '${instance.name}' to normal state?`"+ :confirm-title="+ $t('instance.restore-instance-instance-name-to-normal-state', [+ instance.name,+ ])+ ":confirm-description="''"@confirm="doRestore"/>@@ -91,8 +104,12 @@v-if="state.showCreateMigrationSchemaModal":style="'INFO'":ok-text="'Create'"- :title="'Create migration schema?'"- :description="'Bytebase relies on migration schema to manage version control based schema migration for databases belonged to this instance.'"+ :title="$t('instance.create-migration-schema') + '?'"+ :description="+ $t(+ 'instance.bytebase-relies-on-migration-schema-to-manage-version-control-based-schema-migration-for-databases-belonged-to-this-instance'+ )+ ":in-progress="state.creatingMigrationSchema"@ok="() => {@@ -105,7 +122,7 @@<BBModalv-if="state.showCreateDatabaseModal"- :title="'Create database'"+ :title="$t('quick-action.create-db')"@close="state.showCreateDatabaseModal = false"><!-- eslint-disable vue/attribute-hyphenation -->@@ -135,6 +152,7 @@ import {SqlResultSet,} from "../types";import { BBTabFilterItem } from "../bbkit/types";+import { useI18n } from "vue-i18n";const DATABASE_TAB = 0;const USER_TAB = 1;@@ -166,6 +184,7 @@ export default {},setup(props) {const store = useStore();+ const { t } = useI18n();const currentUser = computed(() => store.getters["auth/currentUser"]());@@ -199,9 +218,11 @@ export default {const attentionTitle = computed((): string => {if (state.migrationSetupStatus == "NOT_EXIST") {- return "Missing migration schema";+ return t("instance.missing-migration-schema");} else if (state.migrationSetupStatus == "UNKNOWN") {- return "Unable to connect instance to check migration schema";+ return t(+ "instance.unable-to-connect-instance-to-check-migration-schema"+ );}return "";});@@ -209,17 +230,22 @@ export default {const attentionText = computed((): string => {if (state.migrationSetupStatus == "NOT_EXIST") {return (- "Bytebase relies on migration schema to manage version control based schema migration for databases belonged to this instance." ++ t(+ "instance.bytebase-relies-on-migration-schema-to-manage-version-control-based-schema-migration-for-databases-belonged-to-this-instance"+ ) +(isDBAOrOwner(currentUser.value.role)? ""- : " Please contact your DBA to configure it.")+ : " " + t("instance.please-contact-your-dba-to-configure-it")));} else if (state.migrationSetupStatus == "UNKNOWN") {return (- "Bytebase relies on migration schema to manage version control based schema migration for databases belonged to this instance." ++ t(+ "instance.bytebase-relies-on-migration-schema-to-manage-version-control-based-schema-migration-for-databases-belonged-to-this-instance"+ ) +(isDBAOrOwner(currentUser.value.role)- ? " Please check the instance connection info is correct."- : " Please contact your DBA to configure it.")+ ? " " ++ t("instance.please-check-the-instance-connection-info-is-correct")+ : " " + t("instance.please-contact-your-dba-to-configure-it")));}return "";@@ -228,7 +254,7 @@ export default {const attentionActionText = computed((): string => {if (isDBAOrOwner(currentUser.value.role)) {if (state.migrationSetupStatus == "NOT_EXIST") {- return "Create migration schema";+ return t("instance.create-migration-schema");} else if (state.migrationSetupStatus == "UNKNOWN") {return "";}@@ -277,11 +303,11 @@ export default {const tabItemList = computed((): BBTabFilterItem[] => {return [{- title: "Databases",+ title: t("common.databases"),alert: false,},{- title: "Users",+ title: t("instance.users"),alert: false,},];@@ -299,7 +325,10 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `Successfully archived instance '${updatedInstance.name}'.`,+ title: t(+ "instance.successfully-archived-instance-updatedinstance-name",+ [updatedInstance.name]+ ),});});};@@ -316,7 +345,10 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `Successfully restored instance '${updatedInstance.name}'.`,+ title: t(+ "instance.successfully-restored-instance-updatedinstance-name",+ [updatedInstance.name]+ ),});});};@@ -331,7 +363,10 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "CRITICAL",- title: `Failed to create migration schema for instance '${instance.value.name}'.`,+ title: t(+ "instance.failed-to-create-migration-schema-for-instance-instance-value-name",+ [instance.value.name]+ ),description: resultSet.error,});} else {@@ -339,7 +374,10 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `Successfully created migration schema for '${instance.value.name}'.`,+ title: t(+ "instance.successfully-created-migration-schema-for-instance-value-name",+ [instance.value.name]+ ),});}state.showCreateMigrationSchemaModal = false;@@ -356,14 +394,20 @@ export default {store.dispatch("notification/pushNotification", {module: "bytebase",style: "CRITICAL",- title: `Failed to sync schema for instance '${instance.value.name}'.`,+ title: t(+ "instance.failed-to-sync-schema-for-instance-instance-value-name",+ [instance.value.name]+ ),description: resultSet.error,});} else {store.dispatch("notification/pushNotification", {module: "bytebase",style: "SUCCESS",- title: `Successfully synced schema for instance '${instance.value.name}'.`,+ title: t(+ "instance.successfully-synced-schema-for-instance-instance-value-name",+ [instance.value.name]+ ),description: resultSet.error,});}