diff --git a/.gitignore b/.gitignore index 6463666..f9a2ae7 100644 --- a/.gitignore +++ b/.gitignore @@ -367,3 +367,4 @@ FodyWeavers.xsd # IntelliJ .idea/ /CompactGUI.WatcherCS +/.history diff --git a/CompactGUI/Application.xaml.vb b/CompactGUI/Application.xaml.vb index 9c46d71..07ca15f 100644 --- a/CompactGUI/Application.xaml.vb +++ b/CompactGUI/Application.xaml.vb @@ -1,4 +1,4 @@ -Imports System.IO +Imports System.IO Imports System.IO.Pipes Imports System.Threading Imports System.Windows.Threading @@ -31,7 +31,11 @@ Partial Public Class Application End Sub + Private Sub Application_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup + ' Call the language configuration at startup + LanguageHelper.Initialize() + End Sub Private Shared Sub InitializeHost() _host = Host.CreateDefaultBuilder() _ diff --git a/CompactGUI/CompactGUI.vbproj b/CompactGUI/CompactGUI.vbproj index babeb9f..038ce5a 100644 --- a/CompactGUI/CompactGUI.vbproj +++ b/CompactGUI/CompactGUI.vbproj @@ -29,7 +29,6 @@ none - @@ -46,6 +45,7 @@ + @@ -71,6 +71,22 @@ + + + True + True + i18n.resx + + + + + + i18n + PublicResXFileCodeGenerator + i18n.Designer.vb + + + diff --git a/CompactGUI/Components/Converters/IValueConverters.vb b/CompactGUI/Components/Converters/IValueConverters.vb index eef23bb..ea7683a 100644 --- a/CompactGUI/Components/Converters/IValueConverters.vb +++ b/CompactGUI/Components/Converters/IValueConverters.vb @@ -1,4 +1,4 @@ -Imports System.Globalization +Imports System.Globalization Public Class DecimalToPercentageConverter : Implements IValueConverter Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert @@ -88,20 +88,21 @@ End Class Public Class RelativeDateConverter : Implements IValueConverter Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert + Dim dt = CType(value, DateTime) Dim ts As TimeSpan = DateTime.Now - dt If ts > TimeSpan.FromDays(19000) Then - Return String.Format("Unknown") + Return LanguageHelper.GetString("Time_Unknown") End If If ts > TimeSpan.FromDays(2) Then - Return String.Format("{0:0} days ago", ts.TotalDays) + Return String.Format(LanguageHelper.GetString("Time_DaysAgo"), ts.TotalDays) ElseIf ts > TimeSpan.FromHours(2) Then - Return String.Format("{0:0} hours ago", ts.TotalHours) + Return String.Format(LanguageHelper.GetString("Time_HoursAgo"), ts.TotalHours) ElseIf ts > TimeSpan.FromMinutes(2) Then - Return String.Format("{0:0} minutes ago", ts.TotalMinutes) + Return String.Format(LanguageHelper.GetString("Time_MinutesAgo"), ts.TotalMinutes) Else - Return "just now" + Return LanguageHelper.GetString("Time_Now") End If End Function @@ -290,15 +291,15 @@ Public Class FolderStatusToStringConverter : Implements IValueConverter Dim status = CType(value, ActionState) Select Case status Case ActionState.Idle - Return "Awaiting Compression" + Return LanguageHelper.GetString("Status_AwaitingCompression") Case ActionState.Analysing - Return "Analysing" + Return LanguageHelper.GetString("Status_Analysing") Case ActionState.Working, ActionState.Paused - Return "Working" + Return LanguageHelper.GetString("Status_Working") Case ActionState.Results - Return "Compressed" + Return LanguageHelper.GetString("Status_Compressed") Case Else - Return "Unknown" + Return LanguageHelper.GetString("Status_Unknown") End Select End Function Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack diff --git a/CompactGUI/Components/Settings/Settings_skiplistflyout.xaml b/CompactGUI/Components/Settings/Settings_skiplistflyout.xaml index 4049144..cca0717 100644 --- a/CompactGUI/Components/Settings/Settings_skiplistflyout.xaml +++ b/CompactGUI/Components/Settings/Settings_skiplistflyout.xaml @@ -1,4 +1,4 @@ - - @@ -174,7 +175,8 @@ Background="{StaticResource CardBackgroundFillColorSecondaryBrush}"> - diff --git a/CompactGUI/Views/Pages/PendingCompression.xaml b/CompactGUI/Views/Pages/PendingCompression.xaml index 8c82aa8..6122a9d 100644 --- a/CompactGUI/Views/Pages/PendingCompression.xaml +++ b/CompactGUI/Views/Pages/PendingCompression.xaml @@ -1,4 +1,4 @@ - - @@ -30,7 +31,8 @@ --> - @@ -110,36 +115,33 @@ FontSize="14" Foreground="#FF98A9B9"> - Skip file types likely to compress poorly + - - - - For Steam Games: - skips files based on database results - - For Non-Steam Folders: - skips files based on compression estimate - - + Cursor="Hand" Foreground="#FF98A9B9" TextDecorations="Underline"> + + + + + @@ -148,19 +150,22 @@ FontSize="14" Foreground="#FF98A9B9"> - @@ -168,7 +173,8 @@ - - @@ -43,7 +44,7 @@ - @@ -54,7 +55,7 @@ - @@ -70,7 +71,7 @@ Margin="0,0,20,20" Padding="10,20,10,20" Background="#30FFFFFF" BorderThickness="0"> - - - - - - + Title="{local:Localize PageNameWatcher}" + d:Title="WatcherPage"> diff --git a/CompactGUI/Views/SettingsPage.xaml b/CompactGUI/Views/SettingsPage.xaml index cf52af3..2599257 100644 --- a/CompactGUI/Views/SettingsPage.xaml +++ b/CompactGUI/Views/SettingsPage.xaml @@ -1,4 +1,4 @@ - - @@ -95,7 +96,8 @@ FlowDirection="RightToLeft" IsExpanded="True" Style="{StaticResource CustomCardExpanderStyle}"> -