Skip to content

Commit ab96bc9

Browse files
committed
fix:Mongdb的翻译不全
1 parent 075a6a2 commit ab96bc9

File tree

3 files changed

+39
-15
lines changed

3 files changed

+39
-15
lines changed

client/packages/barda/src/comps/queries/mongoQuery.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ import { buildQueryCommand, FunctionProperty, toQueryView } from "./queryCompUti
88
import { trans } from "@barda/i18n";
99

1010
const CommandOptions = [
11-
{ label: "Find Document(s)", value: "FIND" },
12-
{ label: "Insert Document(s)", value: "INSERT" },
13-
{ label: "Update Document(s)", value: "UPDATE" },
14-
{ label: "Delete Document(s)", value: "DELETE" },
15-
{ label: "Count", value: "COUNT" },
16-
{ label: "Distinct", value: "DISTINCT" },
17-
{ label: "Aggregate", value: "AGGREGATE" },
18-
{ label: "Raw", value: "RAW" },
11+
{ label: trans("query.findDocs"), value: "FIND" },
12+
{ label: trans("query.insertDocs"), value: "INSERT" },
13+
{ label: trans("query.updateDocs"), value: "UPDATE" },
14+
{ label: trans("query.deleteDocs"), value: "DELETE" },
15+
{ label: trans("query.count"), value: "COUNT" },
16+
{ label: trans("query.distinct"), value: "DISTINCT" },
17+
{ label: trans("query.aggregate"), value: "AGGREGATE" },
18+
{ label: trans("query.raw"), value: "RAW" },
1919
] as const;
2020

2121
const LimitOptions = [
2222
{
23-
label: "Single Document",
23+
label: trans("query.sigleDoc"),
2424
value: "SINGLE",
2525
},
2626
{
27-
label: "All Matching Documents",
27+
label: trans("query.allDocs"),
2828
value: "ALL",
2929
},
3030
] as const;
@@ -61,7 +61,7 @@ const LimitInputField = withPropertyViewFn(ParamsPositiveNumberControl, (comp) =
6161
);
6262

6363
const LimitDropdownField = withPropertyViewFn(dropdownControl(LimitOptions, "SINGLE"), (comp) => (
64-
<>{comp.propertyView({ label: "Limit", placement: "bottom" })}</>
64+
<>{comp.propertyView({ label: trans("query.limit"), placement: "bottom" })}</>
6565
));
6666

6767
const CommandMap: Record<
@@ -100,7 +100,7 @@ const CommandMap: Record<
100100
INSERT: buildQueryCommand({
101101
documents: withPropertyViewFn(ParamsJsonControl, (comp) =>
102102
comp.propertyView({
103-
label: "Documents",
103+
label: trans("query.documents"),
104104
placement: "bottom",
105105
placeholder: `[{
106106
_id: 1,
@@ -115,7 +115,7 @@ const CommandMap: Record<
115115
query: QueryField,
116116
update: withPropertyViewFn(ParamsJsonControl, (comp) =>
117117
comp.propertyView({
118-
label: "Update",
118+
label: trans("query.update"),
119119
placement: "bottom",
120120
placeholder: `{
121121
$inc : {score: 1}
@@ -165,7 +165,7 @@ const CommandMap: Record<
165165
RAW: buildQueryCommand({
166166
command: withPropertyViewFn(ParamsJsonControl, (comp) =>
167167
comp.propertyView({
168-
label: "Command",
168+
label: trans("query.command"),
169169
placement: "bottom",
170170
placeholder: `[
171171
{ $project: { tags: 1 } }, { $unwind: "$tags" },

client/packages/barda/src/i18n/locales/en.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,18 @@ export const en = {
596596
sortDes: "1: ascending order; 0: descending order",
597597
upsert: "Upsert",
598598
upsertDes: "Insert a new document if no documents match the query criteria; update documents if they match",
599+
findDocs: "Find Document(s)",
600+
insertDocs: "Insert Document(s)",
601+
updateDocs: "Update Document(s)",
602+
deleteDocs: "Delete Document(s)",
603+
count: "Count",
604+
distinct: "Distinct",
605+
aggregate: "Aggregate",
606+
raw: "Raw",
607+
sigleDoc: "Single Document",
608+
allDocs: "All Matching Documents",
609+
documents: "Documents",
610+
command: "Command",
599611
arrayPipelines: "Array pipelines",
600612
httpMethod: "Http Method",
601613
body: "Body",

client/packages/barda/src/i18n/locales/zh.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,20 @@ export const zh = {
581581
skip: "跳过",
582582
sort: "排序",
583583
sortDes: "1: 升序; 0: 降序",
584-
upsert: "Upsert",
584+
upsert: "更新或插入",
585585
upsertDes: "如果查询条件不匹配,则插入新文档;如果匹配,则更新文档",
586+
findDocs: "查询(多)文档",
587+
insertDocs: "插入(多)文档",
588+
updateDocs: "更新(多)文档",
589+
deleteDocs: "删除(多)文档",
590+
count: "计数",
591+
distinct: "去重",
592+
aggregate: "聚合",
593+
raw: "原始",
594+
sigleDoc: "单个文档",
595+
allDocs: "所有匹配的文档",
596+
documents: "文档",
597+
command: "命令",
586598
arrayPipelines: "管道",
587599
httpMethod: "请求方式",
588600
body: "请求体",

0 commit comments

Comments
 (0)