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: localization for plan features (#541)
ecmadao4095aabc72d7
diff --git a/frontend/src/components/PricingTable.vue b/frontend/src/components/PricingTable.vueindex ad4b22f3eb..ee303378cb 100644--- a/frontend/src/components/PricingTable.vue+++ b/frontend/src/components/PricingTable.vue@@ -18,9 +18,11 @@<div class="flex-1"><img :src="plan.image" class="hidden lg:block p-5" /><h3 class="text-2xl font-semibold text-gray-900">- {{ plan.title }}+ {{ $t(`subscription.plan.${plan.title}.title`) }}</h3>- <p class="text-gray-500 mb-10">{{ plan.description }}</p>+ <p class="text-gray-500 mb-10 h-12">+ {{ $t(`subscription.plan.${plan.title}.desc`) }}+ </p><p class="mt-4 flex items-baseline text-gray-900"><span class="text-4xl">@@ -35,8 +37,17 @@]"><div>- Instances<br />- ${{ instancePricePerMonth }}/instance/month+ {{+ $t(+ "subscription.feature-sections.database-management.features.instance-count"+ )+ }}+ <br />+ {{+ $t("subscription.instance-price", {+ price: instancePricePerMonth,+ })+ }}</div><Counterclass="ml-auto"@@ -70,7 +81,7 @@colspan="4"scope="colgroup">- {{ section.id }}+ {{ $t(`subscription.feature-sections.${section.id}.title`) }}</th></tr><tr@@ -82,14 +93,18 @@class="py-5 px-6 text-sm font-normal text-gray-500 text-left"scope="row">- {{ feature }}+ {{+ $t(+ `subscription.feature-sections.${section.id}.features.${feature}`+ )+ }}</th><td v-for="plan in plans" :key="plan.type" class="py-5 px-6"><template v-if="getFeature(plan, feature)"><spanv-if="getFeature(plan, feature)?.content"class="block text-sm text-gray-700"- >{{ getFeature(plan, feature)?.content }}</span+ >{{ $t(getFeature(plan, feature)?.content) }}</span><heroicons-solid:check v-else class="w-5 h-5 text-green-500" /></template>@@ -110,7 +125,11 @@target="_blank"class="block w-full py-4 bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900">- Buy {{ plan.title }} Plan+ {{+ $t("subscription.buy", {+ plan: $t(`subscription.plan.${plan.title}.title`),+ })+ }}</a></td></tr>@@ -130,6 +149,7 @@ import {TEAM_PLAN,ENTERPRISE_PLAN,} from "../types";+import { useI18n } from "vue-i18n";interface LocalState {isMonthly: boolean;@@ -157,6 +177,7 @@ export default {},},setup(props) {+ const { t } = useI18n();const state = reactive<LocalState>({isMonthly: false,instanceCount: props.subscription?.instanceCount ?? minimumInstanceCount,@@ -190,8 +211,8 @@ export default {).href,price:plan.type === PlanType.ENTERPRISE- ? "Contact us"- : `$${getPlanPrice(plan)}/year`,+ ? t("subscription.contact-us")+ : t("subscription.price", { price: getPlanPrice(plan) }),buttonText: getButtonText(plan),highlight: plan.type === PlanType.TEAM,isFreePlan: plan.type === PlanType.FREE,@@ -203,13 +224,18 @@ export default {};const getButtonText = (plan: Plan): string => {- if (plan.type === PlanType.FREE) return "Deploy";- if (plan.type === PlanType.ENTERPRISE) return "Contact us";- if (plan.type === props.subscription?.plan) return "Current plan";+ if (plan.type === PlanType.FREE) return t("subscription.deploy");+ if (plan.type === PlanType.ENTERPRISE)+ return t("subscription.contact-us");+ if (plan.type === props.subscription?.plan)+ return t("subscription.current-plan");if (plan.trialDays && plan.trialPrice) {- return `Start trial with $${plan.trialPrice} for ${plan.trialDays} days`;+ return t("subscription.start-trial", {+ price: plan.trialPrice,+ days: plan.trialDays,+ });}- return "Subscribe now";+ return t("subscription.subscribe");};const onButtonClick = (plan: Plan) => {diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.ymlindex d3705fa82d..83446f3a80 100644--- a/frontend/src/locales/en.yml+++ b/frontend/src/locales/en.yml@@ -1066,11 +1066,6 @@ datasource:connection-name-string-copied-to-clipboard: '{0} string copied to clipboard.'jdbc-cant-connect-to-socket-database-value-instance-host: 'JDBC can''t connect to socket {0} 'setting:- plan:- self: Plan- free: Free- team: Team- enterprise: Enterpriselabel:key: Keyvalues: Values@@ -1142,6 +1137,14 @@ subscription:trial: You can start a trial with $7 for 7 days.trial-comment: Only enabled for the first payment. You can cancel the subscription at any time.upgrade: Upgrade subscription+ price: ${price}/year+ instance-price: ${price}/instance/month+ deploy: Deploy+ contact-us: Contact us+ start-trial: Start trial with ${price} for {days} days+ subscribe: Subscribe now+ current-plan: Current plan+ buy: Buy {plan} planfeatures:bb-feature-task-schedule-time:name: Set task schedule time@@ -1171,3 +1174,47 @@ subscription:bb-feature-schema-drift:title: Schema driftdesc: "@:{'subscription.upgrade'} to unlock schema dirft auto-detection"+ feature-sections:+ database-management:+ title: Database Management+ features:+ instance-count: Instance count+ instance-upto-5: Up to 5+ instance-customized: Customized+ schema-change: Schema change+ migration-history: Migration history+ sql-editor: SQL Editor+ database-backup-restore: Database backup/restore+ archiving: Archiving+ sql-check: SQL check+ sql-check-basic: Basic+ sql-check-advanced: Advanced (e.g. Backward compatibility check)+ anomaly-detection: Anomaly detection+ anomaly-detection-basic: Basic+ anomaly-detection-advanced: Advanced (e.g. Drift detection)+ review-and-backup-policy: Review and backup policy+ tenancy: Multi-Region / Multi-Tenancy+ collaboration:+ title: Collaboration+ features:+ ui-based-sql-review: UI based SQL review+ gitops-workflow: GitOps workflow+ sql-review-commenting: SQL review commenting+ im-integration: IM integration+ inbox-notification: Inbox notification+ admin-and-security:+ title: Admin & Security+ features:+ activity-log: Activity Log+ rbac: RBAC+ plan:+ title: Plan+ free:+ title: Free+ desc: Personal project or small team, no DBA+ team:+ title: Team+ desc: Medium size team, has dedicated DBA or TL with management needs+ enterprise:+ title: Enterprise+ desc: Large organization, has dedicated DBA groupdiff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.ymlindex 91c8d9ba8f..c218064b09 100644--- a/frontend/src/locales/zh-CN.yml+++ b/frontend/src/locales/zh-CN.yml@@ -937,11 +937,6 @@ datasource:connection-name-string-copied-to-clipboard: '{0} 字符串已复制到剪贴板。'jdbc-cant-connect-to-socket-database-value-instance-host: 'JDBC 无法连接到 socket {0} 'setting:- plan:- self: 版本- free: 免费版- team: 团队版- enterprise: 企业版label:key: Keyvalues: 值@@ -1011,6 +1006,14 @@ subscription:trial: 您可以以 $7 的价格试用 7 天trial-comment: 仅首次付费可以试用,可随时退款。upgrade: 升级订阅+ price: ${price}/年+ instance-price: ${price}/实例/月+ deploy: 部署+ contact-us: 联系我们+ start-trial: 以 {days} 天 {price} 美元的价格试用+ subscribe: 开始订阅+ current-plan: 当前订阅+ buy: 购买{plan}features:bb-feature-task-schedule-time:title: 设定任务执行时间@@ -1040,3 +1043,47 @@ subscription:bb-feature-schema-drift:title: Schema 偏差desc: "@:{'subscription.upgrade'}来解锁 schema 偏差异常的自动检测。"+ feature-sections:+ database-management:+ title: 数据库管理+ features:+ instance-count: 实例数+ instance-upto-5: 不多于 5 个+ instance-customized: 自定义+ schema-change: Schema 变更+ migration-history: 迁移历史+ sql-editor: SQL 编辑器+ database-backup-restore: 数据库备份和恢复+ archiving: 归档+ sql-check: SQL 检查+ sql-check-basic: 基础+ sql-check-advanced: 高级 (例如向后兼容性检查)+ anomaly-detection: 异常检测+ anomaly-detection-basic: 基础+ anomaly-detection-advanced: 高级 (例如 Schema 偏差检测)+ review-and-backup-policy: 审核和备份策略+ tenancy: 多地域/多租户+ collaboration:+ title: 团队协作+ features:+ ui-based-sql-review: 基于 UI 的 SQL 审查+ gitops-workflow: GitOps 工作流+ sql-review-commenting: SQL 审核中的批注+ im-integration: IM 集成+ inbox-notification: 站内信通知+ admin-and-security:+ title: 管理与安全+ features:+ activity-log: 活动日志+ rbac: RBAC 权限管理+ plan:+ title: 版本+ free:+ title: 免费版+ desc: 个人或小团队,无专职 DBA+ team:+ title: 团队版+ desc: 中型团队,有专职 DBA 或者 TL 有管控需求+ enterprise:+ title: 企业版+ desc: 大型组织,有专属 DBA 团队diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.tsindex 9194693eee..41dccb00de 100644--- a/frontend/src/types/plan.ts+++ b/frontend/src/types/plan.ts@@ -34,7 +34,6 @@ export interface Plan {pricePerInstancePerMonth: number;// Plan desc and featuretitle: string;- description: string;features: { id: string; content?: string }[];}@@ -61,33 +60,33 @@ export const FEATURE_MATRIX: Map<FeatureType, boolean[]> = new Map([export const FEATURE_SECTIONS = [{- id: "Database Management",+ id: "database-management",features: [- "Instance",- "Schema change",- "Migration history",- "SQL Editor",- "Database backup/restore",- "Archiving",- "SQL check",- "Anomaly detection",- "Review and backup policy",- "Multi-Region / Multi-Tenancy",+ "instance-count",+ "schema-change",+ "migration-history",+ "sql-editor",+ "database-backup-restore",+ "archiving",+ "sql-check",+ "anomaly-detection",+ "review-and-backup-policy",+ "tenancy",],},{- id: "Collaboration",+ id: "collaboration",features: [- "UI based SQL review",- "GitOps workflow",- "SQL review commenting",- "IM integration",- "Inbox notification",+ "ui-based-sql-review",+ "gitops-workflow",+ "sql-review-commenting",+ "im-integration",+ "inbox-notification",],},{- id: "Admin & Security",- features: ["Activity Log", "RBAC"],+ id: "admin-and-security",+ features: ["activity-log", "rbac"],},];@@ -100,24 +99,34 @@ export const FREE_PLAN: Plan = {freeInstanceCount: 1,pricePerInstancePerMonth: 0,// Plan desc and feature- title: "Free",- description: "The essentials to provide your best work for clients.",+ title: "free",features: [- { id: "Instance", content: "1" },- { id: "Schema change" },- { id: "Migration history" },- { id: "SQL Editor" },- { id: "Database backup/restore" },- { id: "Archiving" },- { id: "SQL check", content: "Basic" },- { id: "Anomaly detection", content: "Basic" },- { id: "UI based SQL review" },- { id: "GitOps workflow" },- { id: "SQL review commenting" },- { id: "IM integration" },- { id: "Inbox notification" },- { id: "Activity Log" },- { id: "UI based SQL review" },+ {+ id: "instance-count",+ content:+ "subscription.feature-sections.database-management.features.instance-upto-5",+ },+ { id: "schema-change" },+ { id: "migration-history" },+ { id: "sql-editor" },+ { id: "database-backup-restore" },+ { id: "archiving" },+ {+ id: "sql-check",+ content:+ "subscription.feature-sections.database-management.features.sql-check-basic",+ },+ {+ id: "anomaly-detection",+ content:+ "subscription.feature-sections.database-management.features.anomaly-detection-basic",+ },+ { id: "ui-based-sql-review" },+ { id: "gitops-workflow" },+ { id: "sql-review-commenting" },+ { id: "im-integration" },+ { id: "inbox-notification" },+ { id: "activity-log" },],};@@ -130,28 +139,36 @@ export const TEAM_PLAN: Plan = {freeInstanceCount: 5,pricePerInstancePerMonth: 29,// Plan desc and feature- title: "Team",- description: "A plan that scales with your rapidly growing business.",+ title: "team",features: [- { id: "Instance", content: "5" },- { id: "Schema change" },- { id: "Migration history" },- { id: "SQL Editor" },- { id: "Database backup/restore" },- { id: "Archiving" },{- id: "SQL check",- content: "Advanced (e.g. Backward compatibility check)",+ id: "instance-count",+ content:+ "subscription.feature-sections.database-management.features.instance-customized",+ },+ { id: "schema-change" },+ { id: "migration-history" },+ { id: "sql-editor" },+ { id: "database-backup-restore" },+ { id: "archiving" },+ {+ id: "sql-check",+ content:+ "subscription.feature-sections.database-management.features.sql-check-advanced",+ },+ {+ id: "anomaly-detection",+ content:+ "subscription.feature-sections.database-management.features.anomaly-detection-advanced",},- { id: "Anomaly detection", content: "Advanced (e.g. Drift detection)" },- { id: "Review and backup policy" },- { id: "UI based SQL review" },- { id: "GitOps workflow" },- { id: "SQL review commenting" },- { id: "IM integration" },- { id: "Inbox notification" },- { id: "Activity Log" },- { id: "RBAC" },+ { id: "review-and-backup-policy" },+ { id: "ui-based-sql-review" },+ { id: "gitops-workflow" },+ { id: "sql-review-commenting" },+ { id: "im-integration" },+ { id: "inbox-notification" },+ { id: "activity-log" },+ { id: "rbac" },],};@@ -164,28 +181,36 @@ export const ENTERPRISE_PLAN: Plan = {freeInstanceCount: 5,pricePerInstancePerMonth: 29,// Plan desc and feature- title: "Enterprise",- description: "Dedicated support and infrastructure for your company.",+ title: "enterprise",features: [- { id: "Instance", content: "Customized" },- { id: "Schema change" },- { id: "Migration history" },- { id: "SQL Editor" },- { id: "Database backup/restore" },- { id: "Archiving" },{- id: "SQL check",- content: "Advanced (e.g. Backward compatibility check)",+ id: "instance-count",+ content:+ "subscription.feature-sections.database-management.features.instance-customized",+ },+ { id: "schema-change" },+ { id: "migration-history" },+ { id: "sql-editor" },+ { id: "database-backup-restore" },+ { id: "archiving" },+ {+ id: "sql-check",+ content:+ "subscription.feature-sections.database-management.features.sql-check-advanced",+ },+ {+ id: "anomaly-detection",+ content:+ "subscription.feature-sections.database-management.features.anomaly-detection-advanced",},- { id: "Anomaly detection", content: "Advanced (e.g. Drift detection)" },- { id: "Review and backup policy" },- { id: "Multi-Region / Multi-Tenancy" },- { id: "UI based SQL review" },- { id: "GitOps workflow" },- { id: "SQL review commenting" },- { id: "IM integration" },- { id: "Inbox notification" },- { id: "Activity Log" },- { id: "RBAC" },+ { id: "review-and-backup-policy" },+ { id: "tenancy" },+ { id: "ui-based-sql-review" },+ { id: "gitops-workflow" },+ { id: "sql-review-commenting" },+ { id: "im-integration" },+ { id: "inbox-notification" },+ { id: "activity-log" },+ { id: "rbac" },],};diff --git a/frontend/src/views/DashboardHeader.vue b/frontend/src/views/DashboardHeader.vueindex 04ee7a77d4..fc08358c7c 100644--- a/frontend/src/views/DashboardHeader.vue+++ b/frontend/src/views/DashboardHeader.vue@@ -51,21 +51,21 @@class="hidden md:flex sm:flex-row items-center space-x-2 text-sm font-medium"><span class="hidden lg:block font-normal text-accent">- {{ $t("setting.plan.self") }}+ {{ $t("subscription.plan.title") }}</span><divclass="bar-link":class="currentPlan == 0 ? 'underline' : ''"@click.prevent="switchToFree">- {{ $t("setting.plan.free") }}+ {{ $t("subscription.plan.free.title") }}</div><divclass="bar-link":class="currentPlan == 1 ? 'underline' : ''"@click.prevent="switchToTeam">- {{ $t("setting.plan.team") }}+ {{ $t("subscription.plan.team.title") }}</div></div><divdiff --git a/frontend/src/views/SettingWorkspaceSubscription.vue b/frontend/src/views/SettingWorkspaceSubscription.vueindex 8205d3b86a..5c5ac90cde 100644--- a/frontend/src/views/SettingWorkspaceSubscription.vue+++ b/frontend/src/views/SettingWorkspaceSubscription.vue@@ -121,11 +121,11 @@ export default {const plan = store.getters["subscription/currentPlan"]();switch (plan) {case PlanType.TEAM:- return t("setting.plan.team");+ return t("subscription.plan.team.title");case PlanType.ENTERPRISE:- return t("setting.plan.enterprise");+ return t("subscription.plan.enterprise.title");default:- return t("setting.plan.free");+ return t("subscription.plan.free.title");}});