mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
VPet.Solution 添加本地化
This commit is contained in:
parent
66574e2acf
commit
66d955e4bd
@ -40,12 +40,12 @@ public class DiagnosticSettingModel : ObservableClass<DiagnosticSettingModel>
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region DiagnosisInterval
|
#region DiagnosisInterval
|
||||||
private int _diagnosisInterval = 200;
|
private int _diagnosisInterval = 500;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据收集频率
|
/// 数据收集频率
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(200)]
|
[DefaultValue(500)]
|
||||||
[ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.DiagnosisInterval))]
|
[ReflectionProperty(nameof(VPet_Simulator.Windows.Interface.Setting.DiagnosisInterval))]
|
||||||
public int DiagnosisInterval
|
public int DiagnosisInterval
|
||||||
{
|
{
|
||||||
|
@ -47,11 +47,11 @@
|
|||||||
<HintPath>
|
<HintPath>
|
||||||
..\packages\LinePutScript.Localization.WPF.1.0.6\lib\net462\LinePutScript.Localization.WPF.dll</HintPath>
|
..\packages\LinePutScript.Localization.WPF.1.0.6\lib\net462\LinePutScript.Localization.WPF.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Panuon.WPF, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Panuon.WPF, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Panuon.WPF.1.0.2\lib\net462\Panuon.WPF.dll</HintPath>
|
<HintPath>..\packages\Panuon.WPF.1.0.3\lib\net462\Panuon.WPF.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Panuon.WPF.UI, Version=1.1.15.8, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Panuon.WPF.UI, Version=1.1.16.5, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Panuon.WPF.UI.1.1.15.8\lib\net462\Panuon.WPF.UI.dll</HintPath>
|
<HintPath>..\packages\Panuon.WPF.UI.1.1.16.5\lib\net462\Panuon.WPF.UI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
|
@ -29,11 +29,25 @@
|
|||||||
FontSize="16"
|
FontSize="16"
|
||||||
Style="{DynamicResource Button_BaseStyle}" />
|
Style="{DynamicResource Button_BaseStyle}" />
|
||||||
<Button
|
<Button
|
||||||
x:Name="Button_OpenSaveEditor"
|
x:Name="Button_OpenSaveViewer"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Click="Button_OpenSaveEditor_Click"
|
Click="Button_OpenSaveViewer_Click"
|
||||||
Content="{ll:Str 打开存档查看器}"
|
Content="{ll:Str 打开存档查看器}"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
Style="{DynamicResource Button_BaseStyle}" />
|
Style="{DynamicResource Button_BaseStyle}" />
|
||||||
|
<Button
|
||||||
|
x:Name="Button_OpenLocalText"
|
||||||
|
Grid.Column="1"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Click="Button_OpenLocalText_Click"
|
||||||
|
Content="{ll:Str 打开翻译文本}" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="ComboBox_Langs"
|
||||||
|
Grid.Column="1"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
SelectionChanged="ComboBox_Langs_SelectionChanged"
|
||||||
|
Style="{DynamicResource ComboBox_BaseStyle}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</pu:WindowX>
|
</pu:WindowX>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
using HKW.HKWUtils;
|
using HKW.HKWUtils;
|
||||||
|
using LinePutScript.Localization.WPF;
|
||||||
using Panuon.WPF.UI;
|
using Panuon.WPF.UI;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using VPet.Solution.ViewModels;
|
using VPet.Solution.ViewModels;
|
||||||
@ -28,7 +30,10 @@ public partial class MainWindow : WindowX
|
|||||||
}
|
}
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.SetViewModel<MainWindowVM>();
|
this.SetViewModel<MainWindowVM>();
|
||||||
|
LocalizeCore.StoreTranslation = true;
|
||||||
|
LocalizeCore.LoadDefaultCulture();
|
||||||
|
ComboBox_Langs.ItemsSource = LocalizeCore.AvailableCultures;
|
||||||
|
ComboBox_Langs.SelectedItem = LocalizeCore.CurrentCulture;
|
||||||
Closed += MainWindow_Closed;
|
Closed += MainWindow_Closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,8 +48,21 @@ public partial class MainWindow : WindowX
|
|||||||
SettingWindow.ShowOrActivate();
|
SettingWindow.ShowOrActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_OpenSaveEditor_Click(object sender, RoutedEventArgs e)
|
private void Button_OpenSaveViewer_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
SaveWindow.ShowOrActivate();
|
SaveWindow.ShowOrActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Button_OpenLocalText_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
foreach (var a in LocalizeCore.StoreTranslationList)
|
||||||
|
sb.AppendLine(a.Replace("\r\n", "\\r\\n"));
|
||||||
|
MessageBoxX.Show(sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ComboBox_Langs_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
LocalizeCore.LoadCulture((string)ComboBox_Langs.SelectedItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
<package id="FastMember" version="1.5.0" targetFramework="net462" />
|
<package id="FastMember" version="1.5.0" targetFramework="net462" />
|
||||||
<package id="LinePutScript" version="1.9.2" targetFramework="net462" />
|
<package id="LinePutScript" version="1.9.2" targetFramework="net462" />
|
||||||
<package id="LinePutScript.Localization.WPF" version="1.0.6" targetFramework="net462" />
|
<package id="LinePutScript.Localization.WPF" version="1.0.6" targetFramework="net462" />
|
||||||
<package id="Panuon.WPF" version="1.0.2" targetFramework="net462" />
|
<package id="Panuon.WPF" version="1.0.3" targetFramework="net462" />
|
||||||
<package id="Panuon.WPF.UI" version="1.1.15.8" targetFramework="net462" />
|
<package id="Panuon.WPF.UI" version="1.1.16.5" targetFramework="net462" />
|
||||||
</packages>
|
</packages>
|
Loading…
Reference in New Issue
Block a user