Skip to content

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

fix: i18n for rules (#11079)

ecmadaoeaaa7c8f5e62
diff --git a/frontend/src/locales/sql-review/en-US.json b/frontend/src/locales/sql-review/en-US.json
index 2d7b181493..862d281ca1 100644
--- a/frontend/src/locales/sql-review/en-US.json
+++ b/frontend/src/locales/sql-review/en-US.json
@@ -67,7 +67,12 @@
},
"table-text-fields-total-length": {
"title": "Restrict the total length of text fields in a table",
- "description": "This rule limits the amount of data a table can hold, preventing excessive storage usage."
+ "description": "This rule limits the amount of data a table can hold, preventing excessive storage usage.",
+ "component": {
+ "number": {
+ "title": "Maximum length"
+ }
+ }
},
"table-disallow-set-charset": {
"title": "Prohibit defining character set in table properties",
@@ -409,11 +414,21 @@
},
"statement-where-statement-query-minimum-plan-level": {
"title": "Restrict the maximum level of query access method",
- "description": "SQL performance optimization strives for constant (const) access, aiming for reference (ref) level as a baseline, with acceptable performance at range level."
+ "description": "SQL performance optimization strives for constant (const) access, aiming for reference (ref) level as a baseline, with acceptable performance at range level.",
+ "component": {
+ "level": {
+ "title": "Maximum level"
+ }
+ }
},
"statement-where-maximum-logical-operator-count": {
"title": "Restrict the number of values in the IN or OR clause of the WHERE clause",
- "description": "This prevents performance degradation due to extensive comparisons and resource limitations."
+ "description": "This prevents performance degradation due to extensive comparisons and resource limitations.",
+ "component": {
+ "number": {
+ "title": "Maximum count"
+ }
+ }
},
"statement-maximum-limit-value": {
"title": "Restrict the maximum number of the LIMIT clause",
diff --git a/frontend/src/locales/sql-review/es-ES.json b/frontend/src/locales/sql-review/es-ES.json
index b5ff04679c..39990da52f 100644
--- a/frontend/src/locales/sql-review/es-ES.json
+++ b/frontend/src/locales/sql-review/es-ES.json
@@ -67,7 +67,12 @@
},
"table-text-fields-total-length": {
"title": "Limitar la longitud total de los campos de texto en una tabla",
- "description": "Esta regla limita la cantidad de datos que una tabla puede almacenar, evitando un uso excesivo de almacenamiento."
+ "description": "Esta regla limita la cantidad de datos que una tabla puede almacenar, evitando un uso excesivo de almacenamiento.",
+ "component": {
+ "number": {
+ "title": "Longitud máxima"
+ }
+ }
},
"table-disallow-set-charset": {
"title": "Prohibir la definición del juego de caracteres en las propiedades de la tabla",
@@ -409,11 +414,21 @@
},
"statement-where-statement-query-minimum-plan-level": {
"title": "Limitar el nivel máximo del método de acceso a la consulta",
- "description": "La optimización del rendimiento de SQL busca un acceso constante (const), con el nivel de referencia (ref) como base, y un rendimiento aceptable a nivel de rango."
+ "description": "La optimización del rendimiento de SQL busca un acceso constante (const), con el nivel de referencia (ref) como base, y un rendimiento aceptable a nivel de rango.",
+ "component": {
+ "level": {
+ "title": "Nivel maximo"
+ }
+ }
},
"statement-where-maximum-logical-operator-count": {
"title": "Limitar el número de valores en las cláusulas IN u OR dentro de la cláusula WHERE",
- "description": "Esto evita la degradación del rendimiento debido a comparaciones exhaustivas y limitaciones de recursos."
+ "description": "Esto evita la degradación del rendimiento debido a comparaciones exhaustivas y limitaciones de recursos.",
+ "component": {
+ "number": {
+ "title": "Número máximo"
+ }
+ }
},
"statement-maximum-limit-value": {
"title": "Limitar el número máximo de la cláusula LIMIT",
diff --git a/frontend/src/locales/sql-review/ja-JP.json b/frontend/src/locales/sql-review/ja-JP.json
index a93805b754..0a44cd4cc3 100644
--- a/frontend/src/locales/sql-review/ja-JP.json
+++ b/frontend/src/locales/sql-review/ja-JP.json
@@ -67,7 +67,12 @@
},
"table-text-fields-total-length": {
"title": "テキスト入力欄の文字数を制限する",
- "description": "このルールは、テーブルが保持できるデータ量を制限し、過剰なストレージ使用を防ぎます。"
+ "description": "このルールは、テーブルが保持できるデータ量を制限し、過剰なストレージ使用を防ぎます。",
+ "component": {
+ "number": {
+ "title": "最大長さ"
+ }
+ }
},
"table-disallow-set-charset": {
"title": "テーブルプロパティでの文字セットの定義を禁止する",
@@ -409,11 +414,21 @@
},
"statement-where-statement-query-minimum-plan-level": {
"title": "クエリ アクセス メソッドの最大レベルを制限する",
- "description": "SQL パフォーマンス最適化は、定数時間 (じょうすうじかん) アクセスを目指すもので、基準として参照 (さんしょう) レベルを置き、許容範囲として範囲 (はんい) レベルのパフォーマンスを想定します。"
+ "description": "SQL パフォーマンス最適化は、定数時間 (じょうすうじかん) アクセスを目指すもので、基準として参照 (さんしょう) レベルを置き、許容範囲として範囲 (はんい) レベルのパフォーマンスを想定します。",
+ "component": {
+ "level": {
+ "title": "最大レベル"
+ }
+ }
},
"statement-where-maximum-logical-operator-count": {
"title": "WHERE 句の IN または OR 句の値数を制限する",
- "description": "このアプローチは、広範な比較とリソースの制限によるパフォーマンスの低下を防ぎます。"
+ "description": "このアプローチは、広範な比較とリソースの制限によるパフォーマンスの低下を防ぎます。",
+ "component": {
+ "number": {
+ "title": "最大値"
+ }
+ }
},
"statement-maximum-limit-value": {
"title": "リミット節の上限値を制限する",
diff --git a/frontend/src/locales/sql-review/vi-VN.json b/frontend/src/locales/sql-review/vi-VN.json
index 42b52bf3dc..a8f7dcfc4d 100644
--- a/frontend/src/locales/sql-review/vi-VN.json
+++ b/frontend/src/locales/sql-review/vi-VN.json
@@ -67,7 +67,12 @@
},
"table-text-fields-total-length": {
"title": "Giới hạn độ dài tối đa của trường văn bản trong bảng",
- "description": "Luật này giới hạn dung lượng dữ liệu mà một bảng có thể chứa, giúp ngăn chặn việc sử dụng dung lượng lưu trữ quá mức."
+ "description": "Luật này giới hạn dung lượng dữ liệu mà một bảng có thể chứa, giúp ngăn chặn việc sử dụng dung lượng lưu trữ quá mức.",
+ "component": {
+ "number": {
+ "title": "Chiều dài tối đa"
+ }
+ }
},
"table-disallow-set-charset": {
"title": "Cấm thiết lập bảng mã trong thuộc tính của bảng",
@@ -409,11 +414,21 @@
},
"statement-where-statement-query-minimum-plan-level": {
"title": "Hạn chế mức truy cập tối đa của phương thức truy vấn",
- "description": "Ch tối ưu hóa hiệu suất SQL hướng đến truy cập hằng số (const), đặt mục tiêu mức tham chiếu (ref) làm tiêu chuẩn, với hiệu suất chấp nhận được ở mức phạm vi (range)."
+ "description": "Ch tối ưu hóa hiệu suất SQL hướng đến truy cập hằng số (const), đặt mục tiêu mức tham chiếu (ref) làm tiêu chuẩn, với hiệu suất chấp nhận được ở mức phạm vi (range).",
+ "component": {
+ "level": {
+ "title": "Mức tối đa"
+ }
+ }
},
"statement-where-maximum-logical-operator-count": {
"title": "Giới hạn số lượng giá trị trong mệnh đề IN hoặc OR của mệnh đề WHERE",
- "description": "Điều này giúp ngăn chặn hiệu suất suy giảm do các phép so sánh rộng rãi và hạn chế tài nguyên."
+ "description": "Điều này giúp ngăn chặn hiệu suất suy giảm do các phép so sánh rộng rãi và hạn chế tài nguyên.",
+ "component": {
+ "number": {
+ "title": "Số lớn nhất"
+ }
+ }
},
"statement-maximum-limit-value": {
"title": "Giới hạn số lượng tối đa của mệnh đề LIMIT",
diff --git a/frontend/src/locales/sql-review/zh-CN.json b/frontend/src/locales/sql-review/zh-CN.json
index 2241eb49ae..ab1ceb81c3 100644
--- a/frontend/src/locales/sql-review/zh-CN.json
+++ b/frontend/src/locales/sql-review/zh-CN.json
@@ -67,7 +67,12 @@
},
"table-text-fields-total-length": {
"title": "限制表格文本字段的总长度",
- "description": "该规则限制了表格所能容纳的数据量,防止存储空间的使用过量。"
+ "description": "该规则限制了表格所能容纳的数据量,防止存储空间的使用过量。",
+ "component": {
+ "number": {
+ "title": "最大长度"
+ }
+ }
},
"table-disallow-set-charset": {
"title": "禁止在表格属性中定义字符集",
@@ -409,11 +414,21 @@
},
"statement-where-statement-query-minimum-plan-level": {
"title": "限制查询访问方法的最大级别",
- "description": "在 SQL 性能优化中,追求常量访问速度,以引用级别作为基线,区间级别的性能尚可接受。"
+ "description": "在 SQL 性能优化中,追求常量访问速度,以引用级别作为基线,区间级别的性能尚可接受。",
+ "component": {
+ "level": {
+ "title": "最大级别"
+ }
+ }
},
"statement-where-maximum-logical-operator-count": {
"title": "限制 WHERE 子句中的 IN 或 OR 子句中的值的数量",
- "description": "这可以防止因频繁对比和资源限制导致性能下降。"
+ "description": "这可以防止因频繁对比和资源限制导致性能下降。",
+ "component": {
+ "number": {
+ "title": "最大数量"
+ }
+ }
},
"statement-maximum-limit-value": {
"title": "限制 LIMIT 子句的最大行数",
diff --git a/frontend/src/plugins/i18n.test.ts b/frontend/src/plugins/i18n.test.ts
index 2664eacc8b..44be910337 100644
--- a/frontend/src/plugins/i18n.test.ts
+++ b/frontend/src/plugins/i18n.test.ts
@@ -64,6 +64,13 @@ describe("Test i18n for SQL review", () => {
!!i18nForSQLReview["engine"][engineToJSON(engine).toLowerCase()]
).toBe(true);
}
+
+ for (const component of rule.componentList) {
+ expect(!!i18nForSQLReview["rule"][key]["component"]).toBe(true);
+ expect(
+ !!i18nForSQLReview["rule"][key]["component"][component.key]
+ ).toBe(true);
+ }
});
}
});