XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

SpaceEngineersModDev/SpaceEngineersBlueprintEditorInWinUI

完成子编辑页的en本地化

eac4f76
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

3 个文件 +63 -15
Modified SpaceEngineersBlueprintEditor/Strings/en-us/Resources.resw +48 -0
@@ -165,6 +165,22 @@
165 165 <value>Calculating blueprint</value>
166 166 <comment>计算蓝图中</comment>
167 167 </data>
168 <data name="LoadingDefinitions" xml:space="preserve">
169 <value>Loading definitions</value>
170 <comment>加载定义中</comment>
171 </data>
172 <data name="SavingBlueprint" xml:space="preserve">
173 <value>Saving blueprint</value>
174 <comment>保存蓝图中</comment>
175 </data>
176 <data name="SavingSuccessful" xml:space="preserve">
177 <value>Saving successful</value>
178 <comment>保存成功</comment>
179 </data>
180 <data name="BlueprintFile" xml:space="preserve">
181 <value>Blueprint file</value>
182 <comment>蓝图文件</comment>
183 </data>
168 184 <data name="BlueprintLoadComplete" xml:space="preserve">
169 185 <value>Blueprint load complete</value>
170 186 <comment>蓝图加载完成</comment>
@@ -177,6 +193,14 @@
177 193 <value>Can't load definitions</value>
178 194 <comment>未能加载定义</comment>
179 195 </data>
196 <data name="Error_CantLoadingShipDefinitions" xml:space="preserve">
197 <value>Can't load ship blueprint definitions</value>
198 <comment>未能加载飞船蓝图定义</comment>
199 </data>
200 <data name="Error_CantFindShipDefinitions" xml:space="preserve">
201 <value>Can't find blueprint definitions</value>
202 <comment>未能找到蓝图定义</comment>
203 </data>
180 204 <data name="Error_CantLoadingBlueprint" xml:space="preserve">
181 205 <value>Can't load definitions</value>
182 206 <comment>未能加载蓝图</comment>
@@ -185,6 +209,14 @@
185 209 <value>Blueprint doesn't have any file (bp.sbc)</value>
186 210 <comment>该蓝图不包含蓝图文件(bp.sbc)</comment>
187 211 </data>
212 <data name="Warning_CantFindFile" xml:space="preserve">
213 <value>Can't find file</value>
214 <comment>无法找到文件</comment>
215 </data>
216 <data name="ConvertComplete" xml:space="preserve">
217 <value>Convert complete</value>
218 <comment>转换完成</comment>
219 </data>
188 220 <data name="Complete" xml:space="preserve">
189 221 <value>Complete</value>
190 222 <comment>完成</comment>
@@ -197,6 +229,18 @@
197 229 <value>Error</value>
198 230 <comment>错误</comment>
199 231 </data>
232 <data name="Failed" xml:space="preserve">
233 <value>Failed</value>
234 <comment>失败</comment>
235 </data>
236 <data name="Failed_SaveFailed" xml:space="preserve">
237 <value>Save failed</value>
238 <comment>保存失败</comment>
239 </data>
240 <data name="UnknownReason" xml:space="preserve">
241 <value>Unknown reason</value>
242 <comment>保存失败</comment>
243 </data>
200 244 <data name="Loading" xml:space="preserve">
201 245 <value>Loading</value>
202 246 <comment>正在加载</comment>
@@ -445,6 +489,10 @@
445 489 <value>Can't find any grid</value>
446 490 <comment>未找到网格</comment>
447 491 </data>
492 <data name="BlueprintEditPage_NewBlueprintEditPage" xml:space="preserve">
493 <value>New blueprint edit page</value>
494 <comment>新的蓝图编辑页</comment>
495 </data>
448 496 <data name="BlueprintEditSubPage_File.Title" xml:space="preserve">
449 497 <value>File</value>
450 498 <comment>文件</comment>
Modified SpaceEngineersBlueprintEditor/ViewModels/BlueprintEditPageViewModel.cs +1 -1
@@ -67,7 +67,7 @@ public partial class BlueprintEditPageViewModel : ViewModelBase
67 67 var frame = new Frame();
68 68 var tabView = new TabViewItem
69 69 {
70 Header = "新的蓝图编辑页",
70 Header = "BlueprintEditPage_NewBlueprintEditPage".GetLocalized(),
71 71 Content = frame
72 72 };
73 73 TabViewItems.Add(tabView);
Modified SpaceEngineersBlueprintEditor/ViewModels/BlueprintEditSubPageViewModel.cs +14 -14
@@ -70,7 +70,7 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
70 70
71 71 private async void FileDropService_Drop(object? sender, (string, DragEventArgs) e)
72 72 {
73 loadingService?.StartLoading<BlueprintEditSubPage>("Loading definitions...");
73 loadingService?.StartLoading<BlueprintEditSubPage>($"{"LoadingDefinitions".GetLocalized()}...");
74 74 if (File.Exists(e.Item1) && await SpaceEngineersHelper.LoadBlueprintModel(e.Item1) is BlueprintModel blueprintModel)
75 75 {
76 76 NavigationParameterService.Parameter = blueprintModel;
@@ -101,12 +101,12 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
101 101 }
102 102 else
103 103 {
104 messageService?.ShowMessage("未能加载飞船蓝图定义", "错误", InfoBarSeverity.Error);
104 messageService?.ShowMessage("Error_CantLoadingShipDefinitions".GetLocalized(), "Error".GetLocalized(), InfoBarSeverity.Error);
105 105 }
106 106 }
107 107 else
108 108 {
109 messageService?.ShowMessage("未能找到蓝图定义", "错误", InfoBarSeverity.Error);
109 messageService?.ShowMessage("Error_CantFindShipDefinitions".GetLocalized(), "Error".GetLocalized(), InfoBarSeverity.Error);
110 110 }
111 111 }
112 112
@@ -134,7 +134,7 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
134 134 {
135 135 if (currentShipBlueprint is null) return;
136 136 isLoaded = true;
137 loadingService?.StartLoading<BlueprintEditSubPage>("Loading definitions...");
137 loadingService?.StartLoading<BlueprintEditSubPage>($"{"LoadingDefinitions".GetLocalized()}...");
138 138 await Task.Delay(50);
139 139 switch (caseName)
140 140 {
@@ -165,7 +165,7 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
165 165 var parent = new BlueprintPropertyViewData
166 166 {
167 167 Value = currentShipBlueprint,
168 Name = "飞船蓝图",
168 Name = "Ship blueprint",
169 169 Type = currentShipBlueprint!.GetType()
170 170 };
171 171 SpaceEngineersHelper.AnalyzeBlueprint(parent);
@@ -279,7 +279,7 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
279 279 [RelayCommand]
280 280 async Task OpenBlueprint()
281 281 {
282 loadingService?.StartLoading<BlueprintEditSubPage>("Loading definitions...");
282 loadingService?.StartLoading<BlueprintEditSubPage>($"{"LoadingDefinitions".GetLocalized()}...");
283 283 var openPicker = new FileOpenPicker();
284 284 InitializeWithWindow.Initialize(openPicker, WindowNative.GetWindowHandle(App.MainWindow));
285 285 openPicker.ViewMode = PickerViewMode.List;
@@ -303,7 +303,7 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
303 303 if (currentBlueprintModel is not null && currentBlueprintModel.ViewData is not null)
304 304 Process.Start("explorer.exe", Path.GetDirectoryName(currentBlueprintModel.ViewData.FilePath) ?? string.Empty);
305 305 else
306 messageService?.ShowMessage("无法找到文件", "警告", InfoBarSeverity.Warning);
306 messageService?.ShowMessage("Warning_CantFindFile".GetLocalized(), "Warning".GetLocalized(), InfoBarSeverity.Warning);
307 307 }
308 308
309 309 [RelayCommand]
@@ -312,10 +312,10 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
312 312 [RelayCommand]
313 313 async Task Save()
314 314 {
315 loadingService?.StartLoading<BlueprintEditSubPage>("Saving blueprint...");
315 loadingService?.StartLoading<BlueprintEditSubPage>($"{"SavingBlueprint".GetLocalized()}...");
316 316 var savePicker = new FileSavePicker();
317 317 InitializeWithWindow.Initialize(savePicker, WindowNative.GetWindowHandle(App.MainWindow));
318 savePicker.FileTypeChoices.Add(new("Blueprint file", [".sbc"]));
318 savePicker.FileTypeChoices.Add(new("BlueprintFile".GetLocalized(), [".sbc"]));
319 319 savePicker.SuggestedSaveFile = await StorageFile.GetFileFromPathAsync($"{NavigationParameterService.Parameter?.ViewData?.FilePath}");
320 320 savePicker.SuggestedFileName = "bp.sbc";
321 321 savePicker.DefaultFileExtension = ".sbc";
@@ -352,21 +352,21 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
352 352 if (File.Exists(sbcPath))
353 353 File.Delete(sbcPath);
354 354 }
355 messageService?.ShowMessage("保存成功", "完成", InfoBarSeverity.Success);
355 messageService?.ShowMessage("SavingSuccessful".GetLocalized(), "Complete".GetLocalized(), InfoBarSeverity.Success);
356 356 }
357 357 else if (result.StartsWith("Error:"))
358 358 {
359 messageService?.ShowMessage(result.Replace("Error:", string.Empty), "失败", InfoBarSeverity.Error);
359 messageService?.ShowMessage(result.Replace("Error:", string.Empty), "Failed".GetLocalized(), InfoBarSeverity.Error);
360 360 }
361 361 }
362 362 else
363 363 {
364 messageService?.ShowMessage("保存失败:未知原因", "失败", InfoBarSeverity.Error);
364 messageService?.ShowMessage($"{"Failed_SaveFailed".GetLocalized()}: {"UnknownReason".GetLocalized()}", "Failed".GetLocalized(), InfoBarSeverity.Error);
365 365 }
366 366 }
367 367 catch (Exception ex)
368 368 {
369 messageService?.ShowMessage($"保存失败:{ex.Message}", "失败", InfoBarSeverity.Error);
369 messageService?.ShowMessage($"{"Failed_SaveFailed".GetLocalized()}: {ex.Message}", "Failed".GetLocalized(), InfoBarSeverity.Error);
370 370 }
371 371 }
372 372 loadingService?.StopLoading<BlueprintEditSubPage>();
@@ -397,6 +397,6 @@ public partial class BlueprintEditSubPageViewModel : ViewModelBase
397 397 default:
398 398 break;
399 399 }
400 messageService?.ShowMessage("转换完成", "完成", InfoBarSeverity.Success);
400 messageService?.ShowMessage("ConvertComplete".GetLocalized(), "Complete".GetLocalized(), InfoBarSeverity.Success);
401 401 }
402 402 }