From c1f924f8799080a5b199357ddfd2e064a617924f Mon Sep 17 00:00:00 2001 From: JT Date: Sun, 10 Sep 2023 16:01:15 -0700 Subject: [PATCH] Moved more xaml strings to Resources for localization & fix connected model imports not adding to installedmodels list --- CHANGELOG.md | 4 +- .../Languages/Resources.Designer.cs | 531 ++++++++++++++++++ .../Languages/Resources.ja-JP.resx | 33 ++ .../Languages/Resources.resx | 177 ++++++ .../Views/CheckpointBrowserPage.axaml | 31 +- .../Views/CheckpointsPage.axaml | 34 +- .../Views/Dialogs/ExceptionDialog.axaml | 5 +- .../Views/Dialogs/InstallerDialog.axaml | 23 +- .../Views/Dialogs/OneClickInstallDialog.axaml | 5 +- .../Dialogs/PackageModificationDialog.axaml | 5 +- .../Dialogs/SelectDataDirectoryDialog.axaml | 13 +- .../Dialogs/SelectModelVersionDialog.axaml | 11 +- .../Views/Dialogs/UpdateDialog.axaml | 3 +- .../Views/FirstLaunchSetupWindow.axaml | 11 +- .../Views/MainWindow.axaml | 9 +- StabilityMatrix/Models/CheckpointFolder.cs | 169 +++--- 16 files changed, 930 insertions(+), 134 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae22f97c..179d26d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,9 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 ### Fixed - Fixed [#97](https://github.com/LykosAI/StabilityMatrix/issues/97) - Codeformer folder should now get linked correctly - Fixed [#106](https://github.com/LykosAI/StabilityMatrix/issues/106) - ComfyUI should now install correctly on Windows machines with an AMD GPU using DirectML -- Fixed [#107](https://github.com/LykosAI/StabilityMatrix/issues/107) - Added `--autolaunch` option to SD.Next +- Fixed [#107](https://github.com/LykosAI/StabilityMatrix/issues/107) - Added `--autolaunch` option to SD.Next +- Fixed [#110](https://github.com/LykosAI/StabilityMatrix/issues/110) - Model Browser should properly navigate to the next page of Installed models +- Installed tag on model browser should now show for connected models imported via drag & drop ## v2.3.4 ### Fixed diff --git a/StabilityMatrix.Avalonia/Languages/Resources.Designer.cs b/StabilityMatrix.Avalonia/Languages/Resources.Designer.cs index f107c620..f27f2232 100644 --- a/StabilityMatrix.Avalonia/Languages/Resources.Designer.cs +++ b/StabilityMatrix.Avalonia/Languages/Resources.Designer.cs @@ -68,6 +68,42 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Close. + /// + public static string Action_Close { + get { + return ResourceManager.GetString("Action_Close", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Action_Continue { + get { + return ResourceManager.GetString("Action_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Action_Delete { + get { + return ResourceManager.GetString("Action_Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exit Application. + /// + public static string Action_ExitApplication { + get { + return ResourceManager.GetString("Action_ExitApplication", resourceCulture); + } + } + /// /// Looks up a localized string similar to Import. /// @@ -77,6 +113,15 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Install. + /// + public static string Action_Install { + get { + return ResourceManager.GetString("Action_Install", resourceCulture); + } + } + /// /// Looks up a localized string similar to Launch. /// @@ -86,6 +131,24 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to New. + /// + public static string Action_New { + get { + return ResourceManager.GetString("Action_New", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open on CivitAI. + /// + public static string Action_OpenOnCivitAi { + get { + return ResourceManager.GetString("Action_OpenOnCivitAi", resourceCulture); + } + } + /// /// Looks up a localized string similar to Quit. /// @@ -113,6 +176,15 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Rename. + /// + public static string Action_Rename { + get { + return ResourceManager.GetString("Action_Rename", resourceCulture); + } + } + /// /// Looks up a localized string similar to Save. /// @@ -122,6 +194,60 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Search. + /// + public static string Action_Search { + get { + return ResourceManager.GetString("Action_Search", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show in Explorer. + /// + public static string Action_ShowInExplorer { + get { + return ResourceManager.GetString("Action_ShowInExplorer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Advanced Options. + /// + public static string Label_AdvancedOptions { + get { + return ResourceManager.GetString("Label_AdvancedOptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to All Versions. + /// + public static string Label_AllVersions { + get { + return ResourceManager.GetString("Label_AllVersions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Model. + /// + public static string Label_BaseModel { + get { + return ResourceManager.GetString("Label_BaseModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Become a Patron. + /// + public static string Label_BecomeAPatron { + get { + return ResourceManager.GetString("Label_BecomeAPatron", resourceCulture); + } + } + /// /// Looks up a localized string similar to Branches. /// @@ -131,6 +257,87 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Categories. + /// + public static string Label_Categories { + get { + return ResourceManager.GetString("Label_Categories", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Close dialog when finished. + /// + public static string Label_CloseDialogWhenFinished { + get { + return ResourceManager.GetString("Label_CloseDialogWhenFinished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Commit. + /// + public static string Label_Commit { + get { + return ResourceManager.GetString("Label_Commit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connected Model. + /// + public static string Label_ConnectedModel { + get { + return ResourceManager.GetString("Label_ConnectedModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Data Directory. + /// + public static string Label_DataDirectory { + get { + return ResourceManager.GetString("Label_DataDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is where model checkpoints, LORAs, web UIs, settings, etc. will be installed.. + /// + public static string Label_DataDirectoryExplanation { + get { + return ResourceManager.GetString("Label_DataDirectoryExplanation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Data provided by CivitAI. + /// + public static string Label_DataProvidedByCivitAi { + get { + return ResourceManager.GetString("Label_DataProvidedByCivitAi", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Display Name. + /// + public static string Label_DisplayName { + get { + return ResourceManager.GetString("Label_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Downloads. + /// + public static string Label_Downloads { + get { + return ResourceManager.GetString("Label_Downloads", resourceCulture); + } + } + /// /// Looks up a localized string similar to Drag & Drop checkpoints here to import. /// @@ -140,6 +347,96 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Drop file here to import. + /// + public static string Label_DropFileToImport { + get { + return ResourceManager.GetString("Label_DropFileToImport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You may encounter errors when using a FAT32 or exFAT drive. Select a different drive for a smoother experience.. + /// + public static string Label_FatWarning { + get { + return ResourceManager.GetString("Label_FatWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to First Page. + /// + public static string Label_FirstPage { + get { + return ResourceManager.GetString("Label_FirstPage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Folder. + /// + public static string Label_Folder { + get { + return ResourceManager.GetString("Label_Folder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Import as Connected. + /// + public static string Label_ImportAsConnected { + get { + return ResourceManager.GetString("Label_ImportAsConnected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Search for connected metadata on new local imports. + /// + public static string Label_ImportAsConnectedExplanation { + get { + return ResourceManager.GetString("Label_ImportAsConnectedExplanation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Import Latest -. + /// + public static string Label_ImportLatest { + get { + return ResourceManager.GetString("Label_ImportLatest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Indexing.... + /// + public static string Label_Indexing { + get { + return ResourceManager.GetString("Label_Indexing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An installation with this name already exists.. + /// + public static string Label_InstallationWithThisNameExists { + get { + return ResourceManager.GetString("Label_InstallationWithThisNameExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Join Discord Server. + /// + public static string Label_JoinDiscord { + get { + return ResourceManager.GetString("Label_JoinDiscord", resourceCulture); + } + } + /// /// Looks up a localized string similar to Language. /// @@ -149,6 +446,105 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Last Page. + /// + public static string Label_LastPage { + get { + return ResourceManager.GetString("Label_LastPage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Let's get started. + /// + public static string Label_LetsGetStarted { + get { + return ResourceManager.GetString("Label_LetsGetStarted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to License Agreement.. + /// + public static string Label_LicenseAgreement { + get { + return ResourceManager.GetString("Label_LicenseAgreement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Local Model. + /// + public static string Label_LocalModel { + get { + return ResourceManager.GetString("Label_LocalModel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Model Description. + /// + public static string Label_ModelDescription { + get { + return ResourceManager.GetString("Label_ModelDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Search models, #tags, or @users. + /// + public static string Label_ModelSearchWatermark { + get { + return ResourceManager.GetString("Label_ModelSearchWatermark", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Models Folder. + /// + public static string Label_ModelsFolder { + get { + return ResourceManager.GetString("Label_ModelsFolder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Model Type. + /// + public static string Label_ModelType { + get { + return ResourceManager.GetString("Label_ModelType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A new version of Stability Matrix is available!. + /// + public static string Label_NewVersionAvailable { + get { + return ResourceManager.GetString("Label_NewVersionAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Next Image. + /// + public static string Label_NextImage { + get { + return ResourceManager.GetString("Label_NextImage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Next Page. + /// + public static string Label_NextPage { + get { + return ResourceManager.GetString("Label_NextPage", resourceCulture); + } + } + /// /// Looks up a localized string similar to Package Type. /// @@ -158,6 +554,78 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Page. + /// + public static string Label_Page { + get { + return ResourceManager.GetString("Label_Page", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please choose a different name or select a different install location.. + /// + public static string Label_PleaseChooseDifferentName { + get { + return ResourceManager.GetString("Label_PleaseChooseDifferentName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Portable Mode. + /// + public static string Label_PortableMode { + get { + return ResourceManager.GetString("Label_PortableMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to In Portable Mode, all data and settings will be stored in the same directory as the application. You will be able to move the application with its 'Data' folder to a different location or computer.. + /// + public static string Label_PortableModeExplanation { + get { + return ResourceManager.GetString("Label_PortableModeExplanation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Previous Image. + /// + public static string Label_PreviousImage { + get { + return ResourceManager.GetString("Label_PreviousImage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Previous Page. + /// + public static string Label_PreviousPage { + get { + return ResourceManager.GetString("Label_PreviousPage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PyTorch Version. + /// + public static string Label_PyTorchVersion { + get { + return ResourceManager.GetString("Label_PyTorchVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to I have read and agree to the. + /// + public static string Label_ReadAndAgree { + get { + return ResourceManager.GetString("Label_ReadAndAgree", resourceCulture); + } + } + /// /// Looks up a localized string similar to Relaunch Required. /// @@ -176,6 +644,60 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Shared Model Folder Strategy. + /// + public static string Label_SharedModelFolderStrategy { + get { + return ResourceManager.GetString("Label_SharedModelFolderStrategy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show NSFW Content. + /// + public static string Label_ShowNsfwContent { + get { + return ResourceManager.GetString("Label_ShowNsfwContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skip first-time setup. + /// + public static string Label_SkipSetup { + get { + return ResourceManager.GetString("Label_SkipSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sort. + /// + public static string Label_Sort { + get { + return ResourceManager.GetString("Label_Sort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Period. + /// + public static string Label_TimePeriod { + get { + return ResourceManager.GetString("Label_TimePeriod", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An unexpected error occurred. + /// + public static string Label_UnexpectedErrorOccurred { + get { + return ResourceManager.GetString("Label_UnexpectedErrorOccurred", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unknown Package. /// @@ -185,6 +707,15 @@ namespace StabilityMatrix.Avalonia.Languages { } } + /// + /// Looks up a localized string similar to Update Available. + /// + public static string Label_UpdateAvailable { + get { + return ResourceManager.GetString("Label_UpdateAvailable", resourceCulture); + } + } + /// /// Looks up a localized string similar to Version. /// diff --git a/StabilityMatrix.Avalonia/Languages/Resources.ja-JP.resx b/StabilityMatrix.Avalonia/Languages/Resources.ja-JP.resx index ccd583bf..4fcc66bd 100644 --- a/StabilityMatrix.Avalonia/Languages/Resources.ja-JP.resx +++ b/StabilityMatrix.Avalonia/Languages/Resources.ja-JP.resx @@ -20,4 +20,37 @@ 言語 + + アプリケーションを終了する + + + インポート + + + インストール + + + 打ち上げる + + + 再起動する + + + やめる + + + 後で再起動する + + + パトロンになる + + + ブランチ + + + 期間 + + + 注文 + diff --git a/StabilityMatrix.Avalonia/Languages/Resources.resx b/StabilityMatrix.Avalonia/Languages/Resources.resx index 414b5870..a825e8bb 100644 --- a/StabilityMatrix.Avalonia/Languages/Resources.resx +++ b/StabilityMatrix.Avalonia/Languages/Resources.resx @@ -69,4 +69,181 @@ Drag & Drop checkpoints here to import + + Update Available + + + Become a Patron + + + Join Discord Server + + + Downloads + + + Install + + + Skip first-time setup + + + An unexpected error occurred + + + Exit Application + + + Display Name + + + An installation with this name already exists. + + + Please choose a different name or select a different install location. + + + Advanced Options + + + Commit + + + Shared Model Folder Strategy + + + PyTorch Version + + + Close dialog when finished + + + Close + + + Data Directory + + + This is where model checkpoints, LORAs, web UIs, settings, etc. will be installed. + + + You may encounter errors when using a FAT32 or exFAT drive. Select a different drive for a smoother experience. + + + Portable Mode + + + In Portable Mode, all data and settings will be stored in the same directory as the application. You will be able to move the application with its 'Data' folder to a different location or computer. + + + Continue + + + Previous Image + + + Next Image + + + Model Description + + + A new version of Stability Matrix is available! + + + Import Latest - + + + All Versions + + + Search models, #tags, or @users + + + Search + + + Sort + + + Period + + + Model Type + + + Base Model + + + Show NSFW Content + + + Data provided by CivitAI + + + Page + + + First Page + + + Previous Page + + + Next Page + + + Last Page + + + Rename + + + Delete + + + Open on CivitAI + + + Connected Model + + + Local Model + + + Show in Explorer + + + New + + + Folder + + + Drop file here to import + + + Import as Connected + + + Search for connected metadata on new local imports + + + Indexing... + + + Models Folder + + + Categories + + + Let's get started + + + I have read and agree to the + + + License Agreement. + diff --git a/StabilityMatrix.Avalonia/Views/CheckpointBrowserPage.axaml b/StabilityMatrix.Avalonia/Views/CheckpointBrowserPage.axaml index 2a4a3541..ec5c557e 100644 --- a/StabilityMatrix.Avalonia/Views/CheckpointBrowserPage.axaml +++ b/StabilityMatrix.Avalonia/Views/CheckpointBrowserPage.axaml @@ -9,6 +9,7 @@ xmlns:vm="clr-namespace:StabilityMatrix.Avalonia.ViewModels.CheckpointManager" xmlns:checkpointBrowser="clr-namespace:StabilityMatrix.Avalonia.ViewModels.CheckpointBrowser" xmlns:avalonia="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia" + xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="700" x:DataType="viewModels:CheckpointBrowserViewModel" d:DataContext="{x:Static designData:DesignData.CheckpointBrowserViewModel}" @@ -149,7 +150,7 @@ Margin="0,8,0,0"> - + @@ -162,7 +163,7 @@ IsEnabled="{Binding !IsImporting}" Command="{Binding ShowVersionDialogCommand}" CommandParameter="{Binding CivitModel}" - Content="All Versions" /> + Content="{x:Static lang:Resources.Label_AllVersions}" /> @@ -177,7 +178,7 @@ diff --git a/StabilityMatrix.Avalonia/Views/CheckpointsPage.axaml b/StabilityMatrix.Avalonia/Views/CheckpointsPage.axaml index 860f77b3..18844013 100644 --- a/StabilityMatrix.Avalonia/Views/CheckpointsPage.axaml +++ b/StabilityMatrix.Avalonia/Views/CheckpointsPage.axaml @@ -54,11 +54,11 @@ + Text="{x:Static lang:Resources.Action_Rename}" IconSource="Rename" /> + Text="{x:Static lang:Resources.Action_Delete}" IconSource="Delete" /> @@ -135,7 +135,7 @@ + ToolTip.Tip="{x:Static lang:Resources.Label_ConnectedModel}" /> - - - + - @@ -284,7 +284,7 @@ Effect="{StaticResource TextDropShadowEffect}" FontSize="24" HorizontalAlignment="Center" - Text="Drop file here to import" + Text="{x:Static lang:Resources.Label_DropFileToImport}" VerticalAlignment="Center" IsVisible="{Binding IsCurrentDragTarget}" /> + ToolTip.Tip="{x:Static lang:Resources.Label_ImportAsConnectedExplanation}" /> @@ -382,15 +382,15 @@ BorderThickness="4" IsIndeterminate="True" IsVisible="{Binding IsIndexing}"/> - diff --git a/StabilityMatrix.Avalonia/Views/Dialogs/ExceptionDialog.axaml b/StabilityMatrix.Avalonia/Views/Dialogs/ExceptionDialog.axaml index 80e41576..f3912584 100644 --- a/StabilityMatrix.Avalonia/Views/Dialogs/ExceptionDialog.axaml +++ b/StabilityMatrix.Avalonia/Views/Dialogs/ExceptionDialog.axaml @@ -5,6 +5,7 @@ xmlns:dialogs="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Dialogs" xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData" xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls" + xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages" d:DataContext="{x:Static mocks:DesignData.ExceptionViewModel}" x:DataType="dialogs:ExceptionViewModel" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="550" @@ -21,7 +22,7 @@ Grid.Row="0" Theme="{DynamicResource SubtitleTextBlockStyle}" Margin="16" - Text="An unexpected error occured" + Text="{x:Static lang:Resources.Label_UnexpectedErrorOccurred}" TextWrapping="Wrap" VerticalAlignment="Top" /> @@ -74,7 +75,7 @@ @@ -164,7 +165,7 @@ @@ -179,14 +180,14 @@ Margin="0,8,0,0" HorizontalAlignment="Center">