Skip to content

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

chore: update i18n (#10879)

ecmadao547bf39da09b
diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml
index 2375d79ac8..6ae64c7ee8 100644
--- a/.github/workflows/frontend-tests.yml
+++ b/.github/workflows/frontend-tests.yml
@@ -45,12 +45,14 @@ jobs:
cache-dependency-path: "frontend/pnpm-lock.yaml"
- run: pnpm install --frozen-lockfile
working-directory: frontend
+ - name: Copy config files
+ run: |
+ cp ../backend/plugin/advisor/config/* ./src/types
+ cp ../backend/enterprise/api/plan.yaml ./src/types
+ working-directory: frontend
- name: Run pnpm test
run: pnpm test
working-directory: frontend
- name: Run pnpm release build
- run: |
- cp ../backend/plugin/advisor/config/* ./src/types
- cp ../backend/enterprise/api/plan.yaml ./src/types
- pnpm release-docker
+ run: pnpm release-docker
working-directory: frontend
diff --git a/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceOperations.vue b/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceOperations.vue
index 04c9262e97..cc26ca8485 100644
--- a/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceOperations.vue
+++ b/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceOperations.vue
@@ -96,11 +96,6 @@ const actions = computed((): Action[] => {
});
const syncSchema = async () => {
- pushNotification({
- module: "bytebase",
- style: "INFO",
- title: t("db.start-to-sync-schema"),
- });
try {
state.loading = true;
await instanceStore.batchSyncInstance(
@@ -108,8 +103,8 @@ const syncSchema = async () => {
);
pushNotification({
module: "bytebase",
- style: "SUCCESS",
- title: t("db.successfully-synced-schema"),
+ style: "INFO",
+ title: t("db.start-to-sync-schema"),
});
} catch {
pushNotification({
diff --git a/frontend/src/plugins/i18n.test.ts b/frontend/src/plugins/i18n.test.ts
index 8b989e426b..2664eacc8b 100644
--- a/frontend/src/plugins/i18n.test.ts
+++ b/frontend/src/plugins/i18n.test.ts
@@ -1,4 +1,7 @@
import { describe, expect, test } from "vitest";
+import { engineToJSON } from "@/types/proto/v1/common";
+import { sQLReviewRuleLevelToJSON } from "@/types/proto/v1/org_policy_service";
+import { TEMPLATE_LIST, getRuleLocalizationKey } from "../types/sqlReview";
import { mergedLocalMessage } from "./i18n-messages";
describe("Test i18n messages", () => {
@@ -24,6 +27,49 @@ describe("Test i18n messages", () => {
}
});
+describe("Test i18n for SQL review", () => {
+ expect(Object.keys(mergedLocalMessage).length).greaterThan(0);
+ const i18nMessage = Object.values(mergedLocalMessage)[0];
+ expect(!!i18nMessage["sql-review"]).toBe(true);
+
+ const i18nForSQLReview = i18nMessage["sql-review"];
+ expect(!!i18nForSQLReview["template"]).toBe(true);
+ expect(!!i18nForSQLReview["rule"]).toBe(true);
+ expect(!!i18nForSQLReview["engine"]).toBe(true);
+ expect(!!i18nForSQLReview["category"]).toBe(true);
+
+ for (const template of TEMPLATE_LIST) {
+ describe(`check i18n for template ${template.id}`, () => {
+ const key = `${template.id.split(".").join("-")}`;
+ expect(!!i18nForSQLReview["template"][key]).toBe(true);
+ expect(!!i18nForSQLReview["template"][`${key}-desc`]).toBe(true);
+
+ for (const rule of template.ruleList) {
+ test(`check i18n for rule ${rule.type}`, () => {
+ const key = getRuleLocalizationKey(rule.type);
+ expect(!!i18nForSQLReview["rule"][key]).toBe(true);
+ expect(!!i18nForSQLReview["rule"][key]["title"]).toBe(true);
+ expect(!!i18nForSQLReview["rule"][key]["description"]).toBe(true);
+ expect(
+ !!i18nForSQLReview["category"][rule.category.toLowerCase()]
+ ).toBe(true);
+ expect(
+ !!i18nForSQLReview["level"][
+ sQLReviewRuleLevelToJSON(rule.level).toLowerCase()
+ ]
+ ).toBe(true);
+
+ for (const engine of rule.engineList) {
+ expect(
+ !!i18nForSQLReview["engine"][engineToJSON(engine).toLowerCase()]
+ ).toBe(true);
+ }
+ });
+ }
+ });
+ }
+});
+
const compareMessages = (
localA: { [k: string]: any },
localB: { [k: string]: any }