Skip to content

Commit

Permalink
Add localizable string resources
Browse files Browse the repository at this point in the history
  • Loading branch information
qe201020335 committed Apr 16, 2024
1 parent 9173fb7 commit 87f473a
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 2 deletions.
18 changes: 18 additions & 0 deletions QuestPatcher/QuestPatcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,22 @@
<ItemGroup>
<UpToDateCheckInput Remove="views\SelectDeviceWindow.axaml" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Resources\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Strings.zh-hans.resx">
<DependentUpon>Strings.resx</DependentUpon>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Compile Update="Resources\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>
</Project>
80 changes: 80 additions & 0 deletions QuestPatcher/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions QuestPatcher/Resources/Strings.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>

<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">

</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="LoadingViewQPLoading" xml:space="preserve">
<value>QuestPatcher loading . . .</value>
</data>
<data name="DisplayLogs" xml:space="preserve">
<value>Display Logs</value>
</data>
</root>
20 changes: 20 additions & 0 deletions QuestPatcher/Resources/Strings.zh-hans.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="LoadingViewQPLoading" xml:space="preserve">
<value>QuestPatcher 正在加载 . . .</value>
</data>
<data name="DisplayLogs" xml:space="preserve">
<value>显示日志</value>
</data>
</root>
5 changes: 3 additions & 2 deletions QuestPatcher/Views/LoadingView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:QuestPatcher.ViewModels"
xmlns:res="clr-namespace:QuestPatcher.Resources"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="QuestPatcher.Views.LoadingView">
<Design.DataContext>
Expand All @@ -14,11 +15,11 @@
<ExperimentalAcrylicBorder DockPanel.Dock="Left" Material="{DynamicResource MainBackgroundMaterial}" IsHitTestVisible="True">
<Panel Margin="20" IsHitTestVisible="True">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="5">
<TextBlock TextAlignment="Center">QuestPatcher loading . . .</TextBlock>
<TextBlock TextAlignment="Center" Text="{x:Static res:Strings.LoadingViewQPLoading}"/>
<UserControl Content="{Binding ProgressView}" Padding="20"/>
<UserControl Content="{Binding LoggingView}" Width="470" Height="200" IsVisible="{Binding Config.DisplayLogs}" />
</StackPanel>
<ToggleSwitch Content="Display Logs" HorizontalAlignment="Left" IsChecked="{Binding Config.DisplayLogs}" VerticalAlignment="Bottom"/>
<ToggleSwitch Content="{x:Static res:Strings.DisplayLogs}" HorizontalAlignment="Left" IsChecked="{Binding Config.DisplayLogs}" VerticalAlignment="Bottom"/>
</Panel>
</ExperimentalAcrylicBorder>
</DockPanel>
Expand Down

0 comments on commit 87f473a

Please sign in to comment.