From d80f5c47b139ff2e5483c6f56395bdda2eb6da68 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Mon, 17 Nov 2025 13:57:19 +0100 Subject: [PATCH] localization of enums --- .../LangRes/SideLangRes.Designer.cs | 66 ++++++++++++++++ .../LangRes/SideLangRes.resx | 30 +++++++ .../LangRes/SourceTypeLangRes.Designer.cs | 78 +++++++++++++++++++ .../LangRes/SourceTypeLangRes.resx | 36 +++++++++ .../UpdateActionTypeLangRes.Designer.cs | 78 +++++++++++++++++++ .../LangRes/UpdateActionTypeLangRes.resx | 36 +++++++++ .../ModpackUpdater.Apps.Manager.csproj | 27 +++++++ .../Ui/Models/MainWindow/MainWindowGridRow.cs | 7 +- 8 files changed, 355 insertions(+), 3 deletions(-) create mode 100644 ModpackUpdater.Apps.Manager/LangRes/SideLangRes.Designer.cs create mode 100644 ModpackUpdater.Apps.Manager/LangRes/SideLangRes.resx create mode 100644 ModpackUpdater.Apps.Manager/LangRes/SourceTypeLangRes.Designer.cs create mode 100644 ModpackUpdater.Apps.Manager/LangRes/SourceTypeLangRes.resx create mode 100644 ModpackUpdater.Apps.Manager/LangRes/UpdateActionTypeLangRes.Designer.cs create mode 100644 ModpackUpdater.Apps.Manager/LangRes/UpdateActionTypeLangRes.resx diff --git a/ModpackUpdater.Apps.Manager/LangRes/SideLangRes.Designer.cs b/ModpackUpdater.Apps.Manager/LangRes/SideLangRes.Designer.cs new file mode 100644 index 0000000..9b52aaf --- /dev/null +++ b/ModpackUpdater.Apps.Manager/LangRes/SideLangRes.Designer.cs @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +// +// 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 ModpackUpdater.Apps.Manager.LangRes { + using System; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SideLangRes { + + private static System.Resources.ResourceManager resourceMan; + + private static System.Globalization.CultureInfo resourceCulture; + + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SideLangRes() { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager { + get { + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("ModpackUpdater.Apps.Manager.LangRes.SideLangRes", typeof(SideLangRes).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static string Client { + get { + return ResourceManager.GetString("Client", resourceCulture); + } + } + + internal static string Server { + get { + return ResourceManager.GetString("Server", resourceCulture); + } + } + + internal static string Both { + get { + return ResourceManager.GetString("Both", resourceCulture); + } + } + } +} diff --git a/ModpackUpdater.Apps.Manager/LangRes/SideLangRes.resx b/ModpackUpdater.Apps.Manager/LangRes/SideLangRes.resx new file mode 100644 index 0000000..e23335d --- /dev/null +++ b/ModpackUpdater.Apps.Manager/LangRes/SideLangRes.resx @@ -0,0 +1,30 @@ + + + + + + + + + + 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 + + + Client + + + Server + + + Both + + \ No newline at end of file diff --git a/ModpackUpdater.Apps.Manager/LangRes/SourceTypeLangRes.Designer.cs b/ModpackUpdater.Apps.Manager/LangRes/SourceTypeLangRes.Designer.cs new file mode 100644 index 0000000..f9e7398 --- /dev/null +++ b/ModpackUpdater.Apps.Manager/LangRes/SourceTypeLangRes.Designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// 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 ModpackUpdater.Apps.Manager.LangRes { + using System; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SourceTypeLangRes { + + private static System.Resources.ResourceManager resourceMan; + + private static System.Globalization.CultureInfo resourceCulture; + + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal SourceTypeLangRes() { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager { + get { + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("ModpackUpdater.Apps.Manager.LangRes.SourceTypeLangRes", typeof(SourceTypeLangRes).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static string DirectLink { + get { + return ResourceManager.GetString("DirectLink", resourceCulture); + } + } + + internal static string GitHub { + get { + return ResourceManager.GetString("GitHub", resourceCulture); + } + } + + internal static string GitLab { + get { + return ResourceManager.GetString("GitLab", resourceCulture); + } + } + + internal static string CurseForge { + get { + return ResourceManager.GetString("CurseForge", resourceCulture); + } + } + + internal static string Modrinth { + get { + return ResourceManager.GetString("Modrinth", resourceCulture); + } + } + } +} diff --git a/ModpackUpdater.Apps.Manager/LangRes/SourceTypeLangRes.resx b/ModpackUpdater.Apps.Manager/LangRes/SourceTypeLangRes.resx new file mode 100644 index 0000000..e9d592e --- /dev/null +++ b/ModpackUpdater.Apps.Manager/LangRes/SourceTypeLangRes.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 + + + Direct link + + + GitHub + + + GitLab + + + CurseForge + + + Modrinth + + \ No newline at end of file diff --git a/ModpackUpdater.Apps.Manager/LangRes/UpdateActionTypeLangRes.Designer.cs b/ModpackUpdater.Apps.Manager/LangRes/UpdateActionTypeLangRes.Designer.cs new file mode 100644 index 0000000..c136301 --- /dev/null +++ b/ModpackUpdater.Apps.Manager/LangRes/UpdateActionTypeLangRes.Designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// 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 ModpackUpdater.Apps.Manager.LangRes { + using System; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class UpdateActionTypeLangRes { + + private static System.Resources.ResourceManager resourceMan; + + private static System.Globalization.CultureInfo resourceCulture; + + [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal UpdateActionTypeLangRes() { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Resources.ResourceManager ResourceManager { + get { + if (object.Equals(null, resourceMan)) { + System.Resources.ResourceManager temp = new System.Resources.ResourceManager("ModpackUpdater.Apps.Manager.LangRes.UpdateActionTypeLangRes", typeof(UpdateActionTypeLangRes).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + internal static System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static string None { + get { + return ResourceManager.GetString("None", resourceCulture); + } + } + + internal static string Update { + get { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + internal static string Delete { + get { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + internal static string Move { + get { + return ResourceManager.GetString("Move", resourceCulture); + } + } + + internal static string Copy { + get { + return ResourceManager.GetString("Copy", resourceCulture); + } + } + } +} diff --git a/ModpackUpdater.Apps.Manager/LangRes/UpdateActionTypeLangRes.resx b/ModpackUpdater.Apps.Manager/LangRes/UpdateActionTypeLangRes.resx new file mode 100644 index 0000000..2504461 --- /dev/null +++ b/ModpackUpdater.Apps.Manager/LangRes/UpdateActionTypeLangRes.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 + + + None + + + Update + + + Delete + + + Move + + + Copy + + \ No newline at end of file diff --git a/ModpackUpdater.Apps.Manager/ModpackUpdater.Apps.Manager.csproj b/ModpackUpdater.Apps.Manager/ModpackUpdater.Apps.Manager.csproj index bfdbd6d..a91a054 100644 --- a/ModpackUpdater.Apps.Manager/ModpackUpdater.Apps.Manager.csproj +++ b/ModpackUpdater.Apps.Manager/ModpackUpdater.Apps.Manager.csproj @@ -11,6 +11,21 @@ + + True + True + UpdateActionTypeLangRes.resx + + + True + True + SideLangRes.resx + + + True + True + SourceTypeLangRes.resx + @@ -97,6 +112,18 @@ PublicResXFileCodeGenerator TitlesLangRes.Designer.cs + + ResXFileCodeGenerator + UpdateActionTypeLangRes.Designer.cs + + + ResXFileCodeGenerator + SideLangRes.Designer.cs + + + ResXFileCodeGenerator + SourceTypeLangRes.Designer.cs + diff --git a/ModpackUpdater.Apps.Manager/Ui/Models/MainWindow/MainWindowGridRow.cs b/ModpackUpdater.Apps.Manager/Ui/Models/MainWindow/MainWindowGridRow.cs index 5134640..058acca 100644 --- a/ModpackUpdater.Apps.Manager/Ui/Models/MainWindow/MainWindowGridRow.cs +++ b/ModpackUpdater.Apps.Manager/Ui/Models/MainWindow/MainWindowGridRow.cs @@ -1,4 +1,5 @@ using System.ComponentModel; +using ModpackUpdater.Apps.Manager.LangRes; using ModpackUpdater.Apps.Manager.Utils; using PropertyChanged; @@ -8,9 +9,9 @@ public class MainWindowGridRow(InstallAction action, IActionSet baseActions) : I { public event PropertyChangedEventHandler? PropertyChanged; - public static Dictionary SourceTypes { get; } = Enum.GetValues().ToDictionary(n => n, n => Enum.GetName(n)!); - public static Dictionary Sides { get; } = Enum.GetValues().ToDictionary(n => n, n => Enum.GetName(n)!); - public static Dictionary UpdateActionTypes { get; } = Enum.GetValues().ToDictionary(n => n, n => Enum.GetName(n)!); + public static Dictionary SourceTypes { get; } = Enum.GetValues().ToDictionary(n => n, n => SourceTypeLangRes.ResourceManager.GetString( Enum.GetName(n)!)!); + public static Dictionary Sides { get; } = Enum.GetValues().ToDictionary(n => n, n => SideLangRes.ResourceManager.GetString(Enum.GetName(n)!)!); + public static Dictionary UpdateActionTypes { get; } = Enum.GetValues().ToDictionary(n => n, n => UpdateActionTypeLangRes.ResourceManager.GetString(Enum.GetName(n)!)!); public InstallAction Action => action; private InstallAction? Base => action is UpdateAction ua ? baseActions.Actions.FirstOrDefault(n => n.Id == ua.InheritFrom) : null;