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 for environment module part1 (#155)
spinningbota5bb38383134
diff --git a/frontend/components.d.ts b/frontend/components.d.tsindex eadbdd0f24..4cc9e52f34 100644--- a/frontend/components.d.ts+++ b/frontend/components.d.ts@@ -114,6 +114,7 @@ declare module 'vue' {'HeroiconsSolid:dotsVertical': typeof import('virtual:vite-icons/heroicons-solid/dots-vertical')['default']'HeroiconsSolid:home': typeof import('virtual:vite-icons/heroicons-solid/home')['default']'HeroiconsSolid:informationCircle': typeof import('virtual:vite-icons/heroicons-solid/information-circle')['default']+ 'HeroiconsSolid:mail': typeof import('virtual:vite-icons/heroicons-solid/mail')['default']'HeroiconsSolid:minus': typeof import('virtual:vite-icons/heroicons-solid/minus')['default']'HeroiconsSolid:officeBuilding': typeof import('virtual:vite-icons/heroicons-solid/office-building')['default']'HeroiconsSolid:pencil': typeof import('virtual:vite-icons/heroicons-solid/pencil')['default']diff --git a/frontend/src/components/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm.vueindex 61118afcfd..e16a13af69 100644--- a/frontend/src/components/EnvironmentForm.vue+++ b/frontend/src/components/EnvironmentForm.vue@@ -3,7 +3,7 @@<div class="grid grid-cols-1 gap-y-6 gap-x-4"><div class="col-span-1"><label for="name" class="textlabel">- Environment Name <span class="text-red-600">*</span>+ {{ $t('common.environments') }} <span class="text-red-600">*</span></label><BBTextFieldclass="mt-2 w-full"@@ -14,17 +14,9 @@/></div><div class="col-span-1">- <label class="textlabel"> Approval Policy </label>+ <label class="textlabel"> {{ $t('policy.approval.name') }} </label><div class="mt-1 textinfolabel">- For updating schema on the existing database, this setting controls- whether the task requires manual approval- <a- href="https://docs.bytebase.com/use-bytebase/approval-policy?ref=console"- target="_blank"- class="normal-link"- >- detailed guide</a- >.+ {{ $t('policy.approval.info') }}</div><div class="mt-4 flex flex-col space-y-4"><div class="flex space-x-4">@@ -42,10 +34,9 @@:disabled="!allowEdit"/><div class="-mt-0.5">- <div class="textlabel">Require manual approval</div>+ <div class="textlabel">{{ $t('policy.approval.manual') }}</div><div class="mt-1 textinfolabel">- Pending schema migration task will only be executed after it's- manually approved.+ {{ $t('policy.approval.manual-info') }}</div></div></div>@@ -64,17 +55,16 @@:disabled="!allowEdit"/><div class="-mt-0.5">- <div class="textlabel">Skip manual approval</div>+ <div class="textlabel">{{ $t('policy.approval.auto') }}</div><div class="mt-1 textinfolabel">- Pending schema migration task will be executed automatically.+ {{ $t('policy.approval.auto-info') }}</div></div></div></div></div><div class="col-span-1">- <label class="textlabel"> Database backup schedule policy </label>- <div class="mt-1 textinfolabel">Enforce database backup schedule</div>+ <label class="textlabel"> {{ $t('policy.backup.name') }} </label><div class="mt-4 flex flex-col space-y-4"><div class="flex space-x-4"><input@@ -90,9 +80,9 @@:disabled="!allowEdit"/><div class="-mt-0.5">- <div class="textlabel">Not enforced</div>+ <div class="textlabel">{{ $t('policy.backup.not-enforced') }}</div><div class="mt-1 textinfolabel">- No backup schedule is enforced.+ {{ $t('policy.backup.not-enforced-info') }}</div></div></div>@@ -110,9 +100,9 @@:disabled="!allowEdit"/><div class="-mt-0.5">- <div class="textlabel">Daily backup</div>+ <div class="textlabel">{{ $t('policy.backup.daily') }}</div><div class="mt-1 textinfolabel">- Enforce every database to backup daily.+ {{ $t('policy.backup.daily-info') }}</div></div></div>@@ -130,9 +120,9 @@:disabled="!allowEdit"/><div class="-mt-0.5">- <div class="textlabel">Weekly backup</div>+ <div class="textlabel">{{ $t('policy.backup.weekly') }}</div><div class="mt-1 textinfolabel">- Enforce every database to backup weekly.+ {{ $t('policy.backup.weekly-info') }}</div></div></div>@@ -146,7 +136,7 @@class="btn-normal py-2 px-4"@click.prevent="$emit('cancel')">- Cancel+ {{ $t('common.cancel') }}</button><buttontype="submit"@@ -154,7 +144,7 @@:disabled="!allowCreate"@click.prevent="createEnvironment">- Create+ {{ $t('common.create') }}</button></div><!-- Update button group -->@@ -163,10 +153,10 @@<BBButtonConfirmv-if="allowArchive":style="'ARCHIVE'"- :button-text="'Archive this environment'"- :ok-text="'Archive'"- :confirm-title="`Archive environment '${state.environment.name}'?`"- :confirm-description="'Archived environment will not be shown on the normal interface. You can still restore later from the Archive page.'"+ :button-text="$t('environment.archive')"+ :ok-text="$t('common.archive')"+ :confirm-title="$t('environment.archive') + ` '${state.environment.name}'?`"+ :confirm-description="$t('environment.archive-info')":require-confirm="true"@confirm="archiveEnvironment"/>@@ -191,7 +181,7 @@:disabled="!valueChanged"@click.prevent="revertEnvironment">- Revert+ {{ $t('common.revert') }}</button><buttontype="submit"@@ -199,7 +189,7 @@:disabled="!valueChanged"@click.prevent="updateEnvironment">- Update+ {{ $t('common.update') }}</button></div></div>diff --git a/frontend/src/components/EnvironmentTable.vue b/frontend/src/components/EnvironmentTable.vueindex 6ab4bf58f8..f6f193a904 100644--- a/frontend/src/components/EnvironmentTable.vue+++ b/frontend/src/components/EnvironmentTable.vue@@ -29,21 +29,7 @@ import { PropType } from "vue";import { useRouter } from "vue-router";import { Environment } from "../types";import { environmentSlug } from "../utils";--const COLUMN_LIST = [- {- title: "ID",- },- {- title: "Name",- },- {- title: "Created",- },- {- title: "Updated",- },-];+import { useI18n } from "vue-i18n";export default {name: "EnvironmentTable",@@ -56,6 +42,23 @@ export default {setup(props) {const router = useRouter();+ const { t } = useI18n();++ const COLUMN_LIST = [+ {+ title: t('common.id'),+ },+ {+ title: t('common.name'),+ },+ {+ title: t('common.created-at'),+ },+ {+ title: t('common.updated-at'),+ },+ ];+const clickEnvironment = function (section: number, row: number) {const environment = props.environmentList[row];router.push(`/environment/${environmentSlug(environment)}`);diff --git a/frontend/src/components/QuickActionPanel.vue b/frontend/src/components/QuickActionPanel.vueindex a157681d91..602280953b 100644--- a/frontend/src/components/QuickActionPanel.vue+++ b/frontend/src/components/QuickActionPanel.vue@@ -117,7 +117,7 @@<heroicons-outline:plus-sm class="w-6 h-6" /></button><h3 class="mt-1 text-center text-base font-normal text-main">- Add Environment+ {{ $t('environment.create') }}</h3></div>@@ -132,7 +132,7 @@<heroicons-outline:selector class="transform rotate-90 w-6 h-6" /></button><h3 class="mt-1 text-center text-base font-normal text-main">- Reorder+ {{ $t('common.reorder') }}</h3></div>diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.ymlindex 404516d853..4888096da6 100644--- a/frontend/src/locales/en.yml+++ b/frontend/src/locales/en.yml@@ -30,11 +30,17 @@ common:owner: Switch to Ownerdeveloper: Switch to Developerassignee: Assignee+ revert: Revert+ apply: Apply+ reorder: Reorder+ id: ID+ name: Namecreator: Creatorversion: Versionissue: Issueduration: Durationcreated-at: Created+ updated-at: Updatedcommit: Commitstatement: Statementsnapshot: Snapshot@@ -59,11 +65,13 @@ banner:demo-intro-readonly: This is a demo version of Bytebase in read-only mode.action: Deploy yours in 5 secondsintro:- content: Bytebase is for DBAs and Developers to collaborate on database schemas- changes. One can construct a single pipeline to propagate the schema- change across multiple environments. One can also store the schemas in- VCS and trigger a new pipeline upon commit push. Follow the {quickstart} on the bottom left to get- familiar with the product. If you encounter problems, visit {doc} or report {issue} on GitHub.+ content: >-+ Bytebase is for DBAs and Developers to collaborate on database schemas+ changes. One can construct a single pipeline to propagate the schema change+ across multiple environments. One can also store the schemas in VCS and+ trigger a new pipeline upon commit push. Follow the {quickstart} on the+ bottom left to get familiar with the product. If you encounter problems,+ visit {doc} or report {issue} on GitHub.quickstart: Quickstartdoc: docissue: issue@@ -91,11 +99,11 @@ 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"- tip: If your team use a separate SQL console such as phpMyAdmin, you can- provide its URL pattern here. Once provided, Bytebase will surface the- console link on the relevant database and table UI.+ 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 can+ provide its URL pattern here. Once provided, Bytebase will surface the+ console link on the relevant database and table UI.tip-link: Detailed guidemembers:active: Active members@@ -161,6 +169,11 @@ instance:select: Select instanceenvironment:select: Select environment+ archive: Archive this environment+ archive-info: >-+ Archived environment will not be shown on the normal interface. You can+ still restore later from the Archive page.+ create: Create Environmentquick-start:bookmark-an-issue: Bookmark an issueadd-a-comment: Add a comment@@ -172,6 +185,26 @@ quick-start:notice:title: Quickstart guide dismisseddesc: You can still bring it back later from the top right menu+policy:+ approval:+ name: Approval Policy+ info: >-+ For updating schema on the existing database, this setting controls+ whether the task requires manual approval.+ manual: Require manual approval+ manual-info: >-+ Pending schema migration task will only be executed after it's manually+ approved.+ auto: Skip manual approval+ auto-info: Pending schema migration task will be executed automatically.+ backup:+ name: Database backup schedule policy+ not-enforced: Not enforced+ not-enforced-info: No backup schedule is enforced.+ daily: Daily backup+ daily-info: Enforce every database to backup daily.+ weekly: Weekly backup+ weekly-info: Enforce every database to backup weekly.migration-history:self: Migration Historyworkflow: Workflowdiff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.ymlindex 4cb26ef4e3..1b626f9e10 100644--- a/frontend/src/locales/zh-CN.yml+++ b/frontend/src/locales/zh-CN.yml@@ -30,11 +30,17 @@ common:owner: 切换到所有者developer: 切换到开发者assignee: 审核人+ revert: 恢复+ apply: 应用+ reorder: 排序+ id: ID+ name: 名称creator: 创建人version: 版本issue: 工单duration: 时长created-at: 创建于+ updated-at: 更新于commit: 提交statement: 语句snapshot: 快照@@ -59,7 +65,10 @@ banner:demo-intro-readonly: 这是 Bytebase 的只读演示版本action: 5 秒部署你自己的服务intro:- content: Bytebase 是为 DBA 和开发人员在数据库表结构 (schema) 变更上进行协作而设计的。用户可以通过一个 pipeline,来推进 schema 在多个环境中的变化。同时用户也可以把 schema 保存在 VCS 中 ,再由新的 schema 文件提交来触发 pipeline。请通过左下角的{quickstart}来熟悉该产品。如果遇到问题,请访问{doc}或在 GitHub 上报告{issue}。+ content: >-+ Bytebase 是为 DBA 和开发人员在数据库表结构 (schema) 变更上进行协作而设计的。用户可以通过一个 pipeline,来推进+ schema 在多个环境中的变化。同时用户也可以把 schema 保存在 VCS 中 ,再由新的 schema 文件提交来触发+ pipeline。请通过左下角的{quickstart}来熟悉该产品。如果遇到问题,请访问{doc}或在 GitHub 上报告{issue}。doc: 文档issue: 工单bbkit:@@ -86,8 +95,10 @@ settings:plan: (升级到团队方案来开启角色管理)workspace:url-section: SQL Console URL- url-tip: "提示: 用 {schema} 作为真实数据库名称的占位符"- tip: 如果你的团队使用一个单独的 SQL 控制台,如 phpMyAdmin,那么可以在这里提供它的 URL 模板,Bytebase 就可以将控制台链接到相关的数据库和表的界面上。+ url-tip: '提示: 用 {schema} 作为真实数据库名称的占位符'+ tip: >-+ 如果你的团队使用一个单独的 SQL 控制台,如 phpMyAdmin,那么可以在这里提供它的 URL 模板,Bytebase+ 就可以将控制台链接到相关的数据库和表的界面上。tip-link: 详细指引members:active: 已激活@@ -144,6 +155,9 @@ instance:select: 选择实例environment:select: 选择环境+ archive: 归档此环境+ archive-info: 已归档环境不会显示。您可以从归档界面恢复。+ create: 创建环境quick-start:bookmark-an-issue: 收藏工单add-a-comment: 添加评论@@ -155,6 +169,22 @@ quick-start:notice:title: 快速入门导览已关闭desc: 您稍后仍可以从右上角的菜单中再次打开快速入门导览+policy:+ approval:+ name: 审批策略+ info: 要更改数据库 schema,该选项控制了是否需要手动审批。+ manual: 需要人工审批+ manual-info: 进行中的 schema 改动任务只有被人工审批后才会执行。+ auto: 无需审批+ auto-info: 进行中的任务无需审核并且会被自动执行。+ backup:+ name: 数据库备份策略+ not-enforced: 无策略+ not-enforced-info: 无备份策略。+ daily: 每日+ daily-info: 每日备份数据库。+ weekly: 每周+ weekly-info: 每周备份数据库。migration-history:self: 迁移历史workflow: 工作流@@ -173,4 +203,3 @@ migration-history:establish-baseline-description: >-Bytebase 将用当前的 schema 作为新的基线。你应该检查当前的基线确实反映了期望的状态。对于 VCS 工作流来说,也只有在建立起基线的前提下,才能进行数据库变更。-diff --git a/frontend/src/views/EnvironmentDashboard.vue b/frontend/src/views/EnvironmentDashboard.vueindex ecba48ab0f..b6c0b14a6a 100644--- a/frontend/src/views/EnvironmentDashboard.vue+++ b/frontend/src/views/EnvironmentDashboard.vue@@ -18,7 +18,7 @@class="btn-normal py-2 px-4"@click.prevent="discardReorder">- Cancel+ {{ $t('common.cancel') }}</button><buttontype="submit"@@ -26,7 +26,7 @@:disabled="!orderChanged"@click.prevent="doReorder">- Apply Change+ {{ $t('common.apply') }}</button></div><EnvironmentDetail@@ -39,7 +39,7 @@</div><BBModalv-if="state.showCreateModal"- :title="'Create Environment'"+ :title="$t('environment.create')"@close="state.showCreateModal = false"><EnvironmentForm