فهرست منبع

[Avalonia] Translation updates, start-up updates, screen and window helper updates, misc

Ruben 1 سال پیش
والد
کامیت
76331bd4d6

+ 2 - 2
src/PicView.Avalonia.MacOS/App.axaml.cs

@@ -48,7 +48,7 @@ public class App : Application, IPlatformSpecificService
         try
         {
             settingsExists = await SettingsHelper.LoadSettingsAsync();
-            await Task.Run(() => TranslationHelper.LoadLanguage(SettingsHelper.Settings.UIProperties.UserLanguage));
+            _ = Task.Run(() => TranslationHelper.LoadLanguage(SettingsHelper.Settings.UIProperties.UserLanguage));
         }
         catch (TaskCanceledException)
         {
@@ -78,7 +78,7 @@ public class App : Application, IPlatformSpecificService
 
     public void OpenWith(string path)
     {
-        //
+        // TODO: Implement OpenWith on macOS
     }
 
     public void LocateOnDisk(string path)

+ 1 - 1
src/PicView.Avalonia/CustomControls/KeybindTextBox.cs

@@ -61,7 +61,7 @@ public class KeybindTextBox : TextBox
                 return;
             var foreground = new SolidColorBrush((Color)(color ?? Color.Parse("#d6d4d4")));
             Foreground = foreground;
-            Text = TranslationHelper.GetTranslation("PressKey");
+            Text = TranslationHelper.Translation.PressKey;
             CaretIndex = 0;
         };
         LostFocus += delegate

+ 0 - 18
src/PicView.Avalonia/CustomControls/PicBox.cs

@@ -101,30 +101,12 @@ public class PicBox : Control
         {
             context.DrawImage(source, sourceRect, destRect);
         }
-        
-    }
-    
-    /*private void Invalidate(bool skipTransitions = false)
-    {
-        InvalidateProperties();
-        InvalidateScrollable();
-        InvalidateElement(skipTransitions);
-        RaiseZoomChanged();
     }
     
-    private void InvalidateProperties()
-    {
-        SetAndRaise(ZoomXProperty, ref _zoomX, _matrix.M11);
-        SetAndRaise(ZoomYProperty, ref _zoomY, _matrix.M22);
-        SetAndRaise(OffsetXProperty, ref _offsetX, _matrix.M31);
-        SetAndRaise(OffsetYProperty, ref _offsetY, _matrix.M32);
-    }*/
-    
     #endregion
     
     protected override AutomationPeer OnCreateAutomationPeer()
     {
         return new ImageAutomationPeer(this);
     }
-
 }

+ 3 - 3
src/PicView.Avalonia/Gallery/GalleryFunctions.cs

@@ -85,7 +85,7 @@ public static class GalleryFunctions
             vm.IsGalleryOpen = false;
             IsBottomGalleryOpen = false;
             vm.GalleryMode = GalleryMode.BottomToClosed;
-            vm.GetBottomGallery = TranslationHelper.GetTranslation("ShowBottomGallery");
+            vm.GetBottomGallery = TranslationHelper.Translation.ShowBottomGallery;
             await SettingsHelper.SaveSettingsAsync();
             return;
         }
@@ -95,7 +95,7 @@ public static class GalleryFunctions
         vm.IsGalleryOpen = true;
         SettingsHelper.Settings.Gallery.IsBottomGalleryShown = true;
         vm.GalleryMode = GalleryMode.ClosedToBottom;
-        vm.GetBottomGallery = TranslationHelper.GetTranslation("HideBottomGallery");
+        vm.GetBottomGallery = TranslationHelper.Translation.HideBottomGallery;
         await SettingsHelper.SaveSettingsAsync();
         if (!NavigationHelper.CanNavigate(vm))
         {
@@ -120,7 +120,7 @@ public static class GalleryFunctions
             vm.IsGalleryOpen = false;
             IsBottomGalleryOpen = false;
             vm.GalleryMode = GalleryMode.BottomToClosed;
-            vm.GetBottomGallery = TranslationHelper.GetTranslation("ShowBottomGallery");
+            vm.GetBottomGallery = TranslationHelper.Translation.ShowBottomGallery;
             await SettingsHelper.SaveSettingsAsync();
             return;
         }

+ 2 - 2
src/PicView.Avalonia/Gallery/GalleryLoad.cs

@@ -120,7 +120,7 @@ public static class GalleryLoad
 
         async Task Loop(int startIndex, int endIndex, CancellationToken ct)
         {
-            var loading = TranslationHelper.GetTranslation("Loading");
+            var loading = TranslationHelper.Translation.Loading;
             for (var i = startIndex; i < endIndex; i++)
             {
                 if (currentDirectory != _currentDirectory || ct.IsCancellationRequested)
@@ -180,7 +180,7 @@ public static class GalleryLoad
                 var fileInfo = new FileInfo(vm.ImageIterator.Pics[i]);
                 var thumbImageModel = await ImageHelper.GetImageModelAsync(fileInfo, isThumb: true,
                     (int)galleryItemSize);
-                var thumbData = GalleryThumbInfo.GalleryThumbHolder.GetThumbData(i, null, fileInfo);
+                var thumbData = GalleryThumbInfo.GalleryThumbHolder.GetThumbData(fileInfo);
 
                 while (i >= galleryListBox.Items.Count)
                 {

+ 4 - 4
src/PicView.Avalonia/Helpers/FunctionsHelper.cs

@@ -407,8 +407,8 @@ public static class FunctionsHelper
         }
         SettingsHelper.Settings.Zoom.CtrlZoom = !SettingsHelper.Settings.Zoom.CtrlZoom;
         Vm.GetCtrlZoom = SettingsHelper.Settings.Zoom.CtrlZoom
-            ? TranslationHelper.GetTranslation("CtrlToZoom")
-            : TranslationHelper.GetTranslation("ScrollToZoom");
+            ? TranslationHelper.Translation.CtrlToZoom
+            : TranslationHelper.Translation.ScrollToZoom;
         await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
     }
 
@@ -421,8 +421,8 @@ public static class FunctionsHelper
         var value = !SettingsHelper.Settings.UIProperties.Looping;
         SettingsHelper.Settings.UIProperties.Looping = value;
         Vm.GetLooping = value
-            ? TranslationHelper.GetTranslation("LoopingEnabled")
-            : TranslationHelper.GetTranslation("LoopingDisabled");
+            ? TranslationHelper.Translation.LoopingEnabled
+            : TranslationHelper.Translation.LoopingDisabled;
         Vm.IsLooping = value;
         await SettingsHelper.SaveSettingsAsync();
     }

+ 1 - 0
src/PicView.Avalonia/Helpers/ScreenHelper.cs

@@ -16,6 +16,7 @@ public struct ScreenSize(int width, int height, int workingAreaWidth, int workin
 
 public static class ScreenHelper
 {
+    public static ScreenSize ScreenSize { get; set; }
     public static ScreenSize GetScreenSize(Control control)
     {
         var screen = GetScreen(control);

+ 19 - 11
src/PicView.Avalonia/Helpers/StartUpHelper.cs

@@ -16,7 +16,7 @@ public static class StartUpHelper
 {
     public static void Start(MainViewModel vm, bool settingsExists, IClassicDesktopStyleApplicationLifetime desktop, Window w)
     {
-        vm.ScreenSize = ScreenHelper.GetScreenSize(w);
+        ScreenHelper.ScreenSize = ScreenHelper.GetScreenSize(w);
         
         if (!settingsExists)
         {
@@ -53,28 +53,26 @@ public static class StartUpHelper
             }
         }
         w.Show();
-        vm.SetLoadingTitle();
         vm.IsLoading = true;
-        _ = Task.Run(vm.UpdateLanguage);
-
+        vm.UpdateLanguage();
         vm.GetFlipped = vm.Flip;
-
+        
         if (SettingsHelper.Settings.Zoom.ScrollEnabled)
         {
             vm.ToggleScrollBarVisibility = ScrollBarVisibility.Visible;
-            vm.GetScrolling = TranslationHelper.GetTranslation("ScrollingEnabled");
+            vm.GetScrolling = TranslationHelper.Translation.ScrollingEnabled;
             vm.IsScrollingEnabled = true;
         }
         else
         {
             vm.ToggleScrollBarVisibility = ScrollBarVisibility.Disabled;
-            vm.GetScrolling = TranslationHelper.GetTranslation("ScrollingDisabled");
+            vm.GetScrolling = TranslationHelper.Translation.ScrollingDisabled;
             vm.IsScrollingEnabled = false;
         }
         
         vm.GetBottomGallery = vm.IsBottomGalleryShown ?
-            TranslationHelper.GetTranslation("HideBottomGallery") :
-            TranslationHelper.GetTranslation("ShowBottomGallery");
+            TranslationHelper.Translation.HideBottomGallery :
+            TranslationHelper.Translation.ShowBottomGallery;
 
         if (SettingsHelper.Settings.WindowProperties.TopMost)
         {
@@ -132,11 +130,21 @@ public static class StartUpHelper
             GalleryFunctions.OpenBottomGallery(vm);
         }
         
+        Task.Run(KeybindingsHelper.LoadKeybindings);
+        
+        vm.GetLooping = SettingsHelper.Settings.UIProperties.Looping
+            ? TranslationHelper.Translation.LoopingEnabled
+            : TranslationHelper.Translation.LoopingDisabled;
+        vm.GetScrolling = SettingsHelper.Settings.Zoom.ScrollEnabled
+            ? TranslationHelper.Translation.ScrollingEnabled
+            : TranslationHelper.Translation.ScrollingDisabled;
+        vm.GetCtrlZoom = SettingsHelper.Settings.Zoom.CtrlZoom
+            ? TranslationHelper.Translation.CtrlToZoom
+            : TranslationHelper.Translation.ScrollToZoom;
+        
         UIHelper.AddMenus(desktop);
         UIHelper.AddMToolTipMessage(desktop);
 
-        Task.Run(KeybindingsHelper.LoadKeybindings);
-
         w.KeyDown += async (_, e) => await MainKeyboardShortcuts.MainWindow_KeysDownAsync(e).ConfigureAwait(false);
         w.KeyUp += (_, e) => MainKeyboardShortcuts.MainWindow_KeysUp(e);
         w.PointerPressed += async (_, e) => await MouseShortcuts.MainWindow_PointerPressed(e).ConfigureAwait(false);

+ 2 - 2
src/PicView.Avalonia/Helpers/UIHelper.cs

@@ -120,14 +120,14 @@ public class UIHelper
         if (SettingsHelper.Settings.Zoom.ScrollEnabled)
         {
             vm.ToggleScrollBarVisibility = ScrollBarVisibility.Disabled;
-            vm.GetScrolling = TranslationHelper.GetTranslation("ScrollingDisabled");
+            vm.GetScrolling = TranslationHelper.Translation.ScrollingDisabled;
             vm.IsScrollingEnabled = false;
             SettingsHelper.Settings.Zoom.ScrollEnabled = false;
         }
         else
         {
             vm.ToggleScrollBarVisibility = ScrollBarVisibility.Visible;
-            vm.GetScrolling = TranslationHelper.GetTranslation("ScrollingEnabled");
+            vm.GetScrolling = TranslationHelper.Translation.ScrollingEnabled;
             vm.IsScrollingEnabled = true;
             SettingsHelper.Settings.Zoom.ScrollEnabled = true;
         }

+ 1 - 1
src/PicView.Avalonia/Helpers/WindowHelper.cs

@@ -429,7 +429,7 @@ public static class WindowHelper
             return;
         }
 
-        var screenSize = vm.ScreenSize;
+        var screenSize = ScreenHelper.ScreenSize;
         double desktopMinWidth = 0, desktopMinHeight = 0, containerWidth = 0, containerHeight = 0;
         var uiTopSize = SettingsHelper.Settings.UIProperties.ShowInterface ? vm.TitlebarHeight : 0;
         var uiBottomSize =

+ 2 - 2
src/PicView.Avalonia/Navigation/ImageIterator.cs

@@ -182,7 +182,7 @@ public class ImageIterator
         {
             if (galleryListBox.Items[index] is GalleryItem item)
             {
-                var galleryThumbInfo = GalleryThumbInfo.GalleryThumbHolder.GetThumbData(index, null, fileInfo);
+                var galleryThumbInfo = GalleryThumbInfo.GalleryThumbHolder.GetThumbData(fileInfo);
                 await Dispatcher.UIThread.InvokeAsync(() =>
                 {
                     item.FileName.Text = galleryThumbInfo.FileName;
@@ -308,7 +308,7 @@ public class ImageIterator
             if (galleryListBox.Items[index] is not GalleryItem galleryItem) { return; }
             var imageModel = await ImageHelper.GetImageModelAsync(fileInfo, true, (int)_vm.GetGalleryItemHeight);
             ImageHelper.SetImage(imageModel.Image, galleryItem.GalleryImage, imageModel.ImageType);
-            var galleryThumbInfo = GalleryThumbInfo.GalleryThumbHolder.GetThumbData(index, null, fileInfo);
+            var galleryThumbInfo = GalleryThumbInfo.GalleryThumbHolder.GetThumbData(fileInfo);
             galleryItem.FileLocation.Text = galleryThumbInfo.FileLocation;
             galleryItem.FileDate.Text = galleryThumbInfo.FileDate;
             galleryItem.FileSize.Text = galleryThumbInfo.FileSize;

+ 2 - 2
src/PicView.Avalonia/PicView.Avalonia.csproj

@@ -8,7 +8,7 @@
     <Company>Ruben Hyldgaard Negendahl</Company>
     <Product>PicView</Product>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <PlatformTarget>x64</PlatformTarget>
+    <PlatformTarget>ARM64</PlatformTarget>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
     <IsAotCompatible>False</IsAotCompatible>
@@ -56,7 +56,7 @@
     <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
     <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0-rc1" />
     <PackageReference Include="Avalonia.Svg.Skia" Version="11.1.0-beta1" />
-    <PackageReference Include="Magick.NET-Q8-OpenMP-x64" Version="13.9.1" />
+    <PackageReference Include="Magick.NET-Q8-arm64" Version="13.9.1" />
   </ItemGroup>
 
   <ItemGroup>

+ 2 - 2
src/PicView.Avalonia/Services/FileService.cs

@@ -19,7 +19,7 @@ public class FileService
                 throw new NullReferenceException("Missing StorageProvider instance.");
             var options = new FilePickerOpenOptions
             {
-                Title = $"{TranslationHelper.GetTranslation("OpenFileDialog")} - PicView",
+                Title = $"{TranslationHelper.Translation.OpenFileDialog} - PicView",
                 AllowMultiple = false,
                 FileTypeFilter = new[] { AllFileType, FilePickerFileTypes.ImageAll, ArchiveFileType }
             };
@@ -67,7 +67,7 @@ public class FileService
         
         var options = new FilePickerSaveOptions()
         {
-            Title = $"{TranslationHelper.GetTranslation("OpenFileDialog")} - PicView",
+            Title = $"{TranslationHelper.Translation.OpenFileDialog} - PicView",
             FileTypeChoices  = new[] { AllFileType, FilePickerFileTypes.ImageAll, ArchiveFileType },
             SuggestedFileName = fileName,
             SuggestedStartLocation = await desktop.MainWindow.StorageProvider.TryGetFolderFromPathAsync(fileName)

+ 3 - 11
src/PicView.Avalonia/ViewModels/MainViewModel.cs

@@ -664,9 +664,7 @@ public class MainViewModel : ViewModelBase
         set => this.RaiseAndSetIfChanged(ref _getBottomGallery, value);
     }
 
-    private string? _getLooping = SettingsHelper.Settings.UIProperties.Looping
-        ? TranslationHelper.GetTranslation("LoopingEnabled")
-        : TranslationHelper.GetTranslation("LoopingDisabled");
+    private string? _getLooping;
 
     public string? GetLooping
     {
@@ -674,9 +672,7 @@ public class MainViewModel : ViewModelBase
         set => this.RaiseAndSetIfChanged(ref _getLooping, value);
     }
 
-    private string? _getScrolling = SettingsHelper.Settings.Zoom.ScrollEnabled
-        ? TranslationHelper.GetTranslation("ScrollingEnabled")
-        : TranslationHelper.GetTranslation("ScrollingDisabled");
+    private string? _getScrolling;
 
     public string? GetScrolling
     {
@@ -684,9 +680,7 @@ public class MainViewModel : ViewModelBase
         set => this.RaiseAndSetIfChanged(ref _getScrolling, value);
     }
 
-    private string? _getCtrlZoom = SettingsHelper.Settings.Zoom.CtrlZoom
-        ? TranslationHelper.GetTranslation("CtrlToZoom")
-        : TranslationHelper.GetTranslation("ScrollToZoom");
+    private string? _getCtrlZoom;
 
     public string? GetCtrlZoom
     {
@@ -1065,8 +1059,6 @@ public class MainViewModel : ViewModelBase
     #endregion strings
 
     #region Window Properties
-    
-    public ScreenSize ScreenSize { get; set; }
 
     private string? _title = "Loading...";
 

+ 208 - 208
src/PicView.Avalonia/ViewModels/ViewModelBase.cs

@@ -11,212 +11,212 @@ public class ViewModelBase : ReactiveObject
 
     public void UpdateLanguage()
     {
-        File = TranslationHelper.GetTranslation("File");
-        SelectFile = TranslationHelper.GetTranslation("OpenFileDialog");
-        OpenLastFile = TranslationHelper.GetTranslation("OpenLastFile");
-        FilePaste = TranslationHelper.GetTranslation("FilePaste");
-        Copy = TranslationHelper.GetTranslation("Copy");
-        Reload = TranslationHelper.GetTranslation("Reload");
-        Print = TranslationHelper.GetTranslation("Print");
-        DeleteFile = TranslationHelper.GetTranslation("DeleteFile");
-        Save = TranslationHelper.GetTranslation("Save");
-        CopyFile = TranslationHelper.GetTranslation("CopyFile");
-        NewWindow = TranslationHelper.GetTranslation("NewWindow");
-        Close = TranslationHelper.GetTranslation("Close");
-        Open = TranslationHelper.GetTranslation("Open");
-        OpenFileDialog = TranslationHelper.GetTranslation("OpenFileDialog");
-        ShowInFolder = TranslationHelper.GetTranslation("ShowInFolder");
-        OpenWith = TranslationHelper.GetTranslation("OpenWith");
-        RenameFile = TranslationHelper.GetTranslation("RenameFile");
-        DuplicateFile = TranslationHelper.GetTranslation("DuplicateFile");
-        RotateLeft = TranslationHelper.GetTranslation("RotateLeft");
-        RotateRight = TranslationHelper.GetTranslation("RotateRight");
-        Flip = TranslationHelper.GetTranslation("Flip");
-        UnFlip = TranslationHelper.GetTranslation("Unflip");
-        ShowBottomGallery = TranslationHelper.GetTranslation("ShowBottomGallery");
-        HideBottomGallery = TranslationHelper.GetTranslation("HideBottomGallery");
-        AutoFitWindow = TranslationHelper.GetTranslation("AutoFitWindow");
-        Stretch = TranslationHelper.GetTranslation("Stretch");
-        Crop = TranslationHelper.GetTranslation("Crop");
-        ResizeImage = TranslationHelper.GetTranslation("ResizeImage");
-        GoToImageAtSpecifiedIndex = TranslationHelper.GetTranslation("GoToImageAtSpecifiedIndex");
-        ToggleScroll = TranslationHelper.GetTranslation("ToggleScroll");
-        ScrollEnabled = TranslationHelper.GetTranslation("ScrollEnabled");
-        ScrollDisabled = TranslationHelper.GetTranslation("ScrollDisabled");
-        ScrollDirection = TranslationHelper.GetTranslation("ScrollDirection");
-        Reverse = TranslationHelper.GetTranslation("Reverse");
-        Forward = TranslationHelper.GetTranslation("Forward");
-        Slideshow = TranslationHelper.GetTranslation("Slideshow");
-        Settings = TranslationHelper.GetTranslation("Settings");
-        InfoWinow = TranslationHelper.GetTranslation("InfoWindow");
-        ImageInfo = TranslationHelper.GetTranslation("ImageInfo");
-        About = TranslationHelper.GetTranslation("About");
-        ShowAllSettingsWindow = TranslationHelper.GetTranslation("ShowAllSettingsWindow");
-        StayTopMost = TranslationHelper.GetTranslation("StayTopMost");
-        SearchSubdirectory = TranslationHelper.GetTranslation("SearchSubdirectory");
-        ToggleLooping = TranslationHelper.GetTranslation("ToggleLooping");
-        HideShowInterface = TranslationHelper.GetTranslation("HideShowInterface");
-        ApplicationShortcuts = TranslationHelper.GetTranslation("ApplicationShortcuts");
-        BatchResize = TranslationHelper.GetTranslation("BatchResize");
-        Effects = TranslationHelper.GetTranslation("Effects");
-        EffectsTooltip = TranslationHelper.GetTranslation("EffectsTooltip");
-        FileProperties = TranslationHelper.GetTranslation("FileProperties");
-        OptimizeImage = TranslationHelper.GetTranslation("OptimizeImage");
-        ImageInfo = TranslationHelper.GetTranslation("ImageInfo");
-        FileName = TranslationHelper.GetTranslation("FileName");
-        FileSize = TranslationHelper.GetTranslation("FileSize");
-        Folder = TranslationHelper.GetTranslation("Folder");
-        FullPath = TranslationHelper.GetTranslation("FullPath");
-        Created = TranslationHelper.GetTranslation("Created");
-        Modified = TranslationHelper.GetTranslation("Modified");
-        LastAccessTime = TranslationHelper.GetTranslation("LastAccessTime");
-        ConvertTo = TranslationHelper.GetTranslation("ConvertTo");
-        NoConversion = TranslationHelper.GetTranslation("NoConversion");
-        Resize = TranslationHelper.GetTranslation("Resize");
-        NoResize = TranslationHelper.GetTranslation("NoResize");
-        Apply = TranslationHelper.GetTranslation("Apply");
-        Cancel = TranslationHelper.GetTranslation("Cancel");
-        BitDepth = TranslationHelper.GetTranslation("BitDepth");
-        AspectRatio = TranslationHelper.GetTranslation("AspectRatio");
-        Width = TranslationHelper.GetTranslation("Width");
-        Height = TranslationHelper.GetTranslation("Height");
-        SizeMp = TranslationHelper.GetTranslation("SizeMp");
-        Resolution = TranslationHelper.GetTranslation("Resolution");
-        PrintSizeIn = TranslationHelper.GetTranslation("PrintSizeIn");
-        PrintSizeCm = TranslationHelper.GetTranslation("PrintSizeCm");
-        Centimeters = TranslationHelper.GetTranslation("Centimeters");
-        Inches = TranslationHelper.GetTranslation("Inches");
-        SizeTooltip = TranslationHelper.GetTranslation("SizeTooltip");
-        Latitude = TranslationHelper.GetTranslation("Latitude");
-        Longitude = TranslationHelper.GetTranslation("Longitude");
-        Altitude = TranslationHelper.GetTranslation("Altitude");
-        Authors = TranslationHelper.GetTranslation("Authors");
-        DateTaken = TranslationHelper.GetTranslation("DateTaken");
-        Copyright = TranslationHelper.GetTranslation("Copyright");
-        ResolutionUnit = TranslationHelper.GetTranslation("ResolutionUnit");
-        ColorRepresentation = TranslationHelper.GetTranslation("ColorRepresentation");
-        CompressedBitsPixel = TranslationHelper.GetTranslation("CompressedBitsPixel");
-        Compression = TranslationHelper.GetTranslation("Compression");
-        ExposureTime = TranslationHelper.GetTranslation("ExposureTime");
-        XPTitle = TranslationHelper.GetTranslation("Title");
-        Subject = TranslationHelper.GetTranslation("Subject");
-        Software = TranslationHelper.GetTranslation("Software");
-        CameraMaker = TranslationHelper.GetTranslation("CameraMaker");
-        CameraModel = TranslationHelper.GetTranslation("CameraModel");
-        FocalLength = TranslationHelper.GetTranslation("FocalLength");
-        Fnumber = TranslationHelper.GetTranslation("Fnumber");
-        Fstop = TranslationHelper.GetTranslation("Fstop");
-        MaxAperture = TranslationHelper.GetTranslation("MaxAperture");
-        ExposureBias = TranslationHelper.GetTranslation("ExposureBias");
-        ExposureProgram = TranslationHelper.GetTranslation("ExposureProgram");
-        DigitalZoom = TranslationHelper.GetTranslation("DigitalZoom");
-        ISOSpeed = TranslationHelper.GetTranslation("ISOSpeed");
-        FocalLength35mm = TranslationHelper.GetTranslation("FocalLength35mm");
-        MeteringMode = TranslationHelper.GetTranslation("MeteringMode");
-        Contrast = TranslationHelper.GetTranslation("Contrast");
-        Saturation = TranslationHelper.GetTranslation("Saturation");
-        Sharpness = TranslationHelper.GetTranslation("Sharpness");
-        WhiteBalance = TranslationHelper.GetTranslation("WhiteBalance");
-        FlashEnergy = TranslationHelper.GetTranslation("FlashEnergy");
-        FlashMode = TranslationHelper.GetTranslation("FlashMode");
-        LightSource = TranslationHelper.GetTranslation("LightSource");
-        Brightness = TranslationHelper.GetTranslation("Brightness");
-        PhotometricInterpretation = TranslationHelper.GetTranslation("PhotometricInterpretation");
-        Orientation = TranslationHelper.GetTranslation("Orientation");
-        ExifVersion = TranslationHelper.GetTranslation("ExifVersion");
-        LensMaker = TranslationHelper.GetTranslation("LensMaker");
-        LensModel = TranslationHelper.GetTranslation("LensModel");
-        SortFilesBy = TranslationHelper.GetTranslation("SortFilesBy");
-        FileExtension = TranslationHelper.GetTranslation("FileExtension");
-        CreationTime = TranslationHelper.GetTranslation("CreationTime");
-        Random = TranslationHelper.GetTranslation("Random");
-        Ascending = TranslationHelper.GetTranslation("Ascending");
-        Descending = TranslationHelper.GetTranslation("Descending");
-        RecentFiles = TranslationHelper.GetTranslation("RecentFiles");
-        SetAsWallpaper = TranslationHelper.GetTranslation("SetAsWallpaper");
-        SetAsLockScreenImage = TranslationHelper.GetTranslation("SetAsLockScreenImage");
-        ImageTxt = TranslationHelper.GetTranslation("Image");
-        CopyImage = TranslationHelper.GetTranslation("CopyImage");
-        FileCopyPath = TranslationHelper.GetTranslation("FileCopyPath");
-        FileCut = TranslationHelper.GetTranslation("FileCut");
-        CtrlToZoom = TranslationHelper.GetTranslation("CtrlToZoom");
-        ScrollToZoom = TranslationHelper.GetTranslation("ScrollToZoom");
-        GeneralSettings = TranslationHelper.GetTranslation("GeneralSettings");
-        Appearance = TranslationHelper.GetTranslation("Appearance");
-        Language = TranslationHelper.GetTranslation("Language");
-        MouseWheel = TranslationHelper.GetTranslation("MouseWheel");
-        MiscSettings = TranslationHelper.GetTranslation("MiscSettings");
-        StayCentered = TranslationHelper.GetTranslation("StayCentered");
-        ShowFileSavingDialog = TranslationHelper.GetTranslation("ShowFileSavingDialog");
-        OpenInSameWindow = TranslationHelper.GetTranslation("OpenInSameWindow");
-        ApplicationStartup = TranslationHelper.GetTranslation("ApplicationStartup");
-        None = TranslationHelper.GetTranslation("None");
-        AdjustTimingForSlideshow = TranslationHelper.GetTranslation("AdjustTimingForSlideshow");
-        AdjustTimingForZoom = TranslationHelper.GetTranslation("AdjustTimingForZoom");
-        AdjustNavSpeed = TranslationHelper.GetTranslation("AdjustNavSpeed");
-        SecAbbreviation = TranslationHelper.GetTranslation("SecAbbreviation");
-        ResetButtonText = TranslationHelper.GetTranslation("ResetButtonText");
-        ShowBottomToolbar = TranslationHelper.GetTranslation("ShowBottomToolbar");
-        ShowBottomGalleryWhenUiIsHidden = TranslationHelper.GetTranslation("ShowBottomGalleryWhenUiIsHidden");
-        ChangeKeybindingTooltip = TranslationHelper.GetTranslation("ChangeKeybindingTooltip");
-        ShowButtonsInHiddenUI = TranslationHelper.GetTranslation("ShowButtonsInHiddenUI");
-        ToggleTaskbarProgress = TranslationHelper.GetTranslation("ToggleTaskbarProgress");
-        ChangeKeybindingText = TranslationHelper.GetTranslation("ChangeKeybindingText");
-        Navigation = TranslationHelper.GetTranslation("Navigation");
-        NextImage = TranslationHelper.GetTranslation("NextImage");
-        PrevImage = TranslationHelper.GetTranslation("PrevImage");
-        LastImage = TranslationHelper.GetTranslation("LastImage");
-        FirstImage = TranslationHelper.GetTranslation("FirstImage");
-        NextFolder = TranslationHelper.GetTranslation("NextFolder");
-        PrevFolder = TranslationHelper.GetTranslation("PrevFolder");
-        SelectGalleryThumb = TranslationHelper.GetTranslation("SelectGalleryThumb");
-        ScrollAndRotate = TranslationHelper.GetTranslation("ScrollAndRotate");
-        ScrollUp = TranslationHelper.GetTranslation("ScrollUp");
-        ScrollDown = TranslationHelper.GetTranslation("ScrollDown");
-        ScrollToTop = TranslationHelper.GetTranslation("ScrollToTop");
-        ScrollToBottom = TranslationHelper.GetTranslation("ScrollToBottom");
-        Zoom = TranslationHelper.GetTranslation("Zoom");
-        ZoomIn = TranslationHelper.GetTranslation("ZoomIn");
-        ZoomOut = TranslationHelper.GetTranslation("ZoomOut");
-        Pan = TranslationHelper.GetTranslation("Pan");
-        ResetZoom = TranslationHelper.GetTranslation("ResetZoom");
-        ImageControl = TranslationHelper.GetTranslation("ImageControl");
-        ChangeBackground = TranslationHelper.GetTranslation("ChangeBackground");
-        InterfaceConfiguration = TranslationHelper.GetTranslation("InterfaceConfiguration");
-        FileManagement = TranslationHelper.GetTranslation("FileManagement");
-        ToggleFullscreen = TranslationHelper.GetTranslation("ToggleFullscreen");
-        ShowImageGallery = TranslationHelper.GetTranslation("ShowImageGallery");
-        WindowManagement = TranslationHelper.GetTranslation("WindowManagement");
-        CenterWindow = TranslationHelper.GetTranslation("CenterWindow");
-        WindowScaling = TranslationHelper.GetTranslation("WindowScaling");
-        NormalWindow = TranslationHelper.GetTranslation("NormalWindow");
-        SetStarRating = TranslationHelper.GetTranslation("SetStarRating");
-        _1Star = TranslationHelper.GetTranslation("_1Star");
-        _2Star = TranslationHelper.GetTranslation("_2Star");
-        _3Star = TranslationHelper.GetTranslation("_3Star");
-        _4Star = TranslationHelper.GetTranslation("_4Star");
-        _5Star = TranslationHelper.GetTranslation("_5Star");
-        RemoveStarRating = TranslationHelper.GetTranslation("RemoveStarRating");
-        Theme = TranslationHelper.GetTranslation("Theme");
-        DarkTheme = TranslationHelper.GetTranslation("DarkTheme");
-        LightTheme = TranslationHelper.GetTranslation("LightTheme");
-        MouseDrag = TranslationHelper.GetTranslation("MouseDrag");
-        DoubleClick = TranslationHelper.GetTranslation("DoubleClick");
-        MoveWindow = TranslationHelper.GetTranslation("MoveWindow");
-        GithubRepo = TranslationHelper.GetTranslation("GithubRepo");
-        Version = TranslationHelper.GetTranslation("Version");
-        ViewLicenseFile = TranslationHelper.GetTranslation("ViewLicenseFile");
-        CheckForUpdates = TranslationHelper.GetTranslation("CheckForUpdates");
-        Credits = TranslationHelper.GetTranslation("Credits");
-        ColorPickerTool = TranslationHelper.GetTranslation("ColorPickerTool");
-        ColorPickerToolTooltip = TranslationHelper.GetTranslation("ColorPickerToolTooltip");
-        ExpandedGalleryItemSize = TranslationHelper.GetTranslation("ExpandedGalleryItemSize");
-        BottomGalleryItemSize = TranslationHelper.GetTranslation("BottomGalleryItemSize");
-        Square = TranslationHelper.GetTranslation("Square");
-        Uniform = TranslationHelper.GetTranslation("Uniform");
-        UniformToFill = TranslationHelper.GetTranslation("UniformToFill");
-        FillSquare = TranslationHelper.GetTranslation("FillSquare");
-        Fill = TranslationHelper.GetTranslation("Fill");
+        File = TranslationHelper.Translation.File;
+        SelectFile = TranslationHelper.Translation.OpenFileDialog;
+        OpenLastFile = TranslationHelper.Translation.OpenLastFile;
+        FilePaste = TranslationHelper.Translation.FilePaste;
+        Copy = TranslationHelper.Translation.Copy;
+        Reload = TranslationHelper.Translation.Reload;
+        Print = TranslationHelper.Translation.Print;
+        DeleteFile = TranslationHelper.Translation.DeleteFile;
+        Save = TranslationHelper.Translation.Save;
+        CopyFile = TranslationHelper.Translation.CopyFile;
+        NewWindow = TranslationHelper.Translation.NewWindow;
+        Close = TranslationHelper.Translation.Close;
+        Open = TranslationHelper.Translation.Open;
+        OpenFileDialog = TranslationHelper.Translation.OpenFileDialog;
+        ShowInFolder = TranslationHelper.Translation.ShowInFolder;
+        OpenWith = TranslationHelper.Translation.OpenWith;
+        RenameFile = TranslationHelper.Translation.RenameFile;
+        DuplicateFile = TranslationHelper.Translation.DuplicateFile;
+        RotateLeft = TranslationHelper.Translation.RotateLeft;
+        RotateRight = TranslationHelper.Translation.RotateRight;
+        Flip = TranslationHelper.Translation.Flip;
+        UnFlip = TranslationHelper.Translation.Unflip;
+        ShowBottomGallery = TranslationHelper.Translation.ShowBottomGallery;
+        HideBottomGallery = TranslationHelper.Translation.HideBottomGallery;
+        AutoFitWindow = TranslationHelper.Translation.AutoFitWindow;
+        Stretch = TranslationHelper.Translation.Stretch;
+        Crop = TranslationHelper.Translation.Crop;
+        ResizeImage = TranslationHelper.Translation.ResizeImage;
+        GoToImageAtSpecifiedIndex = TranslationHelper.Translation.GoToImageAtSpecifiedIndex;
+        ToggleScroll = TranslationHelper.Translation.ToggleScroll;
+        ScrollEnabled = TranslationHelper.Translation.ScrollingEnabled;
+        ScrollDisabled = TranslationHelper.Translation.ScrollingDisabled;
+        ScrollDirection = TranslationHelper.Translation.ScrollDirection;
+        Reverse = TranslationHelper.Translation.Reverse;
+        Forward = TranslationHelper.Translation.Forward;
+        Slideshow = TranslationHelper.Translation.Slideshow;
+        Settings = TranslationHelper.Translation.Settings;
+        InfoWinow = TranslationHelper.Translation.InfoWindow;
+        ImageInfo = TranslationHelper.Translation.ImageInfo;
+        About = TranslationHelper.Translation.About;
+        ShowAllSettingsWindow = TranslationHelper.Translation.ShowAllSettingsWindow;
+        StayTopMost = TranslationHelper.Translation.StayTopMost;
+        SearchSubdirectory = TranslationHelper.Translation.SearchSubdirectory;
+        ToggleLooping = TranslationHelper.Translation.ToggleLooping;
+        HideShowInterface = TranslationHelper.Translation.HideShowInterface;
+        ApplicationShortcuts = TranslationHelper.Translation.ApplicationShortcuts;
+        BatchResize = TranslationHelper.Translation.BatchResize;
+        Effects = TranslationHelper.Translation.Effects;
+        EffectsTooltip = TranslationHelper.Translation.EffectsTooltip;
+        FileProperties = TranslationHelper.Translation.FileProperties;
+        OptimizeImage = TranslationHelper.Translation.OptimizeImage;
+        ImageInfo = TranslationHelper.Translation.ImageInfo;
+        FileName = TranslationHelper.Translation.FileName;
+        FileSize = TranslationHelper.Translation.FileSize;
+        Folder = TranslationHelper.Translation.Folder;
+        FullPath = TranslationHelper.Translation.FullPath;
+        Created = TranslationHelper.Translation.Created;
+        Modified = TranslationHelper.Translation.Modified;
+        LastAccessTime = TranslationHelper.Translation.LastAccessTime;
+        ConvertTo = TranslationHelper.Translation.ConvertTo;
+        NoConversion = TranslationHelper.Translation.NoConversion;
+        Resize = TranslationHelper.Translation.Resize;
+        NoResize = TranslationHelper.Translation.NoResize;
+        Apply = TranslationHelper.Translation.Apply;
+        Cancel = TranslationHelper.Translation.Cancel;
+        BitDepth = TranslationHelper.Translation.BitDepth;
+        AspectRatio = TranslationHelper.Translation.AspectRatio;
+        Width = TranslationHelper.Translation.Width;
+        Height = TranslationHelper.Translation.Height;
+        SizeMp = TranslationHelper.Translation.SizeMp;
+        Resolution = TranslationHelper.Translation.Resolution;
+        PrintSizeIn = TranslationHelper.Translation.PrintSizeIn;
+        PrintSizeCm = TranslationHelper.Translation.PrintSizeCm;
+        Centimeters = TranslationHelper.Translation.Centimeters;
+        Inches = TranslationHelper.Translation.Inches;
+        SizeTooltip = TranslationHelper.Translation.SizeTooltip;
+        Latitude = TranslationHelper.Translation.Latitude;
+        Longitude = TranslationHelper.Translation.Longitude;
+        Altitude = TranslationHelper.Translation.Altitude;
+        Authors = TranslationHelper.Translation.Authors;
+        DateTaken = TranslationHelper.Translation.DateTaken;
+        Copyright = TranslationHelper.Translation.Copyright;
+        ResolutionUnit = TranslationHelper.Translation.ResolutionUnit;
+        ColorRepresentation = TranslationHelper.Translation.ColorRepresentation;
+        CompressedBitsPixel = TranslationHelper.Translation.CompressedBitsPixel;
+        Compression = TranslationHelper.Translation.Compression;
+        ExposureTime = TranslationHelper.Translation.ExposureTime;
+        XPTitle = TranslationHelper.Translation.Title;
+        Subject = TranslationHelper.Translation.Subject;
+        Software = TranslationHelper.Translation.Software;
+        CameraMaker = TranslationHelper.Translation.CameraMaker;
+        CameraModel = TranslationHelper.Translation.CameraModel;
+        FocalLength = TranslationHelper.Translation.FocalLength;
+        Fnumber = TranslationHelper.Translation.FNumber;
+        Fstop = TranslationHelper.Translation.Fstop;
+        MaxAperture = TranslationHelper.Translation.MaxAperture;
+        ExposureBias = TranslationHelper.Translation.ExposureBias;
+        ExposureProgram = TranslationHelper.Translation.ExposureProgram;
+        DigitalZoom = TranslationHelper.Translation.DigitalZoom;
+        ISOSpeed = TranslationHelper.Translation.ISOSpeed;
+        FocalLength35mm = TranslationHelper.Translation.FocalLength35mm;
+        MeteringMode = TranslationHelper.Translation.MeteringMode;
+        Contrast = TranslationHelper.Translation.Contrast;
+        Saturation = TranslationHelper.Translation.Saturation;
+        Sharpness = TranslationHelper.Translation.Sharpness;
+        WhiteBalance = TranslationHelper.Translation.WhiteBalance;
+        FlashEnergy = TranslationHelper.Translation.FlashEnergy;
+        FlashMode = TranslationHelper.Translation.FlashMode;
+        LightSource = TranslationHelper.Translation.LightSource;
+        Brightness = TranslationHelper.Translation.Brightness;
+        PhotometricInterpretation = TranslationHelper.Translation.PhotometricInterpretation;
+        Orientation = TranslationHelper.Translation.Orientation;
+        ExifVersion = TranslationHelper.Translation.ExifVersion;
+        LensMaker = TranslationHelper.Translation.LensMaker;
+        LensModel = TranslationHelper.Translation.LensModel;
+        SortFilesBy = TranslationHelper.Translation.SortFilesBy;
+        FileExtension = TranslationHelper.Translation.FileExtension;
+        CreationTime = TranslationHelper.Translation.CreationTime;
+        Random = TranslationHelper.Translation.Random;
+        Ascending = TranslationHelper.Translation.Ascending;
+        Descending = TranslationHelper.Translation.Descending;
+        RecentFiles = TranslationHelper.Translation.RecentFiles;
+        SetAsWallpaper = TranslationHelper.Translation.SetAsWallpaper;
+        SetAsLockScreenImage = TranslationHelper.Translation.SetAsLockScreenImage;
+        ImageTxt = TranslationHelper.Translation.Image;
+        CopyImage = TranslationHelper.Translation.CopyImage;
+        FileCopyPath = TranslationHelper.Translation.FileCopyPath;
+        FileCut = TranslationHelper.Translation.FileCut;
+        CtrlToZoom = TranslationHelper.Translation.CtrlToZoom;
+        ScrollToZoom = TranslationHelper.Translation.ScrollToZoom;
+        GeneralSettings = TranslationHelper.Translation.GeneralSettings;
+        Appearance = TranslationHelper.Translation.Appearance;
+        Language = TranslationHelper.Translation.Language;
+        MouseWheel = TranslationHelper.Translation.MouseWheel;
+        MiscSettings = TranslationHelper.Translation.MiscSettings;
+        StayCentered = TranslationHelper.Translation.StayCentered;
+        ShowFileSavingDialog = TranslationHelper.Translation.ShowFileSavingDialog;
+        OpenInSameWindow = TranslationHelper.Translation.OpenInSameWindow;
+        ApplicationStartup = TranslationHelper.Translation.ApplicationStartup;
+        None = TranslationHelper.Translation.None;
+        AdjustTimingForSlideshow = TranslationHelper.Translation.AdjustTimingForSlideshow;
+        AdjustTimingForZoom = TranslationHelper.Translation.AdjustTimingForZoom;
+        AdjustNavSpeed = TranslationHelper.Translation.AdjustNavSpeed;
+        SecAbbreviation = TranslationHelper.Translation.SecAbbreviation;
+        ResetButtonText = TranslationHelper.Translation.ResetButtonText;
+        ShowBottomToolbar = TranslationHelper.Translation.ShowBottomToolbar;
+        ShowBottomGalleryWhenUiIsHidden = TranslationHelper.Translation.ShowBottomGalleryWhenUiIsHidden;
+        ChangeKeybindingTooltip = TranslationHelper.Translation.ChangeKeybindingTooltip;
+        ShowButtonsInHiddenUI = TranslationHelper.Translation.ShowButtonsInHiddenUI;
+        ToggleTaskbarProgress = TranslationHelper.Translation.ToggleTaskbarProgress;
+        ChangeKeybindingText = TranslationHelper.Translation.ChangeKeybindingText;
+        Navigation = TranslationHelper.Translation.Navigation;
+        NextImage = TranslationHelper.Translation.NextImage;
+        PrevImage = TranslationHelper.Translation.PrevImage;
+        LastImage = TranslationHelper.Translation.LastImage;
+        FirstImage = TranslationHelper.Translation.FirstImage;
+        NextFolder = TranslationHelper.Translation.NextFolder;
+        PrevFolder = TranslationHelper.Translation.PrevFolder;
+        SelectGalleryThumb = TranslationHelper.Translation.SelectGalleryThumb;
+        ScrollAndRotate = TranslationHelper.Translation.ScrollAndRotate;
+        ScrollUp = TranslationHelper.Translation.ScrollUp;
+        ScrollDown = TranslationHelper.Translation.ScrollDown;
+        ScrollToTop = TranslationHelper.Translation.ScrollToTop;
+        ScrollToBottom = TranslationHelper.Translation.ScrollToBottom;
+        Zoom = TranslationHelper.Translation.Zoom;
+        ZoomIn = TranslationHelper.Translation.ZoomIn;
+        ZoomOut = TranslationHelper.Translation.ZoomOut;
+        Pan = TranslationHelper.Translation.Pan;
+        ResetZoom = TranslationHelper.Translation.ResetZoom;
+        ImageControl = TranslationHelper.Translation.ImageControl;
+        ChangeBackground = TranslationHelper.Translation.ChangeBackground;
+        InterfaceConfiguration = TranslationHelper.Translation.InterfaceConfiguration;
+        FileManagement = TranslationHelper.Translation.FileManagement;
+        ToggleFullscreen = TranslationHelper.Translation.ToggleFullscreen;
+        ShowImageGallery = TranslationHelper.Translation.ShowImageGallery;
+        WindowManagement = TranslationHelper.Translation.WindowManagement;
+        CenterWindow = TranslationHelper.Translation.CenterWindow;
+        WindowScaling = TranslationHelper.Translation.WindowScaling;
+        NormalWindow = TranslationHelper.Translation.NormalWindow;
+        SetStarRating = TranslationHelper.Translation.SetStarRating;
+        _1Star = TranslationHelper.Translation._1Star;
+        _2Star = TranslationHelper.Translation._2Star;
+        _3Star = TranslationHelper.Translation._3Star;
+        _4Star = TranslationHelper.Translation._4Star;
+        _5Star = TranslationHelper.Translation._5Star;
+        RemoveStarRating = TranslationHelper.Translation.RemoveStarRating;
+        Theme = TranslationHelper.Translation.Theme;
+        DarkTheme = TranslationHelper.Translation.DarkTheme;
+        LightTheme = TranslationHelper.Translation.LightTheme;
+        MouseDrag = TranslationHelper.Translation.MouseDrag;
+        DoubleClick = TranslationHelper.Translation.DoubleClick;
+        MoveWindow = TranslationHelper.Translation.MoveWindow;
+        GithubRepo = TranslationHelper.Translation.GithubRepo;
+        Version = TranslationHelper.Translation.Version;
+        ViewLicenseFile = TranslationHelper.Translation.ViewLicenseFile;
+        CheckForUpdates = TranslationHelper.Translation.CheckForUpdates;
+        Credits = TranslationHelper.Translation.Credits;
+        ColorPickerTool = TranslationHelper.Translation.ColorPickerTool;
+        ColorPickerToolTooltip = TranslationHelper.Translation.ColorPickerToolTooltip;
+        ExpandedGalleryItemSize = TranslationHelper.Translation.ExpandedGalleryItemSize;
+        BottomGalleryItemSize = TranslationHelper.Translation.BottomGalleryItemSize;
+        Square = TranslationHelper.Translation.Square;
+        Uniform = TranslationHelper.Translation.Uniform;
+        UniformToFill = TranslationHelper.Translation.UniformToFill;
+        FillSquare = TranslationHelper.Translation.FillSquare;
+        Fill = TranslationHelper.Translation.Fill;
     }
 
     #region Strings
@@ -1476,7 +1476,7 @@ public class ViewModelBase : ReactiveObject
         set => this.RaiseAndSetIfChanged(ref _hideBottomGallery, value);
     }
 
-    private string? _loopingDisabled = TranslationHelper.GetTranslation("LoopingDisabled");
+    private string? _loopingDisabled = TranslationHelper.Translation.LoopingDisabled;
 
     public string? LoopingDisabled
     {
@@ -1484,7 +1484,7 @@ public class ViewModelBase : ReactiveObject
         set => this.RaiseAndSetIfChanged(ref _loopingDisabled, value);
     }
 
-    private string? _loopingEnabled = TranslationHelper.GetTranslation("LoopingEnabled");
+    private string? _loopingEnabled = TranslationHelper.Translation.LoopingEnabled;
 
     public string? LoopingEnabled
     {

+ 4 - 4
src/PicView.Avalonia/Views/ShortcutsView.axaml.cs

@@ -14,10 +14,10 @@ public partial class ShortcutsView : UserControl
     {
         InitializeComponent();
         DefaultButton.Click += async delegate { await SetDefault(); };
-        FullscreenBox.Text = $"{TranslationHelper.GetTranslation("Shift")} + {TranslationHelper.GetTranslation("DoubleClick")}";
-        FullscreenBox.Text = $"{TranslationHelper.GetTranslation("Shift")} + {TranslationHelper.GetTranslation("DoubleClick")}";
-        DragWindowBox.Text = $"{TranslationHelper.GetTranslation("Shift")} + {TranslationHelper.GetTranslation("MouseDrag")}";
-        CloseBox.Text = TranslationHelper.GetTranslation("Esc");
+        FullscreenBox.Text = $"{TranslationHelper.Translation.Shift} + {TranslationHelper.Translation.DoubleClick}";
+        FullscreenBox.Text = $"{TranslationHelper.Translation.Shift} + {TranslationHelper.Translation.DoubleClick}";
+        DragWindowBox.Text = $"{TranslationHelper.Translation.Shift} + {TranslationHelper.Translation.MouseDrag}";
+        CloseBox.Text = TranslationHelper.Translation.Esc;
     }
 
     private async Task SetDefault()

+ 12 - 74
src/PicView.Core/Gallery/GalleryThumbInfo.cs

@@ -5,66 +5,17 @@ using PicView.Core.Extensions;
 
 namespace PicView.Core.Gallery;
 
-public class GalleryThumbInfo
+public static class GalleryThumbInfo
 {
-    /// <summary>
-    /// Interface for providing platform-specific image sources.
-    /// </summary>
-    public interface IImageSource
-    {
-        /// <summary>
-        /// Gets the platform-specific image source.
-        /// </summary>
-        /// <returns>The platform-specific image source object.</returns>
-        object GetPlatformImageSource();
-    }
-
     /// <summary>
     /// Represents the data for a gallery thumbnail.
     /// </summary>
     public struct GalleryThumbHolder
     {
-        /// <summary>
-        /// Gets or sets the file location of the thumbnail.
-        /// </summary>
-        public string FileLocation { get; set; }
-
-        /// <summary>
-        /// Gets or sets the file name of the thumbnail.
-        /// </summary>
-        public string FileName { get; set; }
-
-        /// <summary>
-        /// Gets or sets the file size of the thumbnail.
-        /// </summary>
-        public string FileSize { get; set; }
-
-        /// <summary>
-        /// Gets or sets the file date of the thumbnail.
-        /// </summary>
-        public string FileDate { get; set; }
-
-        /// <summary>
-        /// Gets or sets the source of the thumbnail.
-        /// </summary>
-        public IImageSource? ImageSource { get; set; }
-
-        public object? GetSource
-        {
-            get
-            {
-                try
-                {
-                    return ImageSource.GetPlatformImageSource();
-                }
-                catch (Exception)
-                {
-                    return null;
-                }
-            }
-        }
-
-        public double ThumbNailSize { get; set; }
+        public string FileLocation { get; }
+        public string FileName { get; }
+        public string FileSize { get; }
+        public string FileDate { get; }
 
         /// <summary>
         /// Initializes a new instance of the <see cref="GalleryThumbHolder"/> class.
@@ -73,15 +24,12 @@ public class GalleryThumbInfo
         /// <param name="fileName">The file name of the thumbnail.</param>
         /// <param name="fileSize">The file size of the thumbnail.</param>
         /// <param name="fileDate">The file date of the thumbnail.</param>
-        /// <param name="imageSource">The source of the thumbnail.</param>
-        public GalleryThumbHolder(string fileLocation, string fileName, string fileSize, string fileDate,
-            IImageSource? imageSource)
+        private GalleryThumbHolder(string fileLocation, string fileName, string fileSize, string fileDate)
         {
             FileLocation = fileLocation;
             FileName = fileName;
             FileSize = fileSize;
             FileDate = fileDate;
-            ImageSource = imageSource;
         }
 
         /// <summary>
@@ -91,28 +39,18 @@ public class GalleryThumbInfo
         /// <param name="imageSource">The image source of the thumbnail.</param>
         /// <param name="fileInfo">The file information of the thumbnail.</param>
         /// <returns>The <see cref="GalleryThumbHolder"/> instance containing thumbnail data.</returns>
-        public static GalleryThumbHolder GetThumbData(int index, IImageSource? imageSource, FileInfo? fileInfo)
+        public static GalleryThumbHolder GetThumbData(FileInfo? fileInfo)
         {
             const int fileNameLength = 60;
             var fileLocation = fileInfo.FullName;
             var fileName = Path.GetFileNameWithoutExtension(fileInfo.Name);
             fileName = fileName.Length > fileNameLength ? fileName.Shorten(fileNameLength) : fileName;
-            var getFileSizeResource = TranslationHelper.GetTranslation("FileSize");
-            var getFileDateResource = TranslationHelper.GetTranslation("Modified");
-            var fileSize = "";
-            var fileDate = "";
-            if (!string.IsNullOrWhiteSpace(getFileSizeResource))
-            {
-                fileSize = $"{getFileSizeResource}: {fileInfo.Length.GetReadableFileSize()}";
-            }
-
-            if (!string.IsNullOrWhiteSpace(getFileDateResource))
-            {
-                fileDate =
-                    $"{getFileDateResource}: {fileInfo.LastWriteTimeUtc.ToString(CultureInfo.CurrentCulture)}";
-            }
+            var fileSize = 
+                $"{TranslationHelper.Translation.FileSize}: {fileInfo.Length.GetReadableFileSize()}";
+            var fileDate = 
+                $"{TranslationHelper.Translation.Modified}: {fileInfo.LastWriteTimeUtc.ToString(CultureInfo.CurrentCulture)}";
 
-            return new GalleryThumbHolder(fileLocation, fileName, fileSize, fileDate, imageSource);
+            return new GalleryThumbHolder(fileLocation, fileName, fileSize, fileDate);
         }
     }
 }

+ 1 - 1
src/PicView.Core/Localization/LanguageModel.cs

@@ -1,6 +1,6 @@
 namespace PicView.Core.Localization;
 
-internal class LanguageModel
+public class LanguageModel
 {
     public string? Loading { get; set; }
     public string? NoImage { get; set; }

+ 63 - 60
src/PicView.Core/Localization/TranslationHelper.cs

@@ -1,6 +1,5 @@
 using PicView.Core.Config;
 using System.Diagnostics;
-using System.IO;
 using System.Text.Json;
 using System.Text.Json.Serialization;
 
@@ -8,36 +7,49 @@ namespace PicView.Core.Localization;
 
 [JsonSourceGenerationOptions(AllowTrailingCommas = true)]
 [JsonSerializable(typeof(LanguageModel))]
-internal partial class LanguageSourceGenerationContext : JsonSerializerContext
-{
-}
+internal partial class LanguageSourceGenerationContext : JsonSerializerContext;
 
 /// <summary>
 /// Helper class for managing language-related tasks.
 /// </summary>
 public static class TranslationHelper
 {
-    public static string GetTranslation(string key)
+    private static readonly object TranslationLock = new object();
+
+    private static LanguageModel? _translation;
+
+    /// <summary>
+    /// Dictionary to store language key-value pairs.
+    /// </summary>
+    public static LanguageModel? Translation
     {
-        if (Language == null)
+        get
+        {
+            lock (TranslationLock)
+            {
+                return _translation;
+            }
+        }
+        private set
         {
-            return string.Empty;
+            lock (TranslationLock)
+            {
+                _translation = value;
+            }
         }
+    }
 
-        var propertyInfo = typeof(LanguageModel).GetProperty(key);
-        if (propertyInfo == null)
+    public static string GetTranslation(string key)
+    {
+        if (Translation == null)
         {
-            return string.Empty;
+            return key;
         }
 
-        return propertyInfo.GetValue(Language) as string ?? string.Empty;
+        var propertyInfo = typeof(LanguageModel).GetProperty(key);
+        return propertyInfo?.GetValue(Translation) as string ?? key;
     }
 
-    /// <summary>
-    /// Dictionary to store language key-value pairs.
-    /// </summary>
-    internal static LanguageModel? Language;
-
     /// <summary>
     /// Determines the language based on the specified culture and loads the corresponding language file.
     /// </summary>
@@ -48,73 +60,64 @@ public static class TranslationHelper
 
         try
         {
-            if (File.Exists(jsonLanguageFile))
-            {
-                await Deserialize(jsonLanguageFile).ConfigureAwait(false);
-            }
-            else
-            {
-                var languagesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config/Languages/");
-
-                var file = Directory.GetFiles(languagesDirectory, "*.json").FirstOrDefault();
-                if (file != null)
-                {
-                    await Deserialize(file).ConfigureAwait(false);
-                }
-                else
-                {
-                    throw new FileNotFoundException();
-                }
-            }
+            await LoadLanguageFromFileAsync(jsonLanguageFile).ConfigureAwait(false);
+            return true;
         }
-        catch (Exception exception)
+        catch (FileNotFoundException fnfEx)
         {
 #if DEBUG
-            Trace.WriteLine($"{nameof(LoadLanguage)} exception:\n{exception.Message}");
+            Trace.WriteLine($"Language file not found: {fnfEx.Message}");
 #endif
             return false;
         }
-
-        return true;
-
-        async Task Deserialize(string file)
+        catch (Exception ex)
         {
-            var jsonString = await File.ReadAllTextAsync(file).ConfigureAwait(false);
-            var language = JsonSerializer.Deserialize(
-                    jsonString, typeof(LanguageModel), LanguageSourceGenerationContext.Default)
-                as LanguageModel;
-            Language = language;
+#if DEBUG
+            Trace.WriteLine($"{nameof(LoadLanguage)} exception:\n{ex.Message}");
+#endif
+            return false;
         }
     }
 
     public static IEnumerable<string> GetLanguages()
     {
-        var languagesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config/Languages/");
+        var languagesDirectory = GetLanguagesDirectory();
+        return Directory.EnumerateFiles(languagesDirectory, "*.json", SearchOption.TopDirectoryOnly);
+    }
 
-        return Directory.EnumerateFiles(languagesDirectory, "*")
-            .Where(file => file?.EndsWith(".json", StringComparison.OrdinalIgnoreCase) ==
-                true);
+    public static async Task ChangeLanguage(int language)
+    {
+        var choice = (Languages)language;
+        var languageCode = choice.ToString().Replace('_', '-');
+        SettingsHelper.Settings.UIProperties.UserLanguage = languageCode;
+        await LoadLanguage(languageCode).ConfigureAwait(false);
+        await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
     }
 
     private static string DetermineLanguageFilePath(string isoLanguageCode)
     {
-        var languagesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config/Languages/");
-
+        var languagesDirectory = GetLanguagesDirectory();
         var matchingFiles = Directory.GetFiles(languagesDirectory, "*.json")
             .Where(file => Path.GetFileNameWithoutExtension(file)?.Equals(isoLanguageCode, StringComparison.OrdinalIgnoreCase) == true)
             .ToList();
 
-        return matchingFiles.Count > 0 ? matchingFiles.First() :
-            // If no exact match is found, default to English
-            Path.Combine(languagesDirectory, "en.json");
+        return matchingFiles.FirstOrDefault() ?? Path.Combine(languagesDirectory, "en.json");
     }
 
-    public static async Task ChangeLanguage(int language)
+    private static async Task LoadLanguageFromFileAsync(string filePath)
     {
-        var choice = (Languages)language;
-        SettingsHelper.Settings.UIProperties.UserLanguage = choice.ToString().Replace('_', '-');
-        await LoadLanguage(SettingsHelper.Settings.UIProperties.UserLanguage).ConfigureAwait(false);
+        if (!File.Exists(filePath))
+        {
+            throw new FileNotFoundException($"Language file not found: {filePath}");
+        }
 
-        await SettingsHelper.SaveSettingsAsync().ConfigureAwait(false);
+        var jsonString = await File.ReadAllTextAsync(filePath).ConfigureAwait(false);
+        var language = JsonSerializer.Deserialize(jsonString, typeof(LanguageModel), LanguageSourceGenerationContext.Default) as LanguageModel;
+        Translation = language;
     }
-}
+
+    private static string GetLanguagesDirectory()
+    {
+        return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config/Languages/");
+    }
+}

+ 3 - 1
src/PicView.Core/PicView.Core.csproj

@@ -11,6 +11,7 @@
     <IsAotCompatible>True</IsAotCompatible>
     <IsTrimmable>True</IsTrimmable>
     <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
+    <PlatformTarget>ARM64</PlatformTarget>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -18,10 +19,11 @@
     <IsTrimmable>True</IsTrimmable>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <DebugType>none</DebugType>
+    <PlatformTarget>ARM64</PlatformTarget>
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Magick.NET-Q8-OpenMP-x64" Version="13.9.1" />
+    <PackageReference Include="Magick.NET-Q8-arm64" Version="13.9.1" />
   </ItemGroup>
 
   <ItemGroup>