From 36fa35d1e58a1a0ebfb437b78137f242dd0baee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fele?= Date: Sun, 19 Nov 2023 22:47:13 +0100 Subject: [PATCH] Implement localization --- src/ChatPrisma/App.xaml.cs | 15 +- src/ChatPrisma/ChatPrisma.csproj | 21 + src/ChatPrisma/Properties/AssemblyInfo.cs | 3 + src/ChatPrisma/Resources/Strings.Designer.cs | 382 ++++++++++++++++++ .../Resources/Strings.de.Designer.cs | 382 ++++++++++++++++++ src/ChatPrisma/Resources/Strings.de.resx | 137 +++++++ src/ChatPrisma/Resources/Strings.resx | 137 +++++++ .../Services/ChatBot/OpenAIChatBotService.cs | 5 +- src/ChatPrisma/Views/About/AboutView.xaml | 25 +- .../Views/OpenSource/OpenSourceView.xaml | 13 +- .../Views/Settings/SettingsView.xaml | 30 +- .../TextEnhancement/TextEnhancementView.xaml | 35 +- src/ChatPrisma/Views/Update/UpdateView.xaml | 19 +- src/ChatPrisma/WindowsTray.cs | 7 +- 14 files changed, 1123 insertions(+), 88 deletions(-) create mode 100644 src/ChatPrisma/Resources/Strings.Designer.cs create mode 100644 src/ChatPrisma/Resources/Strings.de.Designer.cs create mode 100644 src/ChatPrisma/Resources/Strings.de.resx create mode 100644 src/ChatPrisma/Resources/Strings.resx diff --git a/src/ChatPrisma/App.xaml.cs b/src/ChatPrisma/App.xaml.cs index 1924c58..3617e74 100644 --- a/src/ChatPrisma/App.xaml.cs +++ b/src/ChatPrisma/App.xaml.cs @@ -1,9 +1,11 @@ -using System.Diagnostics; +using System.Globalization; using System.Windows; +using System.Windows.Markup; using System.Windows.Threading; using ChatPrisma.Host; using ChatPrisma.HostedServices; using ChatPrisma.Options; +using ChatPrisma.Resources; using ChatPrisma.Services.AutoStart; using ChatPrisma.Services.ChatBot; using ChatPrisma.Services.Dialogs; @@ -29,6 +31,14 @@ public partial class App : ISingleInstance { private IHost? _host; + public App() + { + // Setup culture + FrameworkElement.LanguageProperty.OverrideMetadata( + typeof(FrameworkElement), + new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentUICulture.IetfLanguageTag))); + } + private async void App_OnStartup(object sender, StartupEventArgs e) { try @@ -40,6 +50,7 @@ private async void App_OnStartup(object sender, StartupEventArgs e) return; } + // Create and start host this._host = this.CreateHostBuilder(e.Args).Build(); await this._host.StartAsync(); @@ -99,7 +110,7 @@ private IHostBuilder CreateHostBuilder(string[] args) => Microsoft.Extensions.Ho o.MouseDoubleClickAction = WindowsTray.HandleDoubleClick; o.ContextMenuFactory = WindowsTray.CreateContextMenu; o.AppShutdownEnabled = true; - o.AppShutdownHeader = "Beenden"; + o.AppShutdownHeader = Strings.Shutdown; }); services.AddOptions() .BindConfiguration(OpenAIOptions.Section) diff --git a/src/ChatPrisma/ChatPrisma.csproj b/src/ChatPrisma/ChatPrisma.csproj index 9af1aea..c886541 100644 --- a/src/ChatPrisma/ChatPrisma.csproj +++ b/src/ChatPrisma/ChatPrisma.csproj @@ -54,5 +54,26 @@ + + + + PublicResXFileCodeGenerator + Strings.Designer.cs + + + True + True + Strings.resx + + + PublicResXFileCodeGenerator + Strings.de.Designer.cs + + + True + True + Strings.de.resx + + diff --git a/src/ChatPrisma/Properties/AssemblyInfo.cs b/src/ChatPrisma/Properties/AssemblyInfo.cs index 76af59d..cee8c52 100644 --- a/src/ChatPrisma/Properties/AssemblyInfo.cs +++ b/src/ChatPrisma/Properties/AssemblyInfo.cs @@ -1,3 +1,6 @@ +using System.Resources; using System.Windows; +[assembly: NeutralResourcesLanguage("en")] + [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] diff --git a/src/ChatPrisma/Resources/Strings.Designer.cs b/src/ChatPrisma/Resources/Strings.Designer.cs new file mode 100644 index 0000000..c43990c --- /dev/null +++ b/src/ChatPrisma/Resources/Strings.Designer.cs @@ -0,0 +1,382 @@ +//------------------------------------------------------------------------------ +// +// 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 ChatPrisma.Resources { + 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()] + public class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// 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("ChatPrisma.Resources.Strings", typeof(Strings).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 About. + /// + public static string About { + get { + return ResourceManager.GetString("About", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Accept the text and copy it into the clipboard. + ///CTRL+Enter. + /// + public static string AcceptTextTooltip { + get { + return ResourceManager.GetString("AcceptTextTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please enter an OpenAI API key in the settings.. + /// + public static string ApiKeyMissing { + get { + return ResourceManager.GetString("ApiKeyMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to auto. insert. + /// + public static string AutoInsert { + get { + return ResourceManager.GetString("AutoInsert", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If checked, the text will be automatically inserted into the previous application.. + /// + public static string AutoInsertTooltip { + get { + return ResourceManager.GetString("AutoInsertTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Autostart. + /// + public static string Autostart { + get { + return ResourceManager.GetString("Autostart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Check for updates. + /// + public static string CheckForUpdates { + get { + return ResourceManager.GetString("CheckForUpdates", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Commit-ID:. + /// + public static string CommitID { + get { + return ResourceManager.GetString("CommitID", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact. + /// + public static string Contact { + get { + return ResourceManager.GetString("Contact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Info. + /// + public static string Info { + get { + return ResourceManager.GetString("Info", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please enter an OpenAI model in the settings.. + /// + public static string ModelMissing { + get { + return ResourceManager.GetString("ModelMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New version: . + /// + public static string NewVersion { + get { + return ResourceManager.GetString("NewVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No update available. + /// + public static string NoUpdateAvailable { + get { + return ResourceManager.GetString("NoUpdateAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You are currently using the latest version of {0}!. + /// + public static string NoUpdateAvailableDescription { + get { + return ResourceManager.GetString("NoUpdateAvailableDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OpenAI. + /// + public static string OpenAI { + get { + return ResourceManager.GetString("OpenAI", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to API key. + /// + public static string OpenAIApiKey { + get { + return ResourceManager.GetString("OpenAIApiKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Model. + /// + public static string OpenAIModel { + get { + return ResourceManager.GetString("OpenAIModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Which OpenAI model should be used for text enhancements. + /// + ///Zum Beispiel: + ///• gpt-3.5-turbo + ///• gpt-4 + ///• gpt-4-1106-preview. + /// + public static string OpenAIModelTooltip { + get { + return ResourceManager.GetString("OpenAIModelTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open-source. + /// + public static string OpenSource { + get { + return ResourceManager.GetString("OpenSource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open-source libraries. + /// + public static string OpenSourceLibraries { + get { + return ResourceManager.GetString("OpenSourceLibraries", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} would not have been possible without these open-source libraries. + /// + ///That's why I wanna say a big thank you to all developers of these libraries.. + /// + public static string OpenSourcePraise { + get { + return ResourceManager.GetString("OpenSourcePraise", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Settings. + /// + public static string Settings { + get { + return ResourceManager.GetString("Settings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutdown. + /// + public static string Shutdown { + get { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start {0} automatically with Windows. + /// + public static string StartWithWindows { + get { + return ResourceManager.GetString("StartWithWindows", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The version of the currently shown text. + /// + ///Previous version: + ///ALT+Left + /// + ///Next version: + ///ALT+Right. + /// + public static string StepperTooltip { + get { + return ResourceManager.GetString("StepperTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Text. + /// + public static string Text { + get { + return ResourceManager.GetString("Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string TextEnhancement { + get { + return ResourceManager.GetString("TextEnhancement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instructions how the text should be improved. + /// + public static string TextEnhancementPlaceholder { + get { + return ResourceManager.GetString("TextEnhancementPlaceholder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update { + get { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update available. + /// + public static string UpdateAvailable { + get { + return ResourceManager.GetString("UpdateAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An update for {0} is available!. + /// + public static string UpdateAvailableDescription { + get { + return ResourceManager.GetString("UpdateAvailableDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update now!. + /// + public static string UpdateNow { + get { + return ResourceManager.GetString("UpdateNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Version. + /// + public static string Version { + get { + return ResourceManager.GetString("Version", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your version: . + /// + public static string YourVersion { + get { + return ResourceManager.GetString("YourVersion", resourceCulture); + } + } + } +} diff --git a/src/ChatPrisma/Resources/Strings.de.Designer.cs b/src/ChatPrisma/Resources/Strings.de.Designer.cs new file mode 100644 index 0000000..67d3db5 --- /dev/null +++ b/src/ChatPrisma/Resources/Strings.de.Designer.cs @@ -0,0 +1,382 @@ +//------------------------------------------------------------------------------ +// +// 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 ChatPrisma.Resources { + 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", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Strings_de { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings_de() { + } + + /// + /// 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("ChatPrisma.Resources.Strings.de", typeof(Strings_de).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 Über. + /// + public static string About { + get { + return ResourceManager.GetString("About", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Den Text akzeptieren und in die Zwischenablage kopieren. + ///STRG+Enter. + /// + public static string AcceptTextTooltip { + get { + return ResourceManager.GetString("AcceptTextTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bitte tragen Sie einen OpenAI API-Key in den Einstellungen ein.. + /// + public static string ApiKeyMissing { + get { + return ResourceManager.GetString("ApiKeyMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to auto. einfügen. + /// + public static string AutoInsert { + get { + return ResourceManager.GetString("AutoInsert", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wenn angehakt, wird der Text automatisch in der vorherigen Anwendung eingefügt.. + /// + public static string AutoInsertTooltip { + get { + return ResourceManager.GetString("AutoInsertTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Autostart. + /// + public static string Autostart { + get { + return ResourceManager.GetString("Autostart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nach Updates suchen. + /// + public static string CheckForUpdates { + get { + return ResourceManager.GetString("CheckForUpdates", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Commit-ID:. + /// + public static string CommitID { + get { + return ResourceManager.GetString("CommitID", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kontakt. + /// + public static string Contact { + get { + return ResourceManager.GetString("Contact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Info. + /// + public static string Info { + get { + return ResourceManager.GetString("Info", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Bitte tragen Sie ein OpenAI Model in den Einstellungen ein.. + /// + public static string ModelMissing { + get { + return ResourceManager.GetString("ModelMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Neue Version: . + /// + public static string NewVersion { + get { + return ResourceManager.GetString("NewVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kein Update verfügbar. + /// + public static string NoUpdateAvailable { + get { + return ResourceManager.GetString("NoUpdateAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sie verwenden im Moment die aktuellste Version von {0}!. + /// + public static string NoUpdateAvailableDescription { + get { + return ResourceManager.GetString("NoUpdateAvailableDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OpenAI. + /// + public static string OpenAI { + get { + return ResourceManager.GetString("OpenAI", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to API-Key. + /// + public static string OpenAIApiKey { + get { + return ResourceManager.GetString("OpenAIApiKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Model. + /// + public static string OpenAIModel { + get { + return ResourceManager.GetString("OpenAIModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Welches Model von OpenAI für die Textverbesserung verwendet werden soll. + /// + ///Zum Beispiel: + ///• gpt-3.5-turbo + ///• gpt-4 + ///• gpt-4-1106-preview. + /// + public static string OpenAIModelTooltip { + get { + return ResourceManager.GetString("OpenAIModelTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open-Source. + /// + public static string OpenSource { + get { + return ResourceManager.GetString("OpenSource", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open-Source Bibliotheken. + /// + public static string OpenSourceLibraries { + get { + return ResourceManager.GetString("OpenSourceLibraries", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} wäre ohne die Unterstützung dieser Open-Source-Bibliotheken nicht möglich gewesen. + /// + ///Daher möchte ich mich herzlich bei allen Entwicklern dieser Bibliotheken bedanken.. + /// + public static string OpenSourcePraise { + get { + return ResourceManager.GetString("OpenSourcePraise", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Einstellungen. + /// + public static string Settings { + get { + return ResourceManager.GetString("Settings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Beenden. + /// + public static string Shutdown { + get { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} automatisch mit Windows starten. + /// + public static string StartWithWindows { + get { + return ResourceManager.GetString("StartWithWindows", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Die Version des aktuell angezeigten Textes. + /// + ///Vorherige Version: + ///ALT+Links + /// + ///Nächste Version: + ///ALT+Rechts. + /// + public static string StepperTooltip { + get { + return ResourceManager.GetString("StepperTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Text. + /// + public static string Text { + get { + return ResourceManager.GetString("Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Änderungen. + /// + public static string TextEnhancement { + get { + return ResourceManager.GetString("TextEnhancement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Anweisung wie der Text verbessert werden soll. + /// + public static string TextEnhancementPlaceholder { + get { + return ResourceManager.GetString("TextEnhancementPlaceholder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update { + get { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update verfügbar. + /// + public static string UpdateAvailable { + get { + return ResourceManager.GetString("UpdateAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ein Update für {0} steht zur Verfügung! . + /// + public static string UpdateAvailableDescription { + get { + return ResourceManager.GetString("UpdateAvailableDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Jetzt updaten!. + /// + public static string UpdateNow { + get { + return ResourceManager.GetString("UpdateNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Version. + /// + public static string Version { + get { + return ResourceManager.GetString("Version", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ihre Version: . + /// + public static string YourVersion { + get { + return ResourceManager.GetString("YourVersion", resourceCulture); + } + } + } +} diff --git a/src/ChatPrisma/Resources/Strings.de.resx b/src/ChatPrisma/Resources/Strings.de.resx new file mode 100644 index 0000000..fce584f --- /dev/null +++ b/src/ChatPrisma/Resources/Strings.de.resx @@ -0,0 +1,137 @@ + + + + + + + + + + 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 + + + Über + + + Info + + + Version + + + Commit-ID: + + + Open-Source Bibliotheken + + + Kontakt + + + {0} wäre ohne die Unterstützung dieser Open-Source-Bibliotheken nicht möglich gewesen. + +Daher möchte ich mich herzlich bei allen Entwicklern dieser Bibliotheken bedanken. + + + Open-Source + + + Autostart + + + OpenAI + + + API-Key + + + Model + + + Einstellungen + + + {0} automatisch mit Windows starten + + + Welches Model von OpenAI für die Textverbesserung verwendet werden soll. + +Zum Beispiel: +• gpt-3.5-turbo +• gpt-4 +• gpt-4-1106-preview + + + Bitte tragen Sie einen OpenAI API-Key in den Einstellungen ein. + + + Bitte tragen Sie ein OpenAI Model in den Einstellungen ein. + + + Text + + + Die Version des aktuell angezeigten Textes. + +Vorherige Version: +ALT+Links + +Nächste Version: +ALT+Rechts + + + auto. einfügen + + + Wenn angehakt, wird der Text automatisch in der vorherigen Anwendung eingefügt. + + + Den Text akzeptieren und in die Zwischenablage kopieren. +STRG+Enter + + + Änderungen + + + Anweisung wie der Text verbessert werden soll + + + Neue Version: + + + Kein Update verfügbar + + + Sie verwenden im Moment die aktuellste Version von {0}! + + + Update verfügbar + + + Ein Update für {0} steht zur Verfügung! + + + Jetzt updaten! + + + Ihre Version: + + + Update + + + Nach Updates suchen + + + Beenden + + \ No newline at end of file diff --git a/src/ChatPrisma/Resources/Strings.resx b/src/ChatPrisma/Resources/Strings.resx new file mode 100644 index 0000000..5b84f84 --- /dev/null +++ b/src/ChatPrisma/Resources/Strings.resx @@ -0,0 +1,137 @@ + + + + + + + + + + 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 + + + About + + + Info + + + Commit-ID: + + + Contact + + + Open-source libraries + + + Version + + + {0} would not have been possible without these open-source libraries. + +That's why I wanna say a big thank you to all developers of these libraries. + + + Open-source + + + Settings + + + Autostart + + + Start {0} automatically with Windows + + + OpenAI + + + Model + + + API key + + + Which OpenAI model should be used for text enhancements. + +Zum Beispiel: +• gpt-3.5-turbo +• gpt-4 +• gpt-4-1106-preview + + + Please enter an OpenAI API key in the settings. + + + Please enter an OpenAI model in the settings. + + + Text + + + The version of the currently shown text. + +Previous version: +ALT+Left + +Next version: +ALT+Right + + + auto. insert + + + If checked, the text will be automatically inserted into the previous application. + + + Accept the text and copy it into the clipboard. +CTRL+Enter + + + Change + + + Instructions how the text should be improved + + + Update available + + + An update for {0} is available! + + + Your version: + + + New version: + + + Update now! + + + No update available + + + You are currently using the latest version of {0}! + + + Update + + + Check for updates + + + Shutdown + + \ No newline at end of file diff --git a/src/ChatPrisma/Services/ChatBot/OpenAIChatBotService.cs b/src/ChatPrisma/Services/ChatBot/OpenAIChatBotService.cs index a88a5e1..884cd89 100644 --- a/src/ChatPrisma/Services/ChatBot/OpenAIChatBotService.cs +++ b/src/ChatPrisma/Services/ChatBot/OpenAIChatBotService.cs @@ -1,6 +1,7 @@ using System.Runtime.CompilerServices; using Azure.AI.OpenAI; using ChatPrisma.Options; +using ChatPrisma.Resources; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -13,13 +14,13 @@ public async IAsyncEnumerable GetResponse(List messag var client = this.GetClient(); if (client is null) { - yield return "Bitte tragen Sie einen OpenAI API-Key in den Einstellungen ein."; + yield return Strings.ApiKeyMissing; yield break; } if (string.IsNullOrWhiteSpace(openAiConfig.CurrentValue.Model)) { - yield return "Bitte tragen Sie ein OpenAI Model in den Einstellungen ein."; + yield return Strings.ModelMissing; yield break; } diff --git a/src/ChatPrisma/Views/About/AboutView.xaml b/src/ChatPrisma/Views/About/AboutView.xaml index 8ee9826..469caba 100644 --- a/src/ChatPrisma/Views/About/AboutView.xaml +++ b/src/ChatPrisma/Views/About/AboutView.xaml @@ -4,7 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ChatPrisma.Views.About" xmlns:themes="clr-namespace:ChatPrisma.Themes" - xmlns:svgc="http://sharpvectors.codeplex.com/svgc/" + xmlns:resources="clr-namespace:ChatPrisma.Resources" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" @@ -12,23 +12,19 @@ d:DataContext="{d:DesignInstance local:AboutViewModel}" - themes:Attached.WindowTitle="Über"> + themes:Attached.WindowTitle="{x:Static resources:Strings.About}"> - - + @@ -38,11 +34,11 @@ - + - + @@ -50,20 +46,13 @@ - + - - - + diff --git a/src/ChatPrisma/Views/OpenSource/OpenSourceView.xaml b/src/ChatPrisma/Views/OpenSource/OpenSourceView.xaml index 4d71d52..0b2ddee 100644 --- a/src/ChatPrisma/Views/OpenSource/OpenSourceView.xaml +++ b/src/ChatPrisma/Views/OpenSource/OpenSourceView.xaml @@ -1,25 +1,22 @@  - + - - - + diff --git a/src/ChatPrisma/Views/Settings/SettingsView.xaml b/src/ChatPrisma/Views/Settings/SettingsView.xaml index b354e9e..bd7119d 100644 --- a/src/ChatPrisma/Views/Settings/SettingsView.xaml +++ b/src/ChatPrisma/Views/Settings/SettingsView.xaml @@ -3,6 +3,7 @@ xmlns:local="clr-namespace:ChatPrisma.Views.Settings" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:themes="clr-namespace:ChatPrisma.Themes" + xmlns:resources="clr-namespace:ChatPrisma.Resources" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" @@ -10,37 +11,24 @@ d:DataContext="{d:DesignInstance local:SettingsViewModel}" - themes:Attached.WindowTitle="Einstellungen" + themes:Attached.WindowTitle="{x:Static resources:Strings.Settings}" Width="400"> - + - - - - + - + - - - - - - - - - - - - - + diff --git a/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml b/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml index c5ac985..78ac54c 100644 --- a/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml +++ b/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml @@ -4,6 +4,7 @@ xmlns:local="clr-namespace:ChatPrisma.Views.TextEnhancement" xmlns:themes="clr-namespace:ChatPrisma.Themes" xmlns:wpf="clr-namespace:FluentIcons.WPF;assembly=FluentIcons.WPF" + xmlns:resources="clr-namespace:ChatPrisma.Resources" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" @@ -26,26 +27,15 @@ - + - - - - - Vorherige Version: - - - Nächste Version: - - - - + NextCommand="{Binding NextVersionCommand}" + ToolTip="{x:Static resources:Strings.StepperTooltip}" /> + Content="{x:Static resources:Strings.AutoInsert}" + ToolTip="{x:Static resources:Strings.AutoInsertTooltip}"/> @@ -90,10 +75,10 @@ - + diff --git a/src/ChatPrisma/Views/Update/UpdateView.xaml b/src/ChatPrisma/Views/Update/UpdateView.xaml index 61d08b7..cee86cc 100644 --- a/src/ChatPrisma/Views/Update/UpdateView.xaml +++ b/src/ChatPrisma/Views/Update/UpdateView.xaml @@ -5,6 +5,7 @@ xmlns:dxmvvm="clr-namespace:DevExpress.Mvvm.UI;assembly=DevExpress.Mvvm.UI" xmlns:themes="clr-namespace:ChatPrisma.Themes" xmlns:svgc="http://sharpvectors.codeplex.com/svgc/" + xmlns:resources="clr-namespace:ChatPrisma.Resources" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" @@ -12,7 +13,7 @@ d:DataContext="{d:DesignInstance local:UpdateViewModel}" - themes:Attached.WindowTitle="Update"> + themes:Attached.WindowTitle="{x:Static resources:Strings.Update}"> @@ -33,17 +34,17 @@ - + - - + + -