diff --git a/Source/Installer/Product.wxs b/Source/Installer/Product.wxs index c3ade27d..04271381 100644 --- a/Source/Installer/Product.wxs +++ b/Source/Installer/Product.wxs @@ -1,6 +1,6 @@  - - - - + + + + + + + + - + + diff --git a/Source/Monitorian.Core/Models/LanguageService.cs b/Source/Monitorian.Core/Models/LanguageService.cs index de1faeab..77e07499 100644 --- a/Source/Monitorian.Core/Models/LanguageService.cs +++ b/Source/Monitorian.Core/Models/LanguageService.cs @@ -10,30 +10,28 @@ namespace Monitorian.Core.Models { public class LanguageService { - private static IReadOnlyDictionary PreparedCulturePairs => new Dictionary - { - { "/en", "en-US" }, - { "/fr" ,"fr-FR" }, - { "/ja", "ja-JP" }, - { "/ko", "ko-KR" }, - { "/pl", "pl-PL" }, - { "/ru", "ru-RU" }, - { "/zh", "zh-Hans" }, - }; - - public static IReadOnlyCollection Options => PreparedCulturePairs.Keys.ToArray(); + public static IReadOnlyCollection Options => new[] { Option }; + private const string Option = "/lang"; - private static readonly Lazy _culture = new Lazy(() => + private static readonly Lazy _culture = new(() => { - var preparedCulturePairs = PreparedCulturePairs; var supportedCultureNames = new HashSet(CultureInfo.GetCultures(CultureTypes.AllCultures).Select(x => x.Name)); + var arguments = AppKeeper.DefinedArguments; + + int i = 0; + while (i < arguments.Count - 1) + { + if (string.Equals(arguments[i], Option, StringComparison.OrdinalIgnoreCase)) + { + var cultureName = supportedCultureNames.FirstOrDefault(x => string.Equals(x, arguments[i + 1], StringComparison.OrdinalIgnoreCase)); + if (cultureName is not null) + return new CultureInfo(cultureName); - return AppKeeper.DefinedArguments - .Where(x => !string.IsNullOrWhiteSpace(x)) - .Select(x => (Success: preparedCulturePairs.TryGetValue(x.ToLower(), out string value) && supportedCultureNames.Contains(value), CultureName: value)) - .Where(x => x.Success) - .Select(x => new CultureInfo(x.CultureName)) - .FirstOrDefault(); + break; + } + i++; + } + return null; }); /// diff --git a/Source/Monitorian.Core/Monitorian.Core.csproj b/Source/Monitorian.Core/Monitorian.Core.csproj index d52f9c2d..a8c55499 100644 --- a/Source/Monitorian.Core/Monitorian.Core.csproj +++ b/Source/Monitorian.Core/Monitorian.Core.csproj @@ -94,6 +94,11 @@ + + True + True + Invariant.resx + True True @@ -150,7 +155,20 @@ - + + PublicResXFileCodeGenerator + Invariant.Designer.cs + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + Resources.resx + Designer + + Resources.resx Designer @@ -166,11 +184,6 @@ Resources.resx Designer - - PublicResXFileCodeGenerator - Resources.Designer.cs - Designer - Resources.resx Designer diff --git a/Source/Monitorian.Core/Properties/AssemblyInfo.cs b/Source/Monitorian.Core/Properties/AssemblyInfo.cs index 3a298a43..3641ee02 100644 --- a/Source/Monitorian.Core/Properties/AssemblyInfo.cs +++ b/Source/Monitorian.Core/Properties/AssemblyInfo.cs @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.17.0.0")] -[assembly: AssemblyFileVersion("2.17.0.0")] +[assembly: AssemblyVersion("2.18.0.0")] +[assembly: AssemblyFileVersion("2.18.0.0")] [assembly: NeutralResourcesLanguage("en-US")] // For unit test diff --git a/Source/Monitorian.Core/Properties/Invariant.Designer.cs b/Source/Monitorian.Core/Properties/Invariant.Designer.cs new file mode 100644 index 00000000..44451349 --- /dev/null +++ b/Source/Monitorian.Core/Properties/Invariant.Designer.cs @@ -0,0 +1,90 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Monitorian.Core.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", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Invariant { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Invariant() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Monitorian.Core.Properties.Invariant", typeof(Invariant).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)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to License. + /// + public static string License { + get { + return ResourceManager.GetString("License", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site. + /// + public static string Site { + get { + return ResourceManager.GetString("Site", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://github.com/emoacht/Monitorian. + /// + public static string SiteUrl { + get { + return ResourceManager.GetString("SiteUrl", resourceCulture); + } + } + } +} diff --git a/Source/Monitorian.Core/Properties/Invariant.resx b/Source/Monitorian.Core/Properties/Invariant.resx new file mode 100644 index 00000000..aa906897 --- /dev/null +++ b/Source/Monitorian.Core/Properties/Invariant.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + License + + + Site + + + https://github.com/emoacht/Monitorian + + \ No newline at end of file diff --git a/Source/Monitorian.Core/Properties/Resources.Designer.cs b/Source/Monitorian.Core/Properties/Resources.Designer.cs index b6ee02a5..ba5ff5b3 100644 --- a/Source/Monitorian.Core/Properties/Resources.Designer.cs +++ b/Source/Monitorian.Core/Properties/Resources.Designer.cs @@ -105,15 +105,6 @@ public static string EnableUnison { } } - /// - /// Looks up a localized string similar to License. - /// - public static string License { - get { - return ResourceManager.GetString("License", resourceCulture); - } - } - /// /// Looks up a localized string similar to Make operation log. /// @@ -168,24 +159,6 @@ public static string ShowAdjusted { } } - /// - /// Looks up a localized string similar to Site. - /// - public static string Site { - get { - return ResourceManager.GetString("Site", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to https://github.com/emoacht/Monitorian. - /// - public static string SiteUrl { - get { - return ResourceManager.GetString("SiteUrl", resourceCulture); - } - } - /// /// Looks up a localized string similar to Start on sign in. /// diff --git a/Source/Monitorian.Core/Properties/Resources.de.resx b/Source/Monitorian.Core/Properties/Resources.de.resx new file mode 100644 index 00000000..0c2f17fc --- /dev/null +++ b/Source/Monitorian.Core/Properties/Resources.de.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Einstellbaren Bereich ändern + + + Schließen + + + Anwendungsprotokoll kopieren + + + Anwendungsprotokoll auf Desktop speichern? + + + Regler synchron verschieben + + + Anwendungsprotokoll erstellen + + + Monitore untersuchen + + + Es ist ein unerwartetes Problem aufgetreten. Fehlerprotokoll auf Desktop speichern? + + + Untersuchungsprotokoll auf Desktop speichern? + + + Monitore neu abfragen + + + Eingestellte Helligkeit anzeigen + + + Beim Anmelden starten + + + Monitor ist nicht kontrollierbar. + + + DDC/CI ist wiederholt fehlgeschlagen. + + + DDC/CI ist deaktiviert oder wird nicht unterstützt. + + + Große Schalter verwenden + + \ No newline at end of file diff --git a/Source/Monitorian.Core/Properties/Resources.fr-FR.resx b/Source/Monitorian.Core/Properties/Resources.fr.resx similarity index 100% rename from Source/Monitorian.Core/Properties/Resources.fr-FR.resx rename to Source/Monitorian.Core/Properties/Resources.fr.resx diff --git a/Source/Monitorian.Core/Properties/Resources.resx b/Source/Monitorian.Core/Properties/Resources.resx index dcb8d0cf..7618259b 100644 --- a/Source/Monitorian.Core/Properties/Resources.resx +++ b/Source/Monitorian.Core/Properties/Resources.resx @@ -132,9 +132,6 @@ Enable moving in unison - - License - Make operation log @@ -153,12 +150,6 @@ Show adjusted brightness - - Site - - - https://github.com/emoacht/Monitorian - Start on sign in diff --git a/Source/Monitorian.Core/Views/MenuWindow.xaml b/Source/Monitorian.Core/Views/MenuWindow.xaml index 8a6dcb3b..aae48ddf 100644 --- a/Source/Monitorian.Core/Views/MenuWindow.xaml +++ b/Source/Monitorian.Core/Views/MenuWindow.xaml @@ -26,17 +26,17 @@ + Text="{x:Static properties:Invariant.Site}"> - + + Text="{x:Static properties:Invariant.License}">