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 settings module (#140)
ecmadao018852e5bb12
diff --git a/frontend/src/bbkit/BBAlert.vue b/frontend/src/bbkit/BBAlert.vueindex 4824219140..8c01bd10c8 100644--- a/frontend/src/bbkit/BBAlert.vue+++ b/frontend/src/bbkit/BBAlert.vue@@ -145,7 +145,7 @@text-gray-900">- {{ title }}+ {{ $t(title) }}</h3></div><div@@ -154,7 +154,7 @@><div class="mt-2"><p class="text-gray-500 whitespace-pre-wrap">- {{ description }}+ {{ $t(description) }}</p></div></div>@@ -171,7 +171,7 @@:disabled="inProgress"@click.prevent="cancel">- {{ cancelText }}+ {{ $t(cancelText) }}</button><buttontype="button"@@ -199,7 +199,7 @@:disabled="inProgress"@click.prevent="$emit('ok', payload)">- {{ okText }}+ {{ $t(okText) }}</button></div></div>@@ -229,11 +229,11 @@ export default {},okText: {type: String,- default: "OK",+ default: "bbkit.alert.ok",},cancelText: {type: String,- default: "Cancel",+ default: "bbkit.alert.cancel",},inProgress: {type: Boolean,diff --git a/frontend/src/components/MemberAddOrInvite.vue b/frontend/src/components/MemberAddOrInvite.vueindex 8f13a6c301..9fbc228062 100644--- a/frontend/src/components/MemberAddOrInvite.vue+++ b/frontend/src/components/MemberAddOrInvite.vue@@ -7,7 +7,7 @@class="flex justify-between py-0.5 select-none"><p id="add_or_invite_members_helper" class="sr-only">- Add or invite by email address+ {{ $t("settings.members.helper") }}</p><div class="flex flex-row space-x-4"><div class="flex-grow">@@ -54,7 +54,7 @@class="btn"value="OWNER"/>- <label class="label"> Owner </label>+ <label class="label"> {{ $t("common.role.owner") }} </label></div><div class="radio"><input@@ -65,7 +65,7 @@class="btn"value="DBA"/>- <label class="label"> DBA </label>+ <label class="label"> {{ $t("common.role.dba") }} </label></div><div class="radio"><input@@ -76,7 +76,7 @@class="btn"value="DEVELOPER"/>- <label class="label"> Developer </label>+ <label class="label"> {{ $t("common.role.developer") }} </label></div></div></div>@@ -86,7 +86,7 @@<div class="flex justify-between"><span class="flex items-center"><button type="button" class="btn-secondary" @click.prevent="addUser">- + Add More+ {{ $t("settings.members.add-more") }}</button></span>@@ -98,7 +98,7 @@><heroicons-solid:plus v-if="isAdd" class="h-5 w-5" /><heroicons-outline:mail v-else class="mr-2 h-5 w-5" />- {{ isAdd ? "Add" : "Send Invites" }}+ {{ $t(`settings.members.${isAdd ? "add" : "invites"}`) }}</button></div></div>diff --git a/frontend/src/components/MemberSelect.vue b/frontend/src/components/MemberSelect.vueindex 5e844fa1f6..2b5fffbbf6 100644--- a/frontend/src/components/MemberSelect.vue+++ b/frontend/src/components/MemberSelect.vue@@ -29,7 +29,7 @@<!-- Add my-0.5 padding to avoid flickering when switching to assignee --><span class="flex my-0.5 lg:40 xl:w-44"><span class="truncate" :class="required ? 'text-error' : ''">{{- placeholder+ $t(placeholder)}}</span></span></template>@@ -70,7 +70,7 @@ export default {type: Array as PropType<RoleType[]>,},placeholder: {- default: "Not assigned",+ default: "settings.members.not-assigned",type: String,},required: {diff --git a/frontend/src/components/MemberTable.vue b/frontend/src/components/MemberTable.vueindex dd13f48e62..f533aec0f2 100644--- a/frontend/src/components/MemberTable.vue+++ b/frontend/src/components/MemberTable.vue@@ -11,16 +11,16 @@<BBTableHeaderCell:left-padding="4"class="w-auto table-cell"- :title="COLUMN_LIST[0].title"+ :title="$t(COLUMN_LIST[0].title)"/>- <BBTableHeaderCell class="w-8 table-cell" :title="COLUMN_LIST[1].title" />+ <BBTableHeaderCell class="w-8 table-cell" :title="$t(COLUMN_LIST[1].title)" /><BBTableHeaderCellclass="w-72 table-cell"- :title="COLUMN_LIST[2].title"+ :title="$t(COLUMN_LIST[2].title)"/><BBTableHeaderCellclass="w-auto table-cell"- :title="COLUMN_LIST[3].title"+ :title="$t(COLUMN_LIST[3].title)"/></template><template #body="{ rowData: member }">@@ -40,7 +40,7 @@text-main-text">- Invited+ {{ $t("settings.members.invited") }}</span><span class="textlabel">{{ member.principal.email }}@@ -69,7 +69,7 @@text-green-800">- You+ {{ $t("settings.members.yourself") }}</span></div><span class="textlabel">@@ -109,17 +109,17 @@v-if="allowDeactivateMember(member)":style="'ARCHIVE'":require-confirm="true"- :ok-text="'Deactivate'"- :confirm-title="`Are you sure to deactivate '${member.principal.name}'`"- :confirm-description="'You can still reactivate later'"+ :ok-text="$t('settings.members.action.deactivate')"+ :confirm-title="`${$t('settings.members.action.deactivate-confirm-title')} '${member.principal.name}'?`"+ :confirm-description="$t('settings.members.action.deactivate-confirm-description')"@confirm="changeRowStatus(member.id, 'ARCHIVED')"/><BBButtonConfirmv-else-if="allowActivateMember(member)":style="'RESTORE'":require-confirm="true"- :ok-text="'Reactivate'"- :confirm-title="`Are you sure to reactivate '${member.principal.name}'`"+ :ok-text="$t('settings.members.action.reactivate')"+ :confirm-title="`${$t('settings.members.action.reactivate-confirm-title')} '${member.principal.name}'?`":confirm-description="''"@confirm="changeRowStatus(member.id, 'NORMAL')"/>@@ -130,7 +130,7 @@<div class="flex flex-row items-center space-x-1"><heroicons-solid:sparkles class="w-6 h-6 text-accent" /><router-link to="/setting/plan" class="text-lg accent-link"- >Upgrade to unlock Owner and DBA roles</router-link+ >{{ $t("settings.members.upgrade") }}</router-link></div><img class="w-full" src="../assets/role_management_screenshot.png" />@@ -140,6 +140,7 @@<script lang="ts">import { computed, PropType, reactive } from "vue";import { useStore } from "vuex";+import { useI18n } from "vue-i18n";import RoleSelect from "../components/RoleSelect.vue";import PrincipalAvatar from "../components/PrincipalAvatar.vue";import { MemberId, RoleType, MemberPatch, Member, RowStatus } from "../types";@@ -148,13 +149,13 @@ import { isOwner } from "../utils";const COLUMN_LIST: BBTableColumn[] = [{- title: "Account",+ title: "settings.members.table.account",},{- title: "Role",+ title: "settings.members.table.role",},{- title: "Updated Time",+ title: "settings.members.table.update-time",},{title: "",@@ -174,6 +175,7 @@ export default {},},setup(props) {+ const { t } = useI18n();const store = useStore();const currentUser = computed(() => store.getters["auth/currentUser"]());@@ -204,17 +206,17 @@ export default {const dataSource: BBTableSectionDataSource<Member>[] = [];dataSource.push({- title: "Owner",+ title: t("common.role.owner"),list: ownerList,});dataSource.push({- title: "DBA",+ title: t("common.role.dba"),list: dbaList,});dataSource.push({- title: "Developer",+ title: t("common.role.developer"),list: developerList,});@@ -240,14 +242,14 @@ export default {}if (!hasAdminFeature.value) {- return "Upgrade to Team plan to enable role management";+ return t("settings.members.tooltip.upgrade");}if (!allowEdit.value) {- return "Only Owner can change the role";+ return t("settings.members.tooltip.not-allow-edit");}- return "Can not remove the last Owner";+ return t("settings.members.tooltip.not-allow-remove");};const allowDeactivateMember = (member: Member) => {diff --git a/frontend/src/components/ProfileDropdown.vue b/frontend/src/components/ProfileDropdown.vueindex 9a8ec1cc65..85a08c9b2d 100644--- a/frontend/src/components/ProfileDropdown.vue+++ b/frontend/src/components/ProfileDropdown.vue@@ -28,12 +28,12 @@<div v-if="!isRelease" class="md:hidden py-1"><div v-if="currentUser.role != 'OWNER'" class="py-1"><a class="menu-item" role="menuitem" @click.prevent="switchToOwner">- Switch to Owner+ {{ $t("common.role-switch.owner") }}</a></div><div v-if="currentUser.role != 'DBA'" class="py-1"><a class="menu-item" role="menuitem" @click.prevent="switchToDBA">- Switch to DBA+ {{ $t("common.role-switch.dba") }}</a></div><div v-if="currentUser.email != 'DEVELOPER'" class="py-1">@@ -42,7 +42,7 @@role="menuitem"@click.prevent="switchToDeveloper">- Switch to Developer+ {{ $t("common.role-switch.developer") }}</a></div></div>diff --git a/frontend/src/components/RoleSelect.vue b/frontend/src/components/RoleSelect.vueindex bf6d73c285..44f0b738e9 100644--- a/frontend/src/components/RoleSelect.vue+++ b/frontend/src/components/RoleSelect.vue@@ -2,15 +2,13 @@<BBSelect:selected-item="selectedRole":item-list="['OWNER', 'DBA', 'DEVELOPER']"- :placeholder="'Select role'"+ :placeholder="$t('settings.members.select-role')":disabled="disabled"@select-item="(role) => $emit('change-role', role)"><template #menuItem="{ item }">{{- item == "DBA"- ? item- : item.charAt(0).toUpperCase() + item.toLowerCase().slice(1)+ $t(`common.role.${item.toLowerCase()}`)}}</template></BBSelect>diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.ymlindex 604b513cca..d84414e9b8 100644--- a/frontend/src/locales/en.yml+++ b/frontend/src/locales/en.yml@@ -1,5 +1,6 @@common:save: Save+ cancel: Cancelhome: Homesettings: Settingsprojects: Projects@@ -12,6 +13,17 @@ common:archive: Archivequickstart: Quickstartlogout: Logout+ back: Back+ edit: Edit+ update: Update+ role:+ dba: DBA+ owner: Owner+ developer: Developer+ role-switch:+ dba: Switch to DBA+ owner: Switch to Owner+ developer: Switch to Developererror-page:go-back-home: Go back homeanomaly-center: Anomaly Center@@ -28,6 +40,62 @@ kbar:preferences:common: Preferenceschange-language: Change Language…+bbkit:+ alert:+ ok: OK+ cancel: Cancel+settings:+ sidebar:+ account: Account+ profile: Profile+ workspace: Workspace+ general: General+ members: Members+ version-control: Version Control+ plans: Plans+ profile:+ email: Email+ role: Role+ password: Password+ password-placeholder: sensitive - write only+ password-confirm: Confirm+ password-confirm-placeholder: Confirm new password+ password-mismatch: mismatch+ plan: (Upgrade to Team plan to enable role management)+ workspace:+ url-section: SQL Console URL+ url-tip: "Tip: Use %s 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 guide+ members:+ active: Active members+ inactive: Inactive members+ helper: Add or invite by email address+ add-more: + Add more+ add: Add+ invites: Send Invites+ invited: Invited+ yourself: You+ upgrade: Upgrade to unlock Owner and DBA roles+ select-role: Select role+ not-assigned: Not assigned+ table:+ account: Account+ role: Role+ update-time: Updated Time+ action:+ deactivate: Deactivate+ deactivate-confirm-title: Are you sure to deactivate+ deactivate-confirm-description: You can still reactivate later+ reactivate: Reactivate+ reactivate-confirm-title: Are you sure to reactivate+ tooltip:+ upgrade: Upgrade to Team plan to enable role management+ not-allow-edit: Only Owner can change the role+ not-allow-remove: Can not remove the last Owneractivity:name: Namecomment: Commentdiff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.ymlindex 283a4c0d89..3372f042a7 100644--- a/frontend/src/locales/zh-CN.yml+++ b/frontend/src/locales/zh-CN.yml@@ -1,5 +1,6 @@common:save: 保存+ cancel: 取消home: 主页settings: 设置projects: 项目@@ -12,6 +13,17 @@ common:archive: 归档quickstart: 快速入门logout: 登出+ back: 返回+ edit: 编辑+ update: 更新+ role:+ dba: DBA+ owner: 所有者+ developer: 开发者+ role-switch:+ dba: 切换到 DBA+ owner: 切换到所有者+ developer: 切换到开发者error-page:go-back-home: 回到主页anomaly-center: 异常中心@@ -28,6 +40,59 @@ kbar:preferences:common: 偏好设置change-language: 更改语言…+bbkit:+ alert:+ ok: 确认+ cancel: 取消+settings:+ sidebar:+ account: 账户+ profile: 个人信息+ workspace: 工作空间+ general: 通用+ members: 成员+ version-control: 版本控制+ plans: 价格方案+ profile:+ email: 邮箱+ role: 角色+ password: 密码+ password-placeholder: 敏感数据 - 仅写入+ password-confirm: 确认密码+ password-confirm-placeholder: 再次输入以确认+ password-mismatch: 密码输入不一致+ plan: (升级到团队方案来开启角色管理)+ workspace:+ url-section: SQL Console URL+ url-tip: "提示: 用 %s 作为真实数据库名称的占位符"+ tip: 如果你的团队使用一个单独的 SQL 控制台,如 phpMyAdmin,那么可以在这里提供它的 URL 模板,Bytebase 就可以将控制台链接到相关的数据库和表的界面上。+ tip-link: 详细指引+ members:+ active: 已激活+ inactive: 未激活+ helper: 通过邮箱添加或邀请成员+ add-more: + 增加成员+ add: 添加+ invites: 发送邀请+ invited: 已邀请+ yourself: 你自己+ upgrade: 升级付费方案来解锁其他角色+ select-role: 选择角色+ not-assigned: 未指定+ table:+ account: 账户+ role: 角色+ update-time: 更新时间+ action:+ deactivate: 禁用+ deactivate-confirm-title: 确定禁用+ deactivate-confirm-description: 之后可以重新启用+ reactivate: 启用+ reactivate-confirm-title: 确定启用+ tooltip:+ upgrade: 升级到团队版来开启成员管理+ not-allow-edit: 只有所有者才能改变角色+ not-allow-remove: 不能移除最后一个所有者activity:name: 名称comment: 注释diff --git a/frontend/src/views/ProfileDashboard.vue b/frontend/src/views/ProfileDashboard.vueindex aa5c2f1eab..27fb5bd777 100644--- a/frontend/src/views/ProfileDashboard.vue+++ b/frontend/src/views/ProfileDashboard.vue@@ -37,7 +37,7 @@class="btn-normal"@click.prevent="cancelEdit">- Cancel+ {{ $t("common.cancel") }}</button><buttontype="button"@@ -49,7 +49,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><button@@ -62,7 +62,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>@@ -96,26 +96,26 @@><dl class="grid grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2"><div class="sm:col-span-1">- <dt class="text-sm font-medium text-control-light">Role</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("settings.profile.role") }}+ </dt><dd class="mt-1 text-sm text-main"><router-link:to="'/setting/member'"class="normal-link capitalize">- {{- principal.role == "DBA"- ? principal.role- : principal.role.toLowerCase()- }}+ {{ $t(`common.role.${principal.role.toLowerCase()}`) }}</router-link><router-link :to="'/setting/plan'" class="normal-link">- (Upgrade to Team plan to enable role management)+ {{ $t("settings.profile.plan") }}</router-link></dd></div><div class="sm:col-span-1">- <dt class="text-sm font-medium text-control-light">Email</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("settings.profile.email") }}+ </dt><dd class="mt-1 text-sm text-main">{{ principal.email }}</dd>@@ -123,7 +123,9 @@<template v-if="state.editing"><div class="sm:col-span-1">- <dt class="text-sm font-medium text-control-light">Password</dt>+ <dt class="text-sm font-medium text-control-light">+ {{ $t("settings.profile.password") }}+ </dt><dd class="mt-1 text-sm text-main"><inputid="password"@@ -131,7 +133,7 @@type="text"class="textfield mt-1 w-full"autocomplete="off"- placeholder="sensitive - write only"+ :placeholder="$t('settings.profile.password-placeholder')":value="state.editingPrincipal.password"@input="updatePrincipal('password', $event.target.value)"/>@@ -140,8 +142,10 @@<div class="sm:col-span-1"><dt class="text-sm font-medium text-control-light">- Confirm- <span v-if="passwordMismatch" class="text-error">mismatch</span>+ {{ $t("settings.profile.password-confirm") }}+ <span v-if="passwordMismatch" class="text-error">+ {{ $t("settings.profile.password-mismatch") }}+ </span></dt><dd class="mt-1 text-sm text-main"><input@@ -150,7 +154,7 @@type="text"class="textfield mt-1 w-full"autocomplete="off"- placeholder="Confirm new password"+ :placeholder="$t('settings.profile.password-confirm-placeholder')":value="state.passwordConfirm"@input="state.passwordConfirm = $event.target.value"/>diff --git a/frontend/src/views/SettingSidebar.vue b/frontend/src/views/SettingSidebar.vueindex c4a5e64d15..3021af8fa3 100644--- a/frontend/src/views/SettingSidebar.vue+++ b/frontend/src/views/SettingSidebar.vue@@ -21,7 +21,7 @@<heroicons-outline:chevron-leftclass="mr-1 h-6 w-6 text-gray-500 group-hover:text-gray-500 group-focus:text-gray-600"/>- Back+ {{ $t("common.back") }}</button><div class="mt-8">@@ -40,14 +40,14 @@"><heroicons-solid:user-circle class="mr-3 w-5 h-5" />- Account+ {{ $t("settings.sidebar.account") }}</div><div class="space-y-1"><router-linkto="/setting/profile"class="outline-item group w-full flex items-center pl-11 pr-2 py-2">- Profile+ {{ $t("settings.sidebar.profile") }}</router-link></div></div>@@ -67,14 +67,14 @@"><heroicons-solid:office-building class="mr-3 w-5 h-5" />- Workspace+ {{ $t("settings.sidebar.workspace") }}</div><div class="space-y-1"><router-linkto="/setting/general"class="outline-item group w-full flex items-center pl-11 pr-2 py-2">- General+ {{ $t("settings.sidebar.general") }}</router-link><!-- <router-linkto="/setting/agent"@@ -86,21 +86,21 @@to="/setting/member"class="outline-item group w-full flex items-center pl-11 pr-2 py-2">- Members+ {{ $t("settings.sidebar.members") }}</router-link><router-linkv-if="showOwnerItem"to="/setting/version-control"class="outline-item group w-full flex items-center pl-11 pr-2 py-2">- Version Control+ {{ $t("settings.sidebar.version-control") }}</router-link><router-linkv-if="false"to="/setting/plan"class="outline-item group w-full flex items-center pl-11 pr-2 py-2">- Plans+ {{ $t("settings.sidebar.plans") }}</router-link><!-- <router-linkto="/setting/billing"diff --git a/frontend/src/views/SettingWorkspaceGeneral.vue b/frontend/src/views/SettingWorkspaceGeneral.vueindex 1751a46d7f..71524881f5 100644--- a/frontend/src/views/SettingWorkspaceGeneral.vue+++ b/frontend/src/views/SettingWorkspaceGeneral.vue@@ -1,18 +1,18 @@<template><div class="mt-2 space-y-6 divide-y divide-block-border"><div>- <h3 class="text-lg leading-6 font-medium text-main">SQL Console URL</h3>+ <h3 class="text-lg leading-6 font-medium text-main">+ {{ $t("settings.workspace.url-section") }}+ </h3><p class="mt-1 textinfolabel">- 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+ {{ $t("settings.workspace.tip") }}<ahref="https://docs.bytebase.com/settings/external-sql-console"target="_blank"class="normal-link">- detailed guide</a- >.+ {{ $t("settings.workspace.tip-link") }}+ </a></p><div class="mt-4">@@ -26,8 +26,7 @@:disabled="!allowEdit"/><div for="databaseUrl" class="mt-2 textinfolabel">- Tip: Use {{ DB_NAME_PLACEHOLDER }} as the placeholder for the actual- database name+ {{ $t("settings.workspace.url-tip").replace('%s', placeholder) }}</div></div></div>@@ -39,7 +38,7 @@:disabled="!allowSave"@click.prevent="doSave">- Update+ {{ $t("common.update") }}</button></div></div>@@ -59,6 +58,9 @@ interface LocalState {export default {name: "SettingWorkspaceGeneral",+ data() {+ return { placeholder: "{{ DB_NAME_PLACEHOLDER }}"}+ },setup() {const store = useStore();diff --git a/frontend/src/views/SettingWorkspaceMember.vue b/frontend/src/views/SettingWorkspaceMember.vueindex de42a2ebc7..c52244e477 100644--- a/frontend/src/views/SettingWorkspaceMember.vue+++ b/frontend/src/views/SettingWorkspaceMember.vue@@ -3,11 +3,13 @@<MemberAddOrInvite /></div><div>- <p class="text-lg font-medium leading-7 text-main">Active members</p>+ <p class="text-lg font-medium leading-7 text-main">+ {{ $t("settings.members.active") }}+ </p><MemberTable :member-list="activeMemberList" /><div v-if="inactiveMemberList.length > 0" class="mt-8"><p class="text-lg font-medium leading-7 text-control-light">- Inactive members+ {{ $t("settings.members.inactive") }}</p><MemberTable :member-list="inactiveMemberList" /></div>