Skip to content

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

feat: i18n for QuickActionPanel component (#166)

Yunwei Xiao1938167996fe
diff --git a/frontend/src/components/QuickActionPanel.vue b/frontend/src/components/QuickActionPanel.vue
index 602280953b..b34864dfdb 100644
--- a/frontend/src/components/QuickActionPanel.vue
+++ b/frontend/src/components/QuickActionPanel.vue
@@ -11,7 +11,7 @@
<heroicons-outline:plus-sm class="w-6 h-6" />
</button>
<h3 class="mt-1 text-base font-normal text-main tracking-tight">
- Add Instance
+ {{ $t("quick-action.add-instance") }}
</h3>
</div>
@@ -25,7 +25,7 @@
<h3
class="mt-1 text-center text-base font-normal text-main tracking-tight"
>
- Manage User
+ {{ $t("quick-action.manage-user") }}
</h3>
</div>
@@ -39,7 +39,7 @@
<h3
class="mt-1 text-center text-base font-normal text-main tracking-tight"
>
- Query
+ {{ $t("common.query") }}
</h3>
</div>
@@ -53,7 +53,7 @@
<h3
class="mt-1 text-center text-base font-normal text-main tracking-tight"
>
- Edit Data
+ {{ $t("quick-action.edit-data") }}
</h3>
</div>
@@ -67,7 +67,7 @@
<h3
class="mt-1 text-base text-center font-normal text-main tracking-tight"
>
- New DB
+ {{ $t("quick-action.new-db") }}
</h3>
</div>
@@ -81,7 +81,7 @@
<h3
class="mt-1 text-base text-center font-normal text-main tracking-tight"
>
- Request DB
+ {{ $t("quick-action.request-db") }}
</h3>
</div>
@@ -93,7 +93,7 @@
<heroicons-outline:pencil-alt class="w-6 h-6" />
</button>
<h3 class="mt-1 text-center text-base font-normal text-main">
- Alter Schema
+ {{ $t("quick-action.alter-schema") }}
</h3>
</div>
@@ -105,7 +105,7 @@
<heroicons-outline:hand class="w-6 h-6" />
</router-link>
<h3 class="mt-1 text-center text-base font-normal text-main">
- Troubleshoot
+ {{ $t("quick-action.troubleshoot") }}
</h3>
</div>
@@ -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">
- {{ $t('environment.create') }}
+ {{ $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">
- {{ $t('common.reorder') }}
+ {{ $t("common.reorder") }}
</h3>
</div>
@@ -144,7 +144,7 @@
<heroicons-outline:template class="w-6 h-6" />
</button>
<h3 class="mt-1 text-center text-base font-normal text-main">
- New Project
+ {{ $t("quick-action.new-project") }}
</h3>
</div>
@@ -156,7 +156,7 @@
<heroicons-outline:cube class="w-6 h-6" />
</button>
<h3 class="mt-1 text-center text-base font-normal text-main">
- Default Project
+ {{ $t("quick-action.default-project") }}
</h3>
</div>
@@ -168,7 +168,7 @@
<heroicons-outline:chevron-double-down class="w-6 h-6" />
</button>
<h3 class="mt-1 text-center text-base font-normal text-main">
- Transfer in DB
+ {{ $t("quick-action.transfer-in-db") }}
</h3>
</div>
</template>
@@ -285,7 +285,7 @@ export default defineComponent({
});
const createProject = () => {
- state.modalTitle = "Create project";
+ state.modalTitle = t("quick-action.create-project");
state.modalSubtitle = "";
state.quickActionType = "quickaction.bb.project.create";
state.showModal = true;
@@ -301,28 +301,28 @@ export default defineComponent({
};
const transferDatabase = () => {
- state.modalTitle = "Transfer in database from other projects";
+ state.modalTitle = t("quick-action.transfer-in-db-title");
state.modalSubtitle = "";
state.quickActionType = "quickaction.bb.project.database.transfer";
state.showModal = true;
};
const createInstance = () => {
- state.modalTitle = "Create instance";
+ state.modalTitle = t("quick-action.create-instance");
state.modalSubtitle = "";
state.quickActionType = "quickaction.bb.instance.create";
state.showModal = true;
};
const alterSchema = () => {
- state.modalTitle = t('quick-action.alter-schema');
- state.modalSubtitle = t('quick-action.choose-db');
+ state.modalTitle = t("quick-action.alter-schema");
+ state.modalSubtitle = t("quick-action.choose-db");
state.quickActionType = "quickaction.bb.database.schema.update";
state.showModal = true;
};
const createDatabase = () => {
- state.modalTitle = t('quick-action.create-db');;
+ state.modalTitle = t("quick-action.create-db");
state.modalSubtitle = "";
state.quickActionType = "quickaction.bb.database.create";
state.showModal = true;
@@ -345,47 +345,47 @@ export default defineComponent({
const QuickActionMap: Record<string, Partial<Action>> = {
"quickaction.bb.instance.create": {
- name: "Add Instance",
+ name: t("quick-action.add-instance"),
perform: () => createInstance(),
},
"quickaction.bb.user.manage": {
- name: "Manage User",
+ name: t("quick-action.manage-user"),
perform: () => router.push({ name: "setting.workspace.member" }),
},
"quickaction.bb.database.create": {
- name: "New DB",
+ name: t("quick-action.new-db"),
perform: () => createDatabase(),
},
"quickaction.bb.database.request": {
- name: "Request DB",
+ name: t("quick-action.request-db"),
perform: () => requestDatabase(),
},
"quickaction.bb.database.schema.update": {
- name: "Alter Schema",
+ name: t("quick-action.alter-schema"),
perform: () => alterSchema(),
},
"quickaction.bb.database.troubleshoot": {
- name: "Troubleshoot",
+ name: t("quick-action.troubleshoot"),
perform: () => router.push({ path: "/issue/new" }),
},
"quickaction.bb.environment.create": {
- name: "Add Environment",
+ name: t("quick-action.add-environment"),
perform: () => createEnvironment(),
},
"quickaction.bb.environment.reorder": {
- name: "Reorder",
+ name: t("common.reorder"),
perform: () => reorderEnvironment(),
},
"quickaction.bb.project.create": {
- name: "New Project",
+ name: t("quick-action.new-project"),
perform: () => createProject(),
},
"quickaction.bb.project.default": {
- name: "Default Project",
+ name: t("quick-action.default-project"),
perform: () => goDefaultProject(),
},
"quickaction.bb.project.database.transfer": {
- name: "Transfer in DB",
+ name: t("quick-action.transfer-in-db"),
perform: () => transferDatabase(),
},
};
diff --git a/frontend/src/components/TransferDatabaseForm.vue b/frontend/src/components/TransferDatabaseForm.vue
index 09ce5a2bd0..e6ca7d9a7f 100644
--- a/frontend/src/components/TransferDatabaseForm.vue
+++ b/frontend/src/components/TransferDatabaseForm.vue
@@ -2,8 +2,7 @@
<div class="px-4 space-y-6 w-208">
<div v-if="projectId != DEFAULT_PROJECT_ID" class="textlabel">
<div v-if="state.transferSource == 'DEFAULT'" class="textinfolabel mb-2">
- Bytebase periodically syncs the instance schema. Newly synced databases
- are first placed in this default project.
+ {{ $t("quick-action.transfer-in-db-hint") }}
</div>
<div class="radio-set-row">
<div class="flex flex-row">
@@ -15,7 +14,9 @@
class="btn"
value="DEFAULT"
/>
- <label class="label"> From Default project </label>
+ <label class="label">
+ {{ $t("quick-action.from-default-project") }}
+ </label>
</div>
</div>
<div class="radio">
@@ -26,7 +27,9 @@
class="btn"
value="OTHER"
/>
- <label class="label"> From other projects </label>
+ <label class="label">
+ {{ $t("quick-action.from-other-projects") }}
+ </label>
</div>
</div>
</div>
@@ -46,15 +49,19 @@
class="btn-normal py-2 px-4"
@click.prevent="cancel"
>
- Cancel
+ {{ $t("common.cancel") }}
</button>
</div>
<BBAlert
v-if="state.showModal"
:style="'INFO'"
- :ok-text="'Transfer'"
- :title="`Are you sure to transfer '${selectedDatabaseName}' into our project?`"
+ :ok-text="$t('common.transfer')"
+ :title="
+ $t('quick-action.transfer-in-db-alert', {
+ dbName: selectedDatabaseName,
+ })
+ "
@ok="
() => {
state.showModal = false;
diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.yml
index ac26a1ca6c..136db7657f 100644
--- a/frontend/src/locales/en.yml
+++ b/frontend/src/locales/en.yml
@@ -3,11 +3,16 @@ common:
cancel: Cancel
home: Home
settings: Settings
+ project: Project
projects: Projects
help: Help
+ database: Database
databases: Databases
+ instance: Instance
instances: Instances
+ environment: Environment
environments: Environments
+ bookmark: Bookmark
bookmarks: Bookmarks
quick-action: Quick Action
archive: Archive
@@ -44,6 +49,10 @@ common:
commit: Commit
statement: Statement
snapshot: Snapshot
+ new: New
+ add: Add
+ query: Query
+ transfer: Transfer
error-page:
go-back-home: Go back home
anomaly-center: Anomaly Center
@@ -99,7 +108,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 can
provide its URL pattern here. Once provided, Bytebase will surface the
@@ -152,12 +161,33 @@ alter-schema:
skip that environment. This allows you to compose a single pipeline to
propagate schema changes across multiple environments.
quick-action:
- alter-schema: Alter schema
+ alter-schema: Alter Schema
create-db: Create database
choose-db: Choose database
+ new-db: New DB
+ add-instance: "@:common.add @:common.instance"
+ create-instance: "@:common.create @:common.instance"
+ manage-user: Manage User
+ default-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"
+ edit-data: Edit Data
+ troubleshoot: Troubleshoot
+ transfer-in-db: Transfer in DB
+ request-db: Request DB
+ from-default-project: From Default project
+ from-other-projects: From other projects
+ transfer-in-db-title: Transfer in database from other projects
+ transfer-in-db-hint: >-
+ Bytebase periodically syncs the instance schema. Newly synced databases are
+ first placed in this default project.
+ 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: Encoding
character-set: Character set
@@ -177,10 +207,10 @@ environment:
quick-start:
bookmark-an-issue: Bookmark an issue
add-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 member
notice:
title: Quickstart guide dismissed
diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.yml
index ca45779ba4..7aac3a26c0 100644
--- a/frontend/src/locales/zh-CN.yml
+++ b/frontend/src/locales/zh-CN.yml
@@ -3,11 +3,16 @@ common:
cancel: 取消
home: 主页
settings: 设置
+ project: 项目
projects: 项目
help: 帮助
+ database: 数据库
databases: 数据库
+ instance: 实例
instances: 实例
+ environment: 环境
environments: 环境
+ bookmark: 书签
bookmarks: 书签
quick-action: 快捷操作
archive: 归档
@@ -44,6 +49,10 @@ common:
commit: 提交
statement: 语句
snapshot: 快照
+ new: 创建
+ add: 添加
+ query: 查询
+ transfer: 转移
error-page:
go-back-home: 回到主页
anomaly-center: 异常中心
@@ -71,6 +80,7 @@ intro:
pipeline。请通过左下角的{quickstart}来熟悉该产品。如果遇到问题,请访问{doc}或在 GitHub 上报告{issue}。
doc: 文档
issue: 工单
+ quickstart: 快速入门
bbkit:
alert:
ok: 确认
@@ -95,7 +105,7 @@ settings:
plan: (升级到团队方案来开启角色管理)
workspace:
url-section: SQL Console URL
- url-tip: '提示: 用 {schema} 作为真实数据库名称的占位符'
+ url-tip: "提示: 用 {schema} 作为真实数据库名称的占位符"
tip: >-
如果你的团队使用一个单独的 SQL 控制台,如 phpMyAdmin,那么可以在这里提供它的 URL 模板,Bytebase
就可以将控制台链接到相关的数据库和表的界面上。
@@ -141,9 +151,27 @@ quick-action:
alter-schema: 变更 Schema
create-db: 创建数据库
choose-db: 选择数据库
+ new-db: 创建数据库
+ 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"
+ edit-data: 编辑数据
+ troubleshoot: 问题排查
+ transfer-in-db: 转移数据库
+ request-db: 申请数据库
+ from-default-project: 从默认项目
+ from-other-projects: 从其他项目
+ transfer-in-db-title: 从其他项目转移数据库
+ transfer-in-db-hint: Bytebase 会定期同步实例的 Schema。新同步的数据库会放在默认项目中。
+ transfer-in-db-alert: 您确定要转移 "{ dbName }" 到我们的项目中吗?
create-db:
new-database-name: 新数据库名称
- reserved-db-error: '{databaseName} 是一个预留名称'
+ reserved-db-error: "{databaseName} 是一个预留名称"
db:
encoding: 字符编码
character-set: 字符集
@@ -161,10 +189,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: 快速入门导览已关闭
@@ -188,13 +216,12 @@ policy:
migration-history:
self: 迁移历史
workflow: 工作流
- commit-info: '由 {author} 于 {time}'
+ commit-info: 由 {author} 于 {time}
no-schema-change: 本次迁移没有任何 Schema 的改动
show-diff: 显示差异
left-vs-right: 之前 (左) vs 当前版本 (右)
schema-snapshot-after-migration: 完成这次迁移后的 schema 快照
- list-limit: >-
- 对于有迁移历史的数据库,我们会在下面最多列出5条记录。您可以点击数据库名称去进一步查看全部的记录。
+ list-limit: 对于有迁移历史的数据库,我们会在下面最多列出5条记录。您可以点击数据库名称去进一步查看全部的记录。
no-history-in-project: 这个项目下没有发现任何数据库有迁移历史。
recording-info: 每当数据库 schema 变更时,我们便会记录下迁移历史。
establish-baseline: 建立新的基线