浏览代码

Avalonia updates

Ruben 1 年之前
父节点
当前提交
b7f7781d45

+ 14 - 9
src/PicView.Avalonia.Win32/App.axaml.cs

@@ -1,12 +1,10 @@
-using System;
-using System.Runtime;
-using Avalonia;
+using Avalonia;
 using Avalonia.Controls.ApplicationLifetimes;
 using Avalonia.Markup.Xaml;
-using PicView.Avalonia.Helpers;
 using PicView.Avalonia.ViewModels;
 using PicView.Avalonia.Win32.Views;
-using ReactiveUI;
+using PicView.Core.Config;
+using PicView.Core.Localization;
 
 namespace PicView.Avalonia.Win32;
 
@@ -14,18 +12,25 @@ public class App : Application
 {
     public override void Initialize()
     {
-        ProfileOptimization.SetProfileRoot(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config/"));
-        ProfileOptimization.StartProfile("ProfileOptimization");
-        StartUpHelper.InitializeSettings();
         AvaloniaXamlLoader.Load(this);
     }
 
-    public override void OnFrameworkInitializationCompleted()
+    public override async void OnFrameworkInitializationCompleted()
     {
         if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
         {
+            try
+            {
+                await SettingsHelper.LoadSettingsAsync();
+                _ = Task.Run(() => TranslationHelper.LoadLanguage(SettingsHelper.Settings.UIProperties.UserLanguage));
+            }
+            catch (TaskCanceledException)
+            {
+                return;
+            }
             var w = desktop.MainWindow = new WinMainWindow();
             w.DataContext = new MainViewModel();
+            w.Show();
         }
 
         base.OnFrameworkInitializationCompleted();

+ 3 - 0
src/PicView.Avalonia/PicView.Avalonia.csproj

@@ -69,6 +69,9 @@
     <Compile Update="Views\UC\Menus\ImageMenu.axaml.cs">
       <DependentUpon>ImageMenu.axaml</DependentUpon>
     </Compile>
+    <Compile Update="Views\UC\SpinWaiter.axaml.cs">
+      <DependentUpon>SpinWaiter.axaml</DependentUpon>
+    </Compile>
     <Compile Update="Views\UC\TitleTextbox.axaml.cs">
       <DependentUpon>TitleTextBox.axaml</DependentUpon>
     </Compile>

+ 72 - 17
src/PicView.Avalonia/ViewModels/MainViewModel.cs

@@ -131,6 +131,10 @@ namespace PicView.Avalonia.ViewModels
             set => this.RaiseAndSetIfChanged(ref _currentView, value);
         }
 
+        private readonly SpinWaiter? _spinWaiter;
+
+        private readonly ImageViewer? _imageViewer;
+
         private IImage? _image;
 
         public IImage? Image
@@ -291,6 +295,38 @@ namespace PicView.Avalonia.ViewModels
             set => this.RaiseAndSetIfChanged(ref _getSoftware, value);
         }
 
+        private string? _getResolutionUnit;
+
+        public string? GetResolutionUnit
+        {
+            get => _getResolutionUnit;
+            set => this.RaiseAndSetIfChanged(ref _getResolutionUnit, value);
+        }
+
+        private string? _getColorRepresentation;
+
+        public string? GetColorRepresentation
+        {
+            get => _getColorRepresentation;
+            set => this.RaiseAndSetIfChanged(ref _getColorRepresentation, value);
+        }
+
+        private string? _getCompression;
+
+        public string? GetCompression
+        {
+            get => _getCompression;
+            set => this.RaiseAndSetIfChanged(ref _getCompression, value);
+        }
+
+        private string? _getCompressedBitsPixel;
+
+        public string? GetCompressedBitsPixel
+        {
+            get => _getCompressedBitsPixel;
+            set => this.RaiseAndSetIfChanged(ref _getCompressedBitsPixel, value);
+        }
+
         #region Window Properties
 
         private string? _title = "Loading...";
@@ -780,6 +816,10 @@ namespace PicView.Avalonia.ViewModels
                     GetTitle = profile?.GetValue(ExifTag.XPTitle)?.Value.ToString() ?? string.Empty;
                     GetSubject = profile?.GetValue(ExifTag.XPSubject)?.Value.ToString() ?? string.Empty;
                     GetSoftware = profile?.GetValue(ExifTag.Software)?.Value ?? string.Empty;
+                    GetResolutionUnit = profile?.GetValue(ExifTag.ResolutionUnit)?.Value.ToString() ?? string.Empty;
+                    GetColorRepresentation = EXIFHelper.GetColorSpace(profile);
+                    GetCompression = profile?.GetValue(ExifTag.Compression)?.Value.ToString() ?? string.Empty;
+                    GetCompressedBitsPixel = profile?.GetValue(ExifTag.CompressedBitsPerPixel)?.Value.ToString() ?? string.Empty;
                 }
                 catch (Exception)
                 {
@@ -871,29 +911,29 @@ namespace PicView.Avalonia.ViewModels
             try
             {
                 ImageIterator.Index = index;
-                var x = 0;
 
                 var preLoadValue = ImageIterator.PreLoader.Get(index, ImageIterator.Pics);
+                var viewChanged = false;
                 if (preLoadValue is not null)
                 {
                     while (preLoadValue.IsLoading && ImageIterator.Index == index)
                     {
-                        if (x == 0)
+                        SetLoadingTitle();
+
+                        using var image = new MagickImage();
+                        image.Ping(ImageIterator.Pics[index]);
+                        var thumb = image.GetExifProfile()?.CreateThumbnail();
+                        if (thumb is not null)
                         {
-                            SetLoadingTitle();
-                            using var image = new MagickImage();
-                            image.Ping(ImageIterator.Pics[index]);
-                            var thumb = image.GetExifProfile()?.CreateThumbnail();
-                            if (thumb is not null)
-                            {
-                                var stream = new MemoryStream(thumb?.ToByteArray());
-                                Image = new Bitmap(stream);
-                            }
-                            else
-                            {
-                                Image = null;
-                            }
+                            var stream = new MemoryStream(thumb?.ToByteArray());
+                            Image = new Bitmap(stream);
+                        }
+                        else if (!viewChanged)
+                        {
+                            CurrentView = _spinWaiter;
+                            viewChanged = true;
                         }
+
                         await Task.Delay(20);
                         if (ImageIterator.Index != index)
                         {
@@ -905,9 +945,19 @@ namespace PicView.Avalonia.ViewModels
 
                 if (preLoadValue is null)
                 {
+                    if (!viewChanged)
+                    {
+                        CurrentView = _spinWaiter;
+                        viewChanged = true;
+                    }
                     await GetPreload();
                 }
 
+                if (viewChanged)
+                {
+                    CurrentView = _imageViewer;
+                }
+
                 if (ImageIterator.Index != index)
                 {
                     await ImageIterator.Preload(ImageService);
@@ -1023,16 +1073,19 @@ namespace PicView.Avalonia.ViewModels
             var args = Environment.GetCommandLineArgs();
             if (args.Length > 1)
             {
-                CurrentView = new ImageViewer();
+                _imageViewer = new ImageViewer();
+                CurrentView = _imageViewer;
                 Task.Run(async () => { await LoadPicFromString(args[1]); });
             }
             else if (SettingsHelper.Settings.StartUp.OpenLastFile)
             {
-                CurrentView = new ImageViewer();
+                _imageViewer = new ImageViewer();
+                CurrentView = _imageViewer;
                 Task.Run(async () => { await LoadPicFromString(SettingsHelper.Settings.StartUp.LastFile); });
             }
             else
             {
+                _imageViewer = new ImageViewer();
                 CurrentView = new StartUpMenu();
             }
 
@@ -1050,6 +1103,8 @@ namespace PicView.Avalonia.ViewModels
                 WindowHelper.InitializeWindowSizeAndPosition(desktop);
             }
 
+            _spinWaiter = new SpinWaiter();
+
             Task.Run(UpdateLanguage);
 
             #region Window commands

+ 8 - 8
src/PicView.Avalonia/Views/ExifView.axaml

@@ -678,12 +678,12 @@
                                 Width="100"
                                 Margin="0,8,2,0"
                                 Classes="txt"
-                                Text="{Binding DateTaken}" />
+                                Text="{Binding ResolutionUnit}" />
                             <TextBox
                                 Background="{StaticResource BackgroundAlpha}"
                                 Classes=" TStyle"
                                 IsReadOnly="True"
-                                Text="{Binding GetDateTaken}" />
+                                Text="{Binding GetResolutionUnit}" />
                             <Button Classes="altHover BorderStyle" ToolTip.Tip="{Binding Copy}">
                                 <Path
                                     Width="16"
@@ -699,12 +699,12 @@
                                 Width="100"
                                 Margin="0,8,2,0"
                                 Classes="txt"
-                                Text="{Binding Copyright}" />
+                                Text="{Binding ColorRepresentation}" />
                             <TextBox
                                 Background="{StaticResource BackgroundAlpha}"
                                 Classes=" TStyle"
                                 IsReadOnly="True"
-                                Text="{Binding GetCopyright}" />
+                                Text="{Binding GetColorRepresentation}" />
                             <Button Classes="altHover BorderStyle" ToolTip.Tip="{Binding Copy}">
                                 <Path
                                     Width="16"
@@ -723,12 +723,12 @@
                                     Width="100"
                                     Margin="0,8,2,0"
                                     Classes="txt"
-                                    Text="{Binding Authors}" />
+                                    Text="{Binding Compression}" />
                                 <TextBox
                                     Background="{StaticResource BackgroundAlpha}"
                                     Classes=" TStyle"
                                     IsReadOnly="True"
-                                    Text="{Binding GetAuthors}" />
+                                    Text="{Binding GetCompression}" />
                                 <Button Classes="altHover BorderStyle" ToolTip.Tip="{Binding Copy}">
                                     <Path
                                         Width="16"
@@ -744,12 +744,12 @@
                                     Width="100"
                                     Margin="0,8,2,0"
                                     Classes="txt"
-                                    Text="Program name" />
+                                    Text="{Binding CompressedBitsPixel}" />
                                 <TextBox
                                     Background="{StaticResource BackgroundAlpha}"
                                     Classes=" TStyle"
                                     IsReadOnly="True"
-                                    Text="" />
+                                    Text="{Binding GetCompressedBitsPixel}" />
                                 <Button Classes="altHover BorderStyle" ToolTip.Tip="{Binding Copy}">
                                     <Path
                                         Width="16"

+ 0 - 2
src/PicView.Avalonia/Views/ExifView.axaml.cs

@@ -1,6 +1,4 @@
 using Avalonia.Controls;
-using Avalonia.Input;
-using static System.Formats.Asn1.AsnWriter;
 
 namespace PicView.Avalonia.Views;
 

+ 94 - 0
src/PicView.Avalonia/Views/UC/SpinWaiter.axaml

@@ -0,0 +1,94 @@
+<UserControl
+    x:Class="PicView.Avalonia.Views.UC.SpinWaiter"
+    xmlns="https://github.com/avaloniaui"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:PicView="clr-namespace:PicView.Avalonia.Views.UC"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+
+    <UserControl.Styles>
+        <Style Selector="PicView|SpinWaiter">
+            <Style.Setters>
+                <Setter Property="Transitions">
+                    <Transitions>
+                        <DoubleTransition Property="Opacity" Duration="0:0:0.35" />
+                    </Transitions>
+                </Setter>
+            </Style.Setters>
+            <Style.Animations>
+                <Animation
+                    FillMode="None"
+                    IterationCount="INFINITE"
+                    PlaybackDirection="Normal"
+                    Duration="0:0:1.5">
+                    <Animation.Easing>
+                        <QuadraticEaseInOut />
+                    </Animation.Easing>
+                    <KeyFrame Cue="0%">
+                        <Setter Property="RotateTransform.Angle" Value="0" />
+                    </KeyFrame>
+                    <KeyFrame Cue="30%">
+                        <Setter Property="RotateTransform.Angle" Value="0" />
+                    </KeyFrame>
+
+                    <KeyFrame Cue="100%">
+                        <Setter Property="RotateTransform.Angle" Value="360" />
+                    </KeyFrame>
+                </Animation>
+            </Style.Animations>
+            <Setter Property="Template">
+                <ControlTemplate>
+
+                    <Arc
+                        Name="PART_Arc"
+                        Width="52"
+                        Height="52"
+                        StartAngle="270"
+                        Stretch="None"
+                        Stroke="{DynamicResource AccentColor}"
+                        StrokeJoin="Round"
+                        StrokeLineCap="Round"
+                        StrokeThickness="4"
+                        SweepAngle="30">
+
+                        <Arc.Transitions>
+                            <Transitions>
+                                <DoubleTransition
+                                    Easing="CircularEaseOut"
+                                    Property="SweepAngle"
+                                    Duration="0:0:0.8" />
+                            </Transitions>
+                        </Arc.Transitions>
+                    </Arc>
+                </ControlTemplate>
+            </Setter>
+        </Style>
+
+        <Style Selector="PicView|SpinWaiter /template/ Arc">
+
+            <Style.Animations>
+                <Animation
+                    Easing="QuadraticEaseInOut"
+                    FillMode="None"
+                    IterationCount="INFINITE"
+                    PlaybackDirection="Normal"
+                    Duration="0:0:1.5">
+                    <KeyFrame Cue="0%">
+                        <Setter Property="SweepAngle" Value="60" />
+                    </KeyFrame>
+
+                    <KeyFrame Cue="50%">
+                        <Setter Property="SweepAngle" Value="250" />
+                    </KeyFrame>
+
+                    <KeyFrame Cue="100%">
+                        <Setter Property="SweepAngle" Value="60" />
+                    </KeyFrame>
+                </Animation>
+            </Style.Animations>
+        </Style>
+    </UserControl.Styles>
+</UserControl>

+ 13 - 0
src/PicView.Avalonia/Views/UC/SpinWaiter.axaml.cs

@@ -0,0 +1,13 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Data;
+
+namespace PicView.Avalonia.Views.UC;
+
+public partial class SpinWaiter : UserControl
+{
+    public SpinWaiter()
+    {
+        InitializeComponent();
+    }
+}

+ 7 - 1
src/PicView.Core/Config/Languages/da.json

@@ -318,5 +318,11 @@
   "Copyright": "Ophavsret",
   "Title": "Titel",
   "Subject": "Emne",
-  "Software": "Program"
+  "Software": "Program",
+  "ResolutionUnit": "Opløsningsenhed",
+  "ColorRepresentation": "Farve repræsentation",
+  "ExifVersion": "Exif version",
+  "ExposureTime": "Eksponeringstid",
+  "Uncalibrated": "Ikke kalibreret",
+  "CompressedBitsPixel": "Komprimerede bits pr. pixel",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/de.json

@@ -318,5 +318,11 @@
   "Copyright": "Urheberrecht",
   "Title": "Titel",
   "Subject": "Thema",
-  "Software": "Software"
+  "Software": "Software",
+  "ResolutionUnit": "Auflösungseinheit",
+  "ColorRepresentation": "Farbdarstellung",
+  "ExifVersion": "Exif-Version",
+  "ExposureTime": "Belichtungszeit",
+  "Uncalibrated": "Nicht kalibriert",
+  "CompressedBitsPixel": "Komprimierte Bits pro Pixel",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/en.json

@@ -318,5 +318,11 @@
   "Copyright": "Copyright",
   "Title": "Title",
   "Subject": "Subject",
-  "Software": "Software"
+  "Software": "Software",
+  "ResolutionUnit": "Resolution unit",
+  "ColorRepresentation": "Color representation",
+  "ExifVersion": "Exif version",
+  "ExposureTime": "Exposure time",
+  "Uncalibrated": "Uncalibrated",
+  "CompressedBitsPixel": "Compressed bits per pixel",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/es.json

@@ -318,5 +318,11 @@
   "Copyright": "Derechos de autor",
   "Title": "Título",
   "Subject": "Asunto",
-  "Software": "Software"
+  "Software": "Software",
+  "ResolutionUnit": "Unidad de resolución",
+  "ColorRepresentation": "Representación de color",
+  "ExifVersion": "Versión Exif",
+  "ExposureTime": "Tiempo de exposición",
+  "Uncalibrated": "Sin calibrar",
+  "CompressedBitsPixel": "Bits por píxel comprimidos",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/fr.json

@@ -318,5 +318,11 @@
   "Copyright": "Droits d'auteur",
   "Title": "Titre",
   "Subject": "Sujet",
-  "Software": "Logiciel"
+  "Software": "Logiciel",
+  "ResolutionUnit": "Unité de résolution",
+  "ColorRepresentation": "Représentation des couleurs",
+  "ExifVersion": "Version Exif",
+  "ExposureTime": "Temps d'exposition",
+  "Uncalibrated": "Non calibré",
+  "CompressedBitsPixel": "Bits de pixel compressés",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/it.json

@@ -318,5 +318,11 @@
   "Copyright": "Diritti d'autore",
   "Title": "Titolo",
   "Subject": "Soggetto",
-  "Software": "Software"
+  "Software": "Software",
+  "ResolutionUnit": "Unità di risoluzione",
+  "ColorRepresentation": "Rappresentazione del colore",
+  "ExifVersion": "Versione Exif",
+  "ExposureTime": "Tempo di esposizione",
+  "Uncalibrated": "Non calibrato",
+  "CompressedBitsPixel": "Bit per pixel compressi",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/ko.json

@@ -318,5 +318,11 @@
   "Copyright": "저작권",
   "Title": "제목",
   "Subject": "주제",
-  "Software": "소프트웨어"
+  "Software": "소프트웨어",
+  "ResolutionUnit": "해상도 단위",
+  "ColorRepresentation": "색상 표현",
+  "ExifVersion": "Exif 버전",
+  "ExposureTime": "노출 시간",
+  "Uncalibrated": "보정되지 않음",
+  "CompressedBitsPixel": "압축된 비트 픽셀",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/pl.json

@@ -318,5 +318,11 @@
   "Copyright": "Prawa autorskie",
   "Title": "Tytuł",
   "Subject": "Temat",
-  "Software": "Oprogramowanie"
+  "Software": "Oprogramowanie",
+  "ResolutionUnit": "Jednostka rozdzielczości",
+  "ColorRepresentation": "Reprezentacja kolorów",
+  "ExposureTime": "Czas ekspozycji",
+  "ExifVersion": "Wersja Exif",
+  "Uncalibrated": "Niekalibrowany",
+  "CompressedBitsPixel": "Kompresja bitów na piksel",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/ro.json

@@ -318,5 +318,11 @@
   "Copyright": "Drepturi de autor",
   "Title": "Titlu",
   "Subject": "Subiect",
-  "Software": "Software"
+  "Software": "Software",
+  "ResolutionUnit": "Unitate de rezoluție",
+  "ColorRepresentation": "Reprezentare color",
+  "ExposureTime": "Timp de expunere",
+  "ExifVersion": "Versiune Exif",
+  "Uncalibrated": "Necalibrat",
+  "CompressedBitsPixel": "Biți compresați pe pixel",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/ru.json

@@ -318,5 +318,11 @@
   "Copyright": "Авторское право",
   "Title": "Заголовок",
   "Subject": "Тема",
-  "Software": "Программное обеспечение"
+  "Software": "Программное обеспечение",
+  "ResolutionUnit": "Единица разрешения",
+  "ColorRepresentation": "Цветовое представление",
+  "ExposureTime": "Время экспозиции",
+  "ExifVersion": "Версия Exif",
+  "Uncalibrated": "Некалиброванный",
+  "CompressedBitsPixel": "Сжатые биты на пиксель",
 }

+ 7 - 1
src/PicView.Core/Config/Languages/zh-CN.json

@@ -318,5 +318,11 @@
   "Copyright": "版权",
   "Title": "标题",
   "Subject": "主题",
-  "Software": "软件"
+  "Software": "软件",
+  "ResolutionUnit": "分辨率单位",
+  "ColorRepresentation": "颜色表示",
+  "ExposureTime": "曝光时间",
+  "ExifVersion": "Exif 版本",
+  "Uncalibrated": "未校准",
+  "CompressedBitsPixel": "压缩位像素",
 }

+ 8 - 2
src/PicView.Core/Config/Languages/zh-TW.json

@@ -309,7 +309,7 @@
   "ApplicationStartup": "應用程式啟動",
   "OpenInSameWindow": "在同一視窗中開啟檔案",
   "NoChange": "無變化",
-  "Meter": "米"
+  "Meter": "米",
   "Latitude": "緯度",
   "Longitude": "經度",
   "Altitude": "海拔",
@@ -318,5 +318,11 @@
   "Copyright": "版權",
   "Title": "標題",
   "Subject": "主題",
-  "Software": "軟體"
+  "Software": "軟體",
+  "ResolutionUnit": "解析度單位",
+  "ColorRepresentation": "色彩表示",
+  "ExposureTime": "曝光時間",
+  "ExifVersion": "Exif 版本",
+  "Uncalibrated": "未校準",
+  "CompressedBitsPixel": "壓縮位元像素",
 }

+ 1 - 14
src/PicView.Core/Config/SettingsHelper.cs

@@ -5,7 +5,7 @@ using System.Text.Json.Serialization;
 
 namespace PicView.Core.Config;
 
-[JsonSourceGenerationOptions(WriteIndented = true)]
+[JsonSourceGenerationOptions(AllowTrailingCommas = true)]
 [JsonSerializable(typeof(AppSettings))]
 internal partial class SourceGenerationContext : JsonSerializerContext;
 
@@ -14,11 +14,9 @@ public static class SettingsHelper
     private const double CurrentSettingsVersion = 1;
 
     public static AppSettings? Settings { get; private set; }
-    private static JsonSerializerOptions? _jsonSerializerOptions;
 
     public static async Task LoadSettingsAsync()
     {
-        InitiateJson();
         try
         {
             var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config/UserSettings.json");
@@ -86,18 +84,8 @@ public static class SettingsHelper
         Settings.UIProperties.UserLanguage = CultureInfo.CurrentCulture.Name;
     }
 
-    private static void InitiateJson()
-    {
-        _jsonSerializerOptions ??= new JsonSerializerOptions
-        {
-            TypeInfoResolver = SourceGenerationContext.Default,
-            AllowTrailingCommas = true
-        };
-    }
-
     private static async Task PerformSave(string path)
     {
-        InitiateJson();
         var updatedJson = JsonSerializer.Serialize(
             Settings, typeof(AppSettings), SourceGenerationContext.Default);
         await using var writer = new StreamWriter(path);
@@ -184,7 +172,6 @@ public static class SettingsHelper
             }
 
             // Save the synchronized settings back to the JSON file
-            InitiateJson();
             var updatedJson = JsonSerializer.Serialize(
                 existingSettings, typeof(AppSettings), SourceGenerationContext.Default);
             await File.WriteAllTextAsync(path, updatedJson).ConfigureAwait(false);

+ 17 - 0
src/PicView.Core/ImageDecoding/EXIFHelper.cs

@@ -1,5 +1,6 @@
 using System.Globalization;
 using ImageMagick;
+using PicView.Core.Localization;
 using static System.Runtime.InteropServices.JavaScript.JSType;
 
 namespace PicView.Core.ImageDecoding;
@@ -149,4 +150,20 @@ public static class EXIFHelper
             return coordinate;
         }
     }
+
+    public static string GetColorSpace(IExifProfile profile)
+    {
+        var colorSpace = profile?.GetValue(ExifTag.ColorSpace)?.Value;
+        if (colorSpace == null)
+        {
+            return string.Empty;
+        }
+        return colorSpace switch
+        {
+            1 => "sRGB",
+            2 => "Adobe RGB",
+            65535 => TranslationHelper.GetTranslation("Uncalibrated"),
+            _ => string.Empty
+        };
+    }
 }

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

@@ -327,4 +327,5 @@ internal class LanguageModel
     public string? Title { get; set; }
     public string? Subject { get; set; }
     public string? Software { get; set; }
+    public string? Uncalibrated { get; set; }
 }

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

@@ -6,7 +6,7 @@ using System.Text.Json.Serialization;
 
 namespace PicView.Core.Localization;
 
-[JsonSourceGenerationOptions(WriteIndented = true)]
+[JsonSourceGenerationOptions(AllowTrailingCommas = true)]
 [JsonSerializable(typeof(LanguageModel))]
 internal partial class LanguageSourceGenerationContext : JsonSerializerContext
 {