Repository navigation
Expand file tree
/
Copy pathLoc.Pipeline.cs
More file actions
185 lines (176 loc) · 13.3 KB
/
Copy pathLoc.Pipeline.cs
File metadata and controls
185 lines (176 loc) · 13.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
namespace VelaShell.Plugin.Mongo;
public sealed partial class Loc
{
/// <summary>聚合管道构建器。</summary>
private static readonly (string Key, string En, string Zh)[] PipelineTexts =
[
// ── 标签与工具行 ──
("Pipe_Title", "Pipeline · {0}", "管道 · {0}"),
("Pipe_ModeStages", "Stages", "阶段"),
("Pipe_ModeText", "Text", "文本"),
("Pipe_AddStage", "Add stage", "添加阶段"),
("Pipe_AddStageHint", "· type $ to search 30+ stages", "· 输入 $ 可搜索 30+ 个阶段"),
("Pipe_SearchStages", "Search stages… ($lookup, group, join)", "搜索阶段…($lookup、group、关联)"),
("Pipe_Explain", "Explain", "执行计划"),
("Pipe_AutoPreview", "Auto preview", "自动预览"),
("Pipe_Sample", "sample {0}", "抽样 {0}"),
("Pipe_SampleTip", "Previews run every stage on the first {0} input documents. Click to change.",
"预览对前 {0} 份输入文档逐阶段计算。点击修改抽样数。"),
("Pipe_Save", "Save pipeline", "保存管道"),
("Pipe_CreateView", "Create view", "创建视图"),
("Pipe_ExportCode", "Export to code", "导出为代码"),
("Pipe_Run", "Run", "运行"),
("Pipe_Stop", "Stop", "停止"),
// ── 阶段卡片 ──
("Pipe_Docs", "docs", "份文档"),
("Pipe_Disabled", "disabled", "已停用"),
("Pipe_DragTip", "Drag to reorder", "拖动以重排"),
("Pipe_Enable", "Enable / disable", "启用 / 停用"),
("Pipe_Expand", "Expand / collapse", "展开 / 折叠"),
("Pipe_Duplicate", "Duplicate stage", "复制阶段"),
("Pipe_Delete", "Delete stage", "删除阶段"),
("Pipe_MoveUp", "Move up", "上移"),
("Pipe_MoveDown", "Move down", "下移"),
("Pipe_Removed", "Removed stage {0} · {1}", "已删除阶段 {0} · {1}"),
("Pipe_Undo", "Undo", "撤销"),
("Pipe_SyntaxError", "Syntax error", "语法错误"),
("Pipe_ServerError", "Server error", "运行出错"),
("Pipe_FixHint", "Alt+↵ fix", "Alt+↵ 修复"),
("Pipe_CountTip", "{0} documents come out of the first {1} input documents (a sampled count, not the whole collection)",
"前 {1} 份输入文档经过这里剩 {0} 份(抽样计数,不是全集合)"),
("Pipe_OutputPreview", "Output preview", "输出预览"),
("Pipe_PreviewFirst", "first {0} / {1}", "前 {0} / {1}"),
("Pipe_ShowAll", "Show the whole preview", "查看全部预览"),
("Pipe_PreviewEmpty", "No documents come out of this stage.", "这个阶段没有输出文档。"),
("Pipe_PreviewBlocked", "An upstream stage failed, so this one cannot be previewed.", "上游阶段出错,这里无法预览。"),
("Pipe_PreviewInvalid", "Fix the stage body to preview it.", "阶段体有语法错误,修好后才能预览。"),
("Pipe_PreviewSkipped", "Disabled — skipped by both preview and run.", "已停用 · 预览与运行都会跳过它。"),
("Pipe_PreviewWrite", "Write stages are not previewed: previewing them would write.", "写入阶段不参与预览:预览它就是真的写进去了。"),
("Pipe_PreviewPending", "Computing the preview…", "正在计算预览…"),
("Pipe_PreviewOff", "Auto preview is off.", "自动预览已关闭。"),
// ── 阶段的短说明 ──
("Pipe_Desc_match", "Filter documents", "筛选文档"),
("Pipe_Desc_project", "Reshape fields", "投影字段"),
("Pipe_Desc_addFields", "Add fields", "添加字段"),
("Pipe_Desc_set", "Set fields", "设置字段"),
("Pipe_Desc_unset", "Remove fields", "移除字段"),
("Pipe_Desc_group", "Group and aggregate", "分组聚合"),
("Pipe_Desc_sort", "Sort", "排序"),
("Pipe_Desc_sortByCount", "Group and count", "分组计数"),
("Pipe_Desc_limit", "Limit", "限制数量"),
("Pipe_Desc_skip", "Skip", "跳过"),
("Pipe_Desc_unwind", "Unwind an array", "展开数组"),
("Pipe_Desc_lookup", "Join a collection", "关联集合"),
("Pipe_Desc_graphLookup", "Recursive join", "递归关联"),
("Pipe_Desc_facet", "Parallel sub-pipelines", "多路子管道"),
("Pipe_Desc_bucket", "Bucket by boundaries", "按边界分桶"),
("Pipe_Desc_bucketAuto", "Even buckets", "自动分桶"),
("Pipe_Desc_count", "Count", "计数"),
("Pipe_Desc_replaceRoot", "Replace the root", "替换根文档"),
("Pipe_Desc_replaceWith", "Replace the document", "替换文档"),
("Pipe_Desc_sample", "Random sample", "随机抽样"),
("Pipe_Desc_out", "Write to a collection", "写入集合"),
("Pipe_Desc_merge", "Merge into a collection", "合并到集合"),
("Pipe_Desc_unionWith", "Union with a collection", "合并另一集合"),
("Pipe_Desc_setWindowFields", "Window functions", "窗口计算"),
("Pipe_Desc_densify", "Fill sequence gaps", "补齐序列"),
("Pipe_Desc_fill", "Fill missing values", "填充空值"),
("Pipe_Desc_geoNear", "Sort by distance", "地理邻近"),
("Pipe_Desc_redact", "Redact content", "按规则裁剪"),
("Pipe_Desc_collStats", "Collection statistics", "集合统计"),
("Pipe_Desc_indexStats", "Index statistics", "索引统计"),
("Pipe_Desc_documents", "Literal documents", "字面量文档"),
("Pipe_Desc_custom", "Custom stage", "自定义阶段"),
// ── 补全 ──
("Pipe_FieldsHeader", "Upstream fields · sampled from {0} input documents", "上游字段 · 抽样 {0} 份输入文档"),
("Pipe_CompletionFooter", "↵ insert · Ctrl+Space toggle details", "↵ 插入 · Ctrl+Space 切换详情"),
("Pipe_FieldBadge", "upstream field", "上游字段"),
("Pipe_FieldDetail", "{0} · {1}. Present in {2} of the upstream stage's sampled output.",
"{0} · {1}。在上游阶段的抽样输出中出现率 {2}。"),
// ── 管道输出 ──
("Pipe_Output", "Pipeline output", "管道输出"),
("Pipe_ResultSummary", "{0} documents · full run {1}", "{0} 份文档 · 完整运行 {1}"),
("Pipe_ResultSummaryMore", "first {0} documents · full run {1}", "前 {0} 份文档 · 完整运行 {1}"),
("Pipe_Running", "Running the whole pipeline…", "正在运行整条管道…"),
("Pipe_RunCancelled", "Run cancelled.", "已取消运行。"),
("Pipe_ResultEmpty", "The pipeline produced no documents.", "管道没有输出文档。"),
("Pipe_RunInvalid", "Stage {0} has a syntax error", "阶段 {0} 有语法错误"),
("Pipe_OpenInResults", "Open in results tab", "在结果标签中打开"),
("Pipe_SaveAs", "Save as collection ($out)", "另存为集合 ($out)"),
("Pipe_GhostCell", "(stage {0} disabled)", "(阶段 {0} 已停用)"),
// ── 底栏与状态栏 ──
("Pipe_StageSummary", "{0} stages · {1} enabled", "{0} 个阶段 · {1} 个启用"),
("Pipe_ErrorCount", "{0} with errors", "{0} 个有错"),
("Pipe_PreviewBasis", "preview based on the first {0} input documents · {1}", "预览基于前 {0} 份输入文档 · {1}"),
("Pipe_PreviewBasisPending", "preview based on the first {0} input documents", "预览基于前 {0} 份输入文档"),
("Pipe_Previewing", "previewing the first {0} input documents…", "正在预览前 {0} 份输入文档…"),
("Pipe_PreviewOffHint", "auto preview off · click to preview once", "自动预览已关闭 · 点击预览一次"),
("Pipe_PreviewFailed", "preview failed: {0}", "预览失败:{0}"),
("Pipe_AllowDiskUse", "allowDiskUse · {0}", "allowDiskUse · {0}"),
("Pipe_On", "on", "已开启"),
("Pipe_Off", "off", "已关闭"),
("Pipe_AllowDiskUseTip", "Let $group / $sort spill to disk past 100 MB of memory (applies to preview and run). Click to toggle.",
"允许 $group / $sort 超过 100 MB 内存时落盘(预览与运行都生效)。点击切换。"),
("Pipe_Unsaved", "Pipeline · unsaved", "管道 · 未保存"),
("Pipe_SavedState", "Pipeline · {0}", "管道 · {0}"),
("Pipe_SavedModified", "Pipeline · {0} · modified", "管道 · {0} · 已修改"),
("Pipe_StatusPreview", "preview {0} · sample {1}", "预览 {0} · 抽样 {1}"),
("Pipe_StatusRun", "{0} documents · {1}", "{0} 份文档 · {1}"),
// ── 文本模式与解析错误 ──
("Pipe_TextInvalid", "The pipeline text has an error — fix it to go back to the stage cards.",
"管道文本有错误,修好后才能切回阶段卡片。"),
("Pipe_ErrNotArray", "A pipeline is an array: [ {{ $stage: … }}, … ]", "管道是一个数组:[ {{ $阶段: … }}, … ]"),
("Pipe_ErrUnclosed", "Missing the closing ]", "缺少收尾的 ]"),
("Pipe_ErrTrailing", "Unexpected text after the pipeline", "管道后面有多余的内容"),
("Pipe_ErrStageShape", "Each stage is a document {{ $stage: … }}", "每个阶段都是一个文档 {{ $阶段: … }}"),
("Pipe_ErrUnbalanced", "Unbalanced bracket", "括号不配对"),
("Pipe_ErrEmptyStage", "Empty stage {{}}", "空阶段 {{}}"),
("Pipe_ErrStageName", "Stage names start with $: \"{0}\"", "阶段名要以 $ 开头:\"{0}\""),
("Pipe_ErrExpectedColon", "Expected : after {0}", "{0} 后面缺少冒号"),
("Pipe_ErrOneOperator", "A stage has exactly one operator — split what follows {0} into a new stage",
"一个阶段只能有一个运算符 —— 把 {0} 后面的拆成新阶段"),
("Pipe_ErrEmptyBody", "The stage body is empty", "阶段体是空的"),
("Pipe_ErrSyntax", "Syntax error: {0}", "语法错误:{0}"),
// ── 写入、视图、保存 ──
("Pipe_WriteTitle", "Run a pipeline that writes", "运行会写入的管道"),
("Pipe_OutBody", "$out replaces the whole collection {0} with this pipeline's output. The documents in it now will be lost.",
"$out 会用这条管道的输出整体替换集合 {0},其中现有的文档将丢失。"),
("Pipe_MergeBody", "$merge writes this pipeline's output into {0}; matching documents are merged, the rest are inserted.",
"$merge 会把这条管道的输出写进 {0}:匹配的文档合并,其余插入。"),
("Pipe_WriteConfirm", "Run and write", "运行并写入"),
("Pipe_WriteDone", "Wrote to {0}", "已写入 {0}"),
("Pipe_Open", "Open", "打开"),
("Pipe_SaveTitle", "Save pipeline", "保存管道"),
("Pipe_SaveName", "Name", "名称"),
("Pipe_SaveHint", "Saved pipelines are kept per connection; saving under an existing name replaces it.",
"保存的管道按连接存放;同名保存会覆盖。"),
("Pipe_SaveExisting", "Saved pipelines", "已保存的管道"),
("Pipe_SaveDone", "Saved pipeline {0}", "已保存管道 {0}"),
("Pipe_NameRequired", "Enter a name", "请填写名称"),
("Pipe_NameInvalid", "Collection names cannot contain $ or start with system.", "集合名不能含 $,也不能以 system. 开头"),
("Pipe_NameExists", "{0} already exists in {1}", "{1} 里已经有 {0}"),
("Pipe_ViewTitle", "Create view", "创建视图"),
("Pipe_ViewName", "View name", "视图名"),
("Pipe_ViewHint", "A read-only view on {0}, backed by its {1} enabled stages.", "基于 {0} 的只读视图,背后是 {1} 个启用的阶段。"),
("Pipe_ViewConfirmBody", "Create the view {0} on {1} in the database {2}?", "在库 {2} 中基于 {1} 创建视图 {0}?"),
("Pipe_ViewConfirm", "Create view", "创建视图"),
("Pipe_ViewDone", "Created view {0}", "已创建视图 {0}"),
("Pipe_ViewNoWrite", "A view cannot contain $out or $merge", "视图里不能有 $out 或 $merge"),
("Pipe_SaveAsTitle", "Save output as collection", "另存为集合"),
("Pipe_SaveAsName", "Target collection", "目标集合"),
("Pipe_SaveAsOut", "$out · replace", "$out · 整体替换"),
("Pipe_SaveAsMerge", "$merge · merge into", "$merge · 合并进"),
("Pipe_SaveAsOutHint", "Replaces the target with the output (created when missing).", "用输出整体替换目标集合(不存在则新建)。"),
("Pipe_SaveAsMergeHint", "Merges the output into the target by _id; documents already there are kept.",
"按 _id 把输出合并进目标集合,已有的文档保留。"),
("Pipe_SaveAsHasWrite", "The pipeline already ends with {0}", "管道已经以 {0} 结尾"),
("Pipe_SaveAsSelf", "Pick a collection other than the source", "请选一个与源集合不同的集合"),
// ── 导出为代码、看全部预览 ──
("Pipe_CodeTitle", "Export to code", "导出为代码"),
("Pipe_CodeAllowDiskUse", "Include allowDiskUse", "包含 allowDiskUse"),
("Pipe_CodeNote", "{0} enabled stages · disabled stages are left out", "{0} 个启用阶段 · 停用的阶段不导出"),
("Pipe_Copy", "Copy", "复制"),
("Pipe_PreviewTitle", "Stage {0} · {1} · output preview", "阶段 {0} · {1} · 输出预览"),
("Pipe_PreviewSubtitle", "first {0} of {1} · from the first {2} input documents", "前 {0} / {1} · 基于前 {2} 份输入文档"),
];
}