Skip to content

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

feat(frontend): i18n support for auth page (#158)

Luke Zhoucb08b5d47773
diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.yml
index dee84624fc..f15554b623 100644
--- a/frontend/src/locales/en.yml
+++ b/frontend/src/locales/en.yml
@@ -1,5 +1,11 @@
common:
activity: Activity
+ sign-in: Sign in
+ sign-up: Sign up
+ email: Email
+ username: Username
+ password: Password
+ activate: Activate
save: Save
cancel: Cancel
comment: 评论
@@ -322,6 +328,33 @@ quick-start:
notice:
title: Quickstart guide dismissed
desc: You can still bring it back later from the top right menu
+auth:
+ sign-up:
+ title: Register your account
+ admin-title: Setup {account}
+ admin-account: admin account
+ create-admin-account: Create admin account
+ confirm-password: Confirm Password
+ confirm-password-placeholder: Confirm password
+ password-mismatch: mismatch
+ existing-user: Already have an account?
+ sign-in:
+ title: Sign in to your account
+ admin-title: Setup {'account'}
+ admin-account: admin account
+ forget-password: Forgot your password?
+ new-user: New to Bytebase?
+ password-forget:
+ title: Forgot your password?
+ content: Please contact your Bytebase Admin to reset your password.
+ return-to-sign-in: Return to Sign in
+ password-reset:
+ title: Reset your password
+ content: Enter your email address and we will send you a password reset link
+ send-reset-link: Send reset link
+ return-to-sign-in: Return to Sign in
+ activate:
+ title: Activate your {type} account
policy:
approval:
name: Approval Policy
diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.yml
index 00fbc660c7..ba91cf9053 100644
--- a/frontend/src/locales/zh-CN.yml
+++ b/frontend/src/locales/zh-CN.yml
@@ -1,4 +1,10 @@
common:
+ sign-in: 登陆
+ sign-up: 注册
+ email: 邮箱
+ username: 用户名
+ password: 密码
+ activate: 激活
activity: 活动
save: 保存
cancel: 取消
@@ -108,7 +114,7 @@ task:
banner:
demo-intro: 这是 Bytebase 的演示版本。
demo-intro-readonly: 这是 Bytebase 的只读演示版本
- action: 5 秒部署你自己的服务
+ action: 5 秒部署您自己的服务
intro:
content: >-
Bytebase 是为 DBA 和开发人员在数据库表结构 (schema) 变更上进行协作而设计的。用户可以通过一个 pipeline,来推进
@@ -143,7 +149,7 @@ settings:
url-section: SQL Console URL
url-tip: "提示: 用 {schema} 作为真实数据库名称的占位符"
tip: >-
- 如果你的团队使用一个单独的 SQL 控制台,如 phpMyAdmin,那么可以在这里提供它的 URL 模板,Bytebase
+ 如果您的团队使用一个单独的 SQL 控制台,如 phpMyAdmin,那么可以在这里提供它的 URL 模板,Bytebase
就可以将控制台链接到相关的数据库和表的界面上。
tip-link: 详细指引
members:
@@ -154,7 +160,7 @@ settings:
add: 添加
invites: 发送邀请
invited: 已邀请
- yourself: 你自己
+ yourself: 您自己
upgrade: 升级付费方案来解锁其他角色
select-role: 选择角色
not-assigned: 未指派
@@ -249,11 +255,11 @@ issue:
stage-select:
active: "{name}(活动中)"
alter-schema:
- vcs-enabled: 该项目开启了基于 VCS 的版本管理,选择下面的数据库会将你导航到相应的 Git 仓库以创建 schema 变更。
- vcs-info: 代表项目开启了基于 VCS 的版本管理。选择该类项目下的数据库会将你导航到对应的 Git 仓库以创建 schema 变更。
+ vcs-enabled: 该项目开启了基于 VCS 的版本管理,选择下面的数据库会将您导航到相应的 Git 仓库以创建 schema 变更。
+ vcs-info: 代表项目开启了基于 VCS 的版本管理。选择该类项目下的数据库会将您导航到对应的 Git 仓库以创建 schema 变更。
alter-single-db: 变更单个数据库
alter-multiple-db: 变更多个数据库
- alter-multiple-db-info: 针对每个环境,你可以选择一个数据库进行变更或者直接跳过该环境,这样你就可以在一条流水线上把 schema 变更逐步作用到多个环境。
+ alter-multiple-db-info: 针对每个环境,您可以选择一个数据库进行变更或者直接跳过该环境,这样您就可以在一条流水线上把 schema 变更逐步作用到多个环境。
quick-action:
alter-schema: 变更 Schema
create-db: 创建数据库
@@ -304,6 +310,31 @@ quick-start:
notice:
title: 快速入门导览已关闭
desc: 您稍后仍可以从右上角的菜单中再次打开快速入门导览
+auth:
+ sign-up:
+ title: 注册您的账号
+ admin-title: 设置 {account}
+ admin-account: 管理员账号
+ create-admin-account: 注册管理员
+ confirm-password: 确认密码
+ confirm-password-placeholder: 确认您的密码
+ password-mismatch: 不匹配
+ existing-user: 已有账号?
+ sign-in:
+ title: 登陆您的账号
+ forget-password: 忘记密码?
+ new-user: 第一次使用 Bytebase?
+ password-forget:
+ title: 忘记了您的密码?
+ content: 请联系的您的 Bytebase 管理员重置密码
+ return-to-sign-in: 返回登陆
+ password-reset:
+ title: 重置您的密码
+ content: 我们会将重置密码链接发送到您的邮箱
+ send-reset-link: 发送重置链接
+ return-to-sign-in: 返回登陆
+ activate:
+ title: 激活您的 {type} 账号
policy:
approval:
name: 审批策略
@@ -335,9 +366,9 @@ migration-history:
refreshing-history: 刷新历史中 ...
config-instance: 配置实例
establish-baseline-description: >-
- Bytebase 将用当前的 schema 作为新的基线。你应该检查当前的基线确实反映了期望的状态。 对于 VCS
+ Bytebase 将用当前的 schema 作为新的基线。您应该检查当前的基线确实反映了期望的状态。 对于 VCS
工作流来说,也只有在建立起基线的前提下,才能进行数据库变更。
establish-database-baseline: 建立「{name}」基线
instance-missing-migration-schema: 实例「{name}」缺失用于记录迁移历史的 schema。
instance-bad-connection: 无法连接实例「{name}」以获取迁移历史。
- contact-dba: 请联系你的 DBA 进行配置。
+ contact-dba: 请联系您的 DBA 进行配置。
diff --git a/frontend/src/views/auth/Activate.vue b/frontend/src/views/auth/Activate.vue
index 0eaad93139..7bbc4a21ad 100644
--- a/frontend/src/views/auth/Activate.vue
+++ b/frontend/src/views/auth/Activate.vue
@@ -7,11 +7,14 @@
alt="Bytebase"
/>
<h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
- Activate your
- <span class="text-accent font-semnibold">{{
- state.role.charAt(0).toUpperCase() + state.role.slice(1).toLowerCase()
- }}</span>
- account
+ <i18n-t keypath="auth.activate.title" tag="p">
+ <template #type>
+ <span class="text-accent font-semnibold">{{
+ state.role.charAt(0).toUpperCase() +
+ state.role.slice(1).toLowerCase()
+ }}</span>
+ </template>
+ </i18n-t>
</h2>
</div>
@@ -23,7 +26,7 @@
for="email"
class="block text-sm font-medium leading-5 text-control"
>
- Email
+ {{ $t("common.email") }}
</label>
<div class="mt-2 text-base font-medium leading-5 text-accent">
{{ state.email }}
@@ -34,7 +37,8 @@
for="password"
class="block text-sm font-medium leading-5 text-control"
>
- Password<span class="text-red-600">*</span>
+ {{ $t("common.password") }}
+ <span class="text-red-600">*</span>
</label>
<div class="mt-1 rounded-md shadow-sm">
<input
@@ -43,20 +47,7 @@
type="password"
autocomplete="on"
required
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
/>
</div>
</div>
@@ -66,7 +57,7 @@
for="email"
class="block text-sm font-medium leading-5 text-control"
>
- Name
+ {{ $t("common.username") }}
</label>
<div class="mt-1 rounded-md shadow-sm">
<input
@@ -74,20 +65,7 @@
v-model="state.name"
type="text"
placeholder="Jim Gray"
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
/>
</div>
</div>
@@ -98,7 +76,7 @@
type="submit"
class="btn-success w-full flex justify-center py-2 px-4"
>
- Activate
+ {{ $t("common.activate") }}
</button>
</span>
</div>
diff --git a/frontend/src/views/auth/PasswordForgot.vue b/frontend/src/views/auth/PasswordForgot.vue
index 573e9bcd42..e5bdfbb7b4 100644
--- a/frontend/src/views/auth/PasswordForgot.vue
+++ b/frontend/src/views/auth/PasswordForgot.vue
@@ -7,14 +7,14 @@
alt="Bytebase"
/>
<h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
- Forgot your password?
+ {{ $t("auth.password-forget.title") }}
</h2>
</div>
<div class="mt-8">
<div class="mt-6">
<label class="block text-base font-medium leading-5 text-control">
- Please contact your Bytebase Admin to reset your password.
+ {{ $t("auth.password-forget.content") }}
</label>
</div>
</div>
@@ -25,7 +25,7 @@
</div>
<div class="relative flex justify-center text-sm">
<router-link to="/auth/signin" class="accent-link bg-white px-2">
- Return to Sign in
+ {{ $t("auth.password-forget.return-to-sign-in") }}
</router-link>
</div>
</div>
diff --git a/frontend/src/views/auth/PasswordReset.vue b/frontend/src/views/auth/PasswordReset.vue
index ff26bf2375..1ece3aba8c 100644
--- a/frontend/src/views/auth/PasswordReset.vue
+++ b/frontend/src/views/auth/PasswordReset.vue
@@ -7,7 +7,7 @@
alt="Bytebase"
/>
<h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
- Reset your password
+ {{ $t("auth.password-reset.title") }}
</h2>
</div>
@@ -19,8 +19,7 @@
for="email"
class="block text-base font-medium leading-5 text-control"
>
- Enter your email address and we will send you a password reset
- link
+ {{ $t("auth.password-reset.content") }}
</label>
<div class="mt-4 rounded-md shadow-sm">
<input
@@ -29,20 +28,7 @@
type="email"
required
placeholder="[email protected]"
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
/>
</div>
</div>
@@ -54,7 +40,7 @@
:disabled="!allowReset"
class="btn-primary w-full flex justify-center py-2 px-4"
>
- Send reset link
+ {{ $t("auth.password-reset.send-reset-link") }}
</button>
</span>
</div>
@@ -68,7 +54,7 @@
</div>
<div class="relative flex justify-center text-sm">
<router-link to="/auth/signin" class="accent-link bg-white px-2">
- Return to Sign in
+ {{ $t("auth.password-reset.return-to-sign-in") }}
</router-link>
</div>
</div>
diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vue
index 3e4aadab89..ae565c6d67 100644
--- a/frontend/src/views/auth/Signin.vue
+++ b/frontend/src/views/auth/Signin.vue
@@ -7,7 +7,7 @@
alt="Bytebase"
/>
<h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
- Sign in to your account
+ {{ $t("auth.sign-in.title") }}
</h2>
</div>
@@ -19,7 +19,7 @@
for="email"
class="block text-sm font-medium leading-5 text-control"
>
- Email<span class="text-red-600">*</span>
+ {{ $t("common.email") }}<span class="text-red-600">*</span>
</label>
<div class="mt-1 rounded-md shadow-sm">
<input
@@ -28,20 +28,7 @@
type="email"
required
placeholder="[email protected]"
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
/>
</div>
</div>
@@ -49,27 +36,17 @@
<div>
<label
for="password"
- class="
- flex
- justify-between
- text-sm
- font-medium
- leading-5
- text-control
- "
+ class="flex justify-between text-sm font-medium leading-5 text-control"
>
- <div>Password<span class="text-red-600">*</span></div>
+ <div>
+ {{ $t("common.password")
+ }}<span class="text-red-600">*</span>
+ </div>
<router-link
to="/auth/password-forgot"
- class="
- text-sm
- font-normal
- text-control-light
- hover:underline
- focus:outline-none
- "
+ class="text-sm font-normal text-control-light hover:underline focus:outline-none"
>
- Forgot your password?
+ {{ $t("auth.sign-in.forget-password") }}
</router-link>
</label>
<div class="mt-1 rounded-md shadow-sm">
@@ -79,20 +56,7 @@
type="password"
autocomplete="on"
required
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
/>
</div>
</div>
@@ -104,7 +68,7 @@
:disabled="!allowSignin"
class="btn-primary w-full flex justify-center py-2 px-4"
>
- Sign in
+ {{ $t("common.sign-in") }}
</button>
</span>
</div>
@@ -117,9 +81,11 @@
<div class="w-full border-t border-control-border"></div>
</div>
<div class="relative flex justify-center text-sm">
- <span class="pl-2 bg-white text-control"> New to Bytebase? </span>
+ <span class="pl-2 bg-white text-control">
+ {{ $t("auth.sign-in.new-user") }}
+ </span>
<router-link to="/auth/signup" class="accent-link bg-white px-2">
- Sign up
+ {{ $t("common.sign-up") }}
</router-link>
</div>
</div>
diff --git a/frontend/src/views/auth/Signup.vue b/frontend/src/views/auth/Signup.vue
index 1a838ec581..826e21e30f 100644
--- a/frontend/src/views/auth/Signup.vue
+++ b/frontend/src/views/auth/Signup.vue
@@ -8,10 +8,15 @@
/>
<h2 class="mt-6 text-3xl leading-9 font-extrabold text-main">
<template v-if="needAdminSetup" class="text-accent font-semnibold">
- Setup
- <span class="text-accent font-semnibold">admin account</span>
+ <i18n-t keypath="auth.sign-up.admin-title" tag="p">
+ <template #account>
+ <span class="text-accent font-semnibold">{{
+ $t("auth.sign-up.admin-account")
+ }}</span>
+ </template>
+ </i18n-t>
</template>
- <template v-else> Register your account </template>
+ <template v-else> {{ $t("auth.sign-up.title") }}</template>
</h2>
</div>
@@ -23,7 +28,7 @@
for="email"
class="block text-sm font-medium leading-5 text-control"
>
- Email <span class="text-red-600">*</span>
+ {{ $t("common.email") }} <span class="text-red-600">*</span>
</label>
<div class="mt-1 rounded-md shadow-sm">
<input
@@ -32,20 +37,7 @@
type="email"
required
placeholder="[email protected]"
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
@input="onTextEmail"
/>
</div>
@@ -56,7 +48,8 @@
for="password"
class="block text-sm font-medium leading-5 text-control"
>
- Password <span class="text-red-600">*</span>
+ {{ $t("common.password") }}
+ <span class="text-red-600">*</span>
</label>
<div class="mt-1 rounded-md shadow-sm">
<input
@@ -65,20 +58,7 @@
autocomplete="off"
:value="state.password"
required
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
@input="changePassword($event.target.value)"
/>
</div>
@@ -89,9 +69,14 @@
for="password-confirm"
class="block text-sm font-medium leading-5 text-control"
>
- Confirm Password
+ {{ $t("auth.sign-up.confirm-password") }}
<span class="text-red-600"
- >* {{ state.showPasswordMismatchError ? "mismatch" : "" }}</span
+ >*
+ {{
+ state.showPasswordMismatchError
+ ? $t("auth.sign-up.password-mismatch")
+ : ""
+ }}</span
>
</label>
<div class="mt-1 rounded-md shadow-sm">
@@ -99,23 +84,10 @@
id="password-confirm"
type="password"
autocomplete="off"
- :placeholder="'Confirm password'"
+ :placeholder="$t('auth.sign-up.confirm-password-placeholder')"
:value="state.passwordConfirm"
required
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
@input="changePasswordConfirm($event.target.value)"
/>
</div>
@@ -126,7 +98,7 @@
for="email"
class="block text-sm font-medium leading-5 text-control"
>
- Name
+ {{ $t("common.username") }}
</label>
<div class="mt-1 rounded-md shadow-sm">
<input
@@ -134,20 +106,7 @@
v-model="state.name"
type="text"
placeholder="Jim Gray"
- class="
- appearance-none
- block
- w-full
- px-3
- py-2
- border border-control-border
- rounded-md
- placeholder-control-placeholder
- focus:outline-none
- focus:shadow-outline-blue
- focus:border-control-border
- sm:text-sm sm:leading-5
- "
+ class="appearance-none block w-full px-3 py-2 border border-control-border rounded-md placeholder-control-placeholder focus:outline-none focus:shadow-outline-blue focus:border-control-border sm:text-sm sm:leading-5"
@input="onTextName"
/>
</div>
@@ -160,7 +119,11 @@
:disabled="!allowSignup"
class="btn-primary w-full flex justify-center py-2 px-4"
>
- {{ needAdminSetup ? "Create admin account" : "Register" }}
+ {{
+ needAdminSetup
+ ? $t("auth.sign-up.create-admin-account")
+ : $t("common.sign-up")
+ }}
</button>
</span>
</div>
@@ -174,10 +137,10 @@
</div>
<div class="relative flex justify-center text-sm">
<span class="pl-2 bg-white text-control">
- Already have an account?
+ {{ $t("auth.sign-up.existing-user") }}
</span>
<router-link to="/auth/signin" class="accent-link px-2 bg-white">
- Sign in
+ {{ $t("common.sign-in") }}
</router-link>
</div>
</div>