From b1185322c78eb30366699157e9d739a90387029b Mon Sep 17 00:00:00 2001 From: IridiumIO Date: Wed, 26 Aug 2026 15:10:18 +1000 Subject: [PATCH 01/25] Version bump --- CompactGUI/Application.xaml.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CompactGUI/Application.xaml.vb b/CompactGUI/Application.xaml.vb index 2faaac8..ea26da1 100644 --- a/CompactGUI/Application.xaml.vb +++ b/CompactGUI/Application.xaml.vb @@ -17,7 +17,7 @@ Imports Coravel.Scheduling.Schedule Partial Public Class Application - Public Shared ReadOnly AppVersion As New SemVersion(4, 0, 0, "beta", 8) + Public Shared ReadOnly AppVersion As New SemVersion(4, 0, 0, "beta", 9) Public Shared ReadOnly Property AppVersionText As String Get From ea38b4bf8e3a1d0bc351387678ff2e68ab930e43 Mon Sep 17 00:00:00 2001 From: IridiumIO Date: Sat, 29 Aug 2026 14:23:41 +1000 Subject: [PATCH 02/25] Transition to TOML --- CompactGUI.Core/Settings/Settings.cs | 2 +- CompactGUI.slnx | 2 + CompactGUI/Application.xaml.vb | 6 +- CompactGUI/CompactGUI.vbproj | 28 +- .../Components/Converters/IValueConverters.vb | 36 +- .../Settings/Settings_skiplistflyout.xaml | 35 +- CompactGUI/LanguageHelper.vb | 143 -- CompactGUI/MainWindow.xaml | 19 +- CompactGUI/Resources/Localisation/en-AU.toml | 167 ++ CompactGUI/Resources/Localisation/es-ES.toml | 190 ++ CompactGUI/Resources/Localisation/ru-RU.toml | 190 ++ CompactGUI/Resources/Localisation/zh-CN.toml | 190 ++ CompactGUI/Services/ApplicationHostService.vb | 6 +- CompactGUI/Services/CustomSnackBarService.vb | 32 +- CompactGUI/Services/LocalisationService.vb | 43 + CompactGUI/Services/WindowService.vb | 4 +- CompactGUI/ViewModels/FolderViewModel.vb | 4 +- CompactGUI/ViewModels/MainWindowViewModel.vb | 4 +- CompactGUI/ViewModels/SettingsViewModel.vb | 24 +- .../Components/CompressionMode_Radio.xaml | 10 +- .../Views/Components/FolderWatcherCard.xaml | 86 +- CompactGUI/Views/Pages/DatabasePage.xaml | 80 +- CompactGUI/Views/Pages/FolderView.xaml | 14 +- CompactGUI/Views/Pages/HomePage.xaml | 20 +- .../Views/Pages/PendingCompression.xaml | 38 +- CompactGUI/Views/Pages/ResultsTemplate.xaml | 43 +- CompactGUI/Views/Pages/WatcherPage.xaml | 5 +- CompactGUI/Views/SettingsPage.xaml | 149 +- CompactGUI/Views/SettingsPage.xaml.vb | 43 +- CompactGUI/i18n/i18n.Designer.vb | 1542 ----------------- CompactGUI/i18n/i18n.es-ES.Designer.vb | 1398 --------------- CompactGUI/i18n/i18n.es-ES.resx | 579 ------- CompactGUI/i18n/i18n.resx | 626 ------- CompactGUI/i18n/i18n.ru-RU.resx | 625 ------- CompactGUI/i18n/i18n.zh-CN.resx | 599 ------- ResXManager.config.xml | 4 - 36 files changed, 1069 insertions(+), 5917 deletions(-) delete mode 100644 CompactGUI/LanguageHelper.vb create mode 100644 CompactGUI/Resources/Localisation/en-AU.toml create mode 100644 CompactGUI/Resources/Localisation/es-ES.toml create mode 100644 CompactGUI/Resources/Localisation/ru-RU.toml create mode 100644 CompactGUI/Resources/Localisation/zh-CN.toml create mode 100644 CompactGUI/Services/LocalisationService.vb delete mode 100644 CompactGUI/i18n/i18n.Designer.vb delete mode 100644 CompactGUI/i18n/i18n.es-ES.Designer.vb delete mode 100644 CompactGUI/i18n/i18n.es-ES.resx delete mode 100644 CompactGUI/i18n/i18n.resx delete mode 100644 CompactGUI/i18n/i18n.ru-RU.resx delete mode 100644 CompactGUI/i18n/i18n.zh-CN.resx delete mode 100644 ResXManager.config.xml diff --git a/CompactGUI.Core/Settings/Settings.cs b/CompactGUI.Core/Settings/Settings.cs index 2716e23..4c598fe 100644 --- a/CompactGUI.Core/Settings/Settings.cs +++ b/CompactGUI.Core/Settings/Settings.cs @@ -46,7 +46,7 @@ public partial class Settings : ObservableRecipient [ObservableProperty] private WindowState windowState = WindowState.Normal; [ObservableProperty] private bool alwaysShowDetailedCompressionMode = false; - [ObservableProperty] private string language = "en-US"; + [ObservableProperty] private string language = "en-AU"; partial void OnScheduledBackgroundIntervalChanged(int value) => UpdateNextScheduledBackgroundRun(); diff --git a/CompactGUI.slnx b/CompactGUI.slnx index 036be4e..363962b 100644 --- a/CompactGUI.slnx +++ b/CompactGUI.slnx @@ -13,4 +13,6 @@ + + diff --git a/CompactGUI/Application.xaml.vb b/CompactGUI/Application.xaml.vb index ea26da1..af52cc3 100644 --- a/CompactGUI/Application.xaml.vb +++ b/CompactGUI/Application.xaml.vb @@ -58,6 +58,7 @@ Partial Public Class Application 'Settings handler services.AddSingleton(Of ISettingsService)(SettingsService) + services.AddSingleton(Of LocalisationService)() services.AddLogging(Sub(logging) logging.SetMinimumLevel(SettingsService.AppSettings.LogLevel) @@ -131,7 +132,6 @@ Partial Public Class Application Return TryCast(_host?.Services.GetService(GetType(T)), T) End Function - Public Shared ReadOnly mutex As New Mutex(False, "Global\CompactGUI") Private pipeServerCancellation As New CancellationTokenSource() Private pipeServerTask As Task @@ -155,7 +155,7 @@ Partial Public Class Application End If InitializeHost() - LanguageHelper.Initialize(GetService(Of ISettingsService).AppSettings) + Await GetService(Of LocalisationService).InitializeAsync() GetService(Of Watcher.Watcher)() @@ -345,4 +345,4 @@ Partial Public Class Application ' End If 'End Function -End Class \ No newline at end of file +End Class diff --git a/CompactGUI/CompactGUI.vbproj b/CompactGUI/CompactGUI.vbproj index 53f273a..df0006d 100644 --- a/CompactGUI/CompactGUI.vbproj +++ b/CompactGUI/CompactGUI.vbproj @@ -45,6 +45,7 @@ + @@ -70,6 +71,8 @@ + + @@ -79,29 +82,8 @@ - - i18n.es-ES.resx - True - True - - - True - True - i18n.resx - - - - - - i18n - i18n.es-ES.Designer.vb - PublicResXFileCodeGenerator - - - i18n - PublicResXFileCodeGenerator - i18n.Designer.vb - + + diff --git a/CompactGUI/Components/Converters/IValueConverters.vb b/CompactGUI/Components/Converters/IValueConverters.vb index 01acbaf..1ed516c 100644 --- a/CompactGUI/Components/Converters/IValueConverters.vb +++ b/CompactGUI/Components/Converters/IValueConverters.vb @@ -18,13 +18,13 @@ Public Class BytesToReadableConverter : Implements IValueConverter Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert Dim suf As String() = { - LanguageHelper.GetString("SizeUnit_B"), - LanguageHelper.GetString("SizeUnit_KB"), - LanguageHelper.GetString("SizeUnit_MB"), - LanguageHelper.GetString("SizeUnit_GB"), - LanguageHelper.GetString("SizeUnit_TB"), - LanguageHelper.GetString("SizeUnit_PB"), - LanguageHelper.GetString("SizeUnit_EB") + "B".LT("File size"), + "KB".LT("File size"), + "MB".LT("File size"), + "GB".LT("File size"), + "TB".LT("File size"), + "PB".LT("File size"), + "EB".LT("File size") } If value = 1010101010101010 Then Return "?" @@ -102,16 +102,16 @@ Public Class RelativeDateConverter : Implements IValueConverter Dim ts As TimeSpan = DateTime.Now - dt If ts > TimeSpan.FromDays(19000) Then - Return LanguageHelper.GetString("Time_Unknown") + Return "Unknown".LT("Relative date") End If If ts > TimeSpan.FromDays(2) Then - Return String.Format(LanguageHelper.GetString("Time_DaysAgo"), ts.TotalDays) + Return "{0:0} days ago".LTF(ts.TotalDays) ElseIf ts > TimeSpan.FromHours(2) Then - Return String.Format(LanguageHelper.GetString("Time_HoursAgo"), ts.TotalHours) + Return "{0:0} hours ago".LTF(ts.TotalHours) ElseIf ts > TimeSpan.FromMinutes(2) Then - Return String.Format(LanguageHelper.GetString("Time_MinutesAgo"), ts.TotalMinutes) + Return "{0:0} minutes ago".LTF(ts.TotalMinutes) Else - Return LanguageHelper.GetString("Time_Now") + Return "just now".LT() End If End Function @@ -300,15 +300,15 @@ Public Class FolderStatusToStringConverter : Implements IValueConverter Dim status = CType(value, ActionState) Select Case status Case ActionState.Idle - Return LanguageHelper.GetString("Status_AwaitingCompression") + Return "Awaiting Compression".LT() Case ActionState.Analysing - Return LanguageHelper.GetString("Status_Analysing") + Return "Analysing".LT() Case ActionState.Working, ActionState.Paused - Return LanguageHelper.GetString("Status_Working") + Return "Working".LT() Case ActionState.Results - Return LanguageHelper.GetString("Status_Compressed") + Return "Compressed".LT() Case Else - Return LanguageHelper.GetString("Status_Unknown") + Return "Unknown".LT("Folder status") End Select End Function Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack @@ -493,4 +493,4 @@ Public Class EnumToIntConverter If targetType Is Nothing OrElse Not targetType.IsEnum OrElse value Is Nothing Then Return Binding.DoNothing Return [Enum].ToObject(targetType, value) End Function -End Class \ No newline at end of file +End Class diff --git a/CompactGUI/Components/Settings/Settings_skiplistflyout.xaml b/CompactGUI/Components/Settings/Settings_skiplistflyout.xaml index 5e3eb14..f575289 100644 --- a/CompactGUI/Components/Settings/Settings_skiplistflyout.xaml +++ b/CompactGUI/Components/Settings/Settings_skiplistflyout.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CompactGUI" + xmlns:loc="clr-namespace:LazyTranslate;assembly=LazyTranslate" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" Width="620" @@ -89,9 +90,8 @@ + Margin="10" FontSize="22" FontWeight="SemiBold" + loc:L.Value="edit skipped filetypes" /> @@ -104,9 +104,8 @@ Background="{StaticResource CardBackground}" Visibility="Collapsed"> - + @@ -145,15 +144,13 @@ Margin="10 10 10 0" Visibility="Collapsed"> + VerticalAlignment="Center" Checked="UiChkIncludeWiki_Checked" + loc:L.Value="Include smart skipped file types" + ToolTip="{loc:T 'For Steam Games, this uses the database to determine types to skip. For non-Steam folders this is based on the smart analyser.'}" Unchecked="UiChkIncludeWiki_Unchecked" /> + Margin="0 0 130 20" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="UISave_Click" + loc:L.Context="Skiplist editor" + loc:L.Value="Save" /> @@ -112,7 +112,7 @@ + diff --git a/CompactGUI/Views/Pages/PendingCompression.xaml b/CompactGUI/Views/Pages/PendingCompression.xaml index 1a00997..8035e35 100644 --- a/CompactGUI/Views/Pages/PendingCompression.xaml +++ b/CompactGUI/Views/Pages/PendingCompression.xaml @@ -4,6 +4,7 @@ xmlns:core="clr-namespace:CompactGUI.Core;assembly=CompactGUI.Core" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CompactGUI" + xmlns:loc="clr-namespace:LazyTranslate;assembly=LazyTranslate" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" d:DataContext="{d:DesignInstance Type=local:FolderViewModel}" @@ -21,9 +22,8 @@ - + --> - + @@ -140,16 +138,14 @@ Foreground="{StaticResource CardForeground}" Text="{Binding Folder.SkippedFileCount, StringFormat={} {0} files will be skipped}" /> - @@ -161,11 +157,11 @@ + diff --git a/CompactGUI/Views/Pages/ResultsTemplate.xaml b/CompactGUI/Views/Pages/ResultsTemplate.xaml index 29fc7ca..4051118 100644 --- a/CompactGUI/Views/Pages/ResultsTemplate.xaml +++ b/CompactGUI/Views/Pages/ResultsTemplate.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CompactGUI" + xmlns:loc="clr-namespace:LazyTranslate;assembly=LazyTranslate" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" d:DesignHeight="450" @@ -23,9 +24,8 @@ - + - + loc:L.Context="Compression size" + loc:L.Value="Before" /> - + loc:L.Context="Compression size" + loc:L.Value="After" /> @@ -69,9 +69,8 @@ Margin="0 0 20 20" Padding="10 20 10 20" Background="#30FFFFFF" BorderThickness="0"> - + @@ -81,9 +80,8 @@ Margin="0 0 20 20" Padding="10 20 10 20" Background="#30FFFFFF" BorderThickness="0"> - + @@ -96,9 +94,8 @@ Margin="0 0 20 20" Padding="10 20 10 20" Background="#30FFFFFF" BorderThickness="0"> - + @@ -115,25 +112,22 @@ @@ -151,3 +145,4 @@ + diff --git a/CompactGUI/Views/Pages/WatcherPage.xaml b/CompactGUI/Views/Pages/WatcherPage.xaml index 936422b..663d0ef 100644 --- a/CompactGUI/Views/Pages/WatcherPage.xaml +++ b/CompactGUI/Views/Pages/WatcherPage.xaml @@ -4,12 +4,13 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:CompactGUI" + xmlns:loc="clr-namespace:LazyTranslate;assembly=LazyTranslate" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" - Title="{local:Localize PageNameWatcher}" - d:Title="WatcherPage"> + Title="{loc:T 'WatcherPage'}"> + diff --git a/CompactGUI/Views/SettingsPage.xaml b/CompactGUI/Views/SettingsPage.xaml index 6e2515c..aefa4e5 100644 --- a/CompactGUI/Views/SettingsPage.xaml +++ b/CompactGUI/Views/SettingsPage.xaml @@ -4,6 +4,7 @@ xmlns:Flags="clr-namespace:FamFamFam.Flags.Wpf;assembly=FamFamFam.Flags.Wpf" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" + xmlns:loc="clr-namespace:LazyTranslate;assembly=LazyTranslate" xmlns:local="clr-namespace:CompactGUI" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" @@ -20,11 +21,9 @@ - + - + @@ -36,6 +35,7 @@ + @@ -53,7 +53,7 @@ + Text="{Binding NativeName}" /> @@ -62,8 +62,20 @@ + + + + + + + + - -