From 98fdd00b5652709adcb0cf0beaedc0ca075caee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Fri, 25 Jul 2025 01:17:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=9C=AC=E5=9C=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BetterGenshinImpact.csproj | 13 +++ .../Helpers/Localization/LangKeys.cs | 10 ++ .../Properties/Lang.Designer.cs | 98 +++++++++++++++++++ BetterGenshinImpact/Properties/Lang.en.resx | 23 +++++ BetterGenshinImpact/Properties/Lang.resx | 36 +++++++ .../Properties/Lang.zh-hans.resx | 23 +++++ .../Properties/Lang.zh-hant.resx | 23 +++++ BetterGenshinImpact/View/Pages/HomePage.xaml | 3 +- .../ViewModel/MainWindowViewModel.cs | 3 + 9 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 BetterGenshinImpact/Helpers/Localization/LangKeys.cs create mode 100644 BetterGenshinImpact/Properties/Lang.Designer.cs create mode 100644 BetterGenshinImpact/Properties/Lang.en.resx create mode 100644 BetterGenshinImpact/Properties/Lang.resx create mode 100644 BetterGenshinImpact/Properties/Lang.zh-hans.resx create mode 100644 BetterGenshinImpact/Properties/Lang.zh-hant.resx diff --git a/BetterGenshinImpact/BetterGenshinImpact.csproj b/BetterGenshinImpact/BetterGenshinImpact.csproj index 2e3bed8a..ad724e56 100644 --- a/BetterGenshinImpact/BetterGenshinImpact.csproj +++ b/BetterGenshinImpact/BetterGenshinImpact.csproj @@ -39,6 +39,7 @@ + @@ -203,10 +204,22 @@ Code WelcomeDialog.xaml + + True + True + Lang.resx + <_DeploymentManifestIconFile Remove="Resources\Images\logo.ico" /> + + + + ResXFileCodeGenerator + Lang.Designer.cs + + diff --git a/BetterGenshinImpact/Helpers/Localization/LangKeys.cs b/BetterGenshinImpact/Helpers/Localization/LangKeys.cs new file mode 100644 index 00000000..3cb86629 --- /dev/null +++ b/BetterGenshinImpact/Helpers/Localization/LangKeys.cs @@ -0,0 +1,10 @@ +using Antelcat.I18N.Attributes; +using BetterGenshinImpact.Properties; + +namespace BetterGenshinImpact.Helpers.Localization; + +[ResourceKeysOf(typeof(Lang))] +public partial class LangKeys +{ + +} \ No newline at end of file diff --git a/BetterGenshinImpact/Properties/Lang.Designer.cs b/BetterGenshinImpact/Properties/Lang.Designer.cs new file mode 100644 index 00000000..b71e2938 --- /dev/null +++ b/BetterGenshinImpact/Properties/Lang.Designer.cs @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BetterGenshinImpact.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Lang { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Lang() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BetterGenshinImpact.Properties.Lang", typeof(Lang).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to better genshin impact. + /// + internal static string bgi1 { + get { + return ResourceManager.GetString("bgi1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string This_is_a_message { + get { + return ResourceManager.GetString("This is a message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string 中文 { + get { + return ResourceManager.GetString("中文", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + internal static string 嘿嘿嘿 { + get { + return ResourceManager.GetString("嘿嘿嘿", resourceCulture); + } + } + } +} diff --git a/BetterGenshinImpact/Properties/Lang.en.resx b/BetterGenshinImpact/Properties/Lang.en.resx new file mode 100644 index 00000000..d9f63826 --- /dev/null +++ b/BetterGenshinImpact/Properties/Lang.en.resx @@ -0,0 +1,23 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + better genshin impact + + + This is a message + + + hahaha + + \ No newline at end of file diff --git a/BetterGenshinImpact/Properties/Lang.resx b/BetterGenshinImpact/Properties/Lang.resx new file mode 100644 index 00000000..c93f3e90 --- /dev/null +++ b/BetterGenshinImpact/Properties/Lang.resx @@ -0,0 +1,36 @@ + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + better genshin impact + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BetterGenshinImpact/Properties/Lang.zh-hans.resx b/BetterGenshinImpact/Properties/Lang.zh-hans.resx new file mode 100644 index 00000000..70424015 --- /dev/null +++ b/BetterGenshinImpact/Properties/Lang.zh-hans.resx @@ -0,0 +1,23 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 更好的原神,免费且开源 + + + 测试文本 + + + 哈哈哈哈哈 + + \ No newline at end of file diff --git a/BetterGenshinImpact/Properties/Lang.zh-hant.resx b/BetterGenshinImpact/Properties/Lang.zh-hant.resx new file mode 100644 index 00000000..902a9cb4 --- /dev/null +++ b/BetterGenshinImpact/Properties/Lang.zh-hant.resx @@ -0,0 +1,23 @@ + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 更好的原神,免費且開源 + + + 测试文本 + + + 嘎嘎嘎嘎 + + \ No newline at end of file diff --git a/BetterGenshinImpact/View/Pages/HomePage.xaml b/BetterGenshinImpact/View/Pages/HomePage.xaml index 6d4a0629..eb2847c1 100644 --- a/BetterGenshinImpact/View/Pages/HomePage.xaml +++ b/BetterGenshinImpact/View/Pages/HomePage.xaml @@ -7,6 +7,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:pages="clr-namespace:BetterGenshinImpact.ViewModel.Pages" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" + xmlns:localization="clr-namespace:BetterGenshinImpact.Helpers.Localization" Title="HomePage" d:DataContext="{d:DesignInstance Type=pages:HomePageViewModel}" d:DesignHeight="850" @@ -48,7 +49,7 @@ + Text="{I18N {x:Static localization:LangKeys.嘿嘿嘿}}" />