@@ -8,23 +8,23 @@ import { buildQueryCommand, FunctionProperty, toQueryView } from "./queryCompUti
88import { trans } from "@barda/i18n" ;
99
1010const 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
2121const 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
6363const LimitDropdownField = withPropertyViewFn ( dropdownControl ( LimitOptions , "SINGLE" ) , ( comp ) => (
64- < > { comp . propertyView ( { label : "Limit" , placement : "bottom" } ) } </ >
64+ < > { comp . propertyView ( { label : trans ( "query.limit" ) , placement : "bottom" } ) } </ >
6565) ) ;
6666
6767const 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" },
0 commit comments