Ruben 6 месяцев назад
Родитель
Сommit
6a0cff359d

+ 1 - 1
src/Directory.Build.props

@@ -4,7 +4,7 @@
     <AvaloniaVersion>11.2.6</AvaloniaVersion>
     <VersionPrefix>3.1.0</VersionPrefix>
     <VersionSuffix></VersionSuffix>
-    <AssemblyVersion>3.0.1.0</AssemblyVersion>
+    <AssemblyVersion>3.1.0.0</AssemblyVersion>
     <FileVersion>3.1.0</FileVersion>
   </PropertyGroup>
 </Project>

+ 0 - 6
src/PicView.Avalonia/StartUp/StartUpHelper.cs

@@ -10,7 +10,6 @@ using PicView.Avalonia.Input;
 using PicView.Avalonia.Navigation;
 using PicView.Avalonia.SettingsManagement;
 using PicView.Avalonia.UI;
-using PicView.Avalonia.Update;
 using PicView.Avalonia.ViewModels;
 using PicView.Avalonia.Views;
 using PicView.Avalonia.WindowBehavior;
@@ -44,11 +43,6 @@ public static class StartUpHelper
             else if (args.Length > 1)
             {
                 var arg = args[1];
-                if (arg.Equals("update", StringComparison.InvariantCultureIgnoreCase))
-                {
-                    Task.Run(async () => await UpdateManager.UpdateCurrentVersion(vm));
-                    return;
-                }
                 if (arg.StartsWith("associate:", StringComparison.OrdinalIgnoreCase) ||
                     arg.StartsWith("unassociate:", StringComparison.OrdinalIgnoreCase))
                 {

+ 9 - 0
src/PicView.Avalonia/Update/InstalledArchitecture.cs

@@ -0,0 +1,9 @@
+namespace PicView.Avalonia.Update;
+
+public enum InstalledArchitecture
+{
+    X64Portable,
+    X64Install,
+    Arm64Portable,
+    Arm64Install
+}

+ 44 - 116
src/PicView.Avalonia/Update/UpdateManager.cs

@@ -7,7 +7,9 @@ using Microsoft.Win32;
 using PicView.Avalonia.UI;
 using PicView.Avalonia.ViewModels;
 using PicView.Avalonia.WindowBehavior;
+using PicView.Core.Config;
 using PicView.Core.Http;
+using PicView.Core.ProcessHandling;
 #if RELEASE
 using PicView.Core.Config;
 #endif
@@ -32,48 +34,48 @@ public static class UpdateManager
     private const string ExecutableName = "PicView.exe";
     private const string UpdateArgument = "update";
     
-    /// <summary>
-    ///     Installation architecture types
-    /// </summary>
-    private enum InstalledArchitecture
-    {
-        X64Portable,
-        X64Install,
-        Arm64Portable,
-        Arm64Install
-    }
+    #if DEBUG
+    // ReSharper disable once ConvertToConstant.Local
+    private static readonly bool ForceUpdate = true;
+    #endif
     
     /// <summary>
     ///     Checks for updates and installs if a newer version is available
     /// </summary>
     /// <param name="vm">The main view model</param>
-    public static async Task UpdateCurrentVersion(MainViewModel vm)
+    public static async Task<bool> UpdateCurrentVersion(MainViewModel vm)
     {
         // TODO Add support for other OS
         // TODO add UI
         
-        // Handle admin privileges if needed
-        if (HandleAdminPrivilegesIfNeeded())
-        {
-            return; // Application was restarted with admin privileges
-        }
-        
         // Create temporary directory for update files
         var tempPath = CreateTemporaryDirectory();
         var tempJsonPath = Path.Combine(tempPath, "update.json");
 
-        // Get current version
-        var currentVersion = GetCurrentVersion();
-
-        // Download and parse update information
+        // Check if update is needed
+        Version? currentVersion;
+#if DEBUG
+        currentVersion = ForceUpdate ? new Version("3.0.0.3") : VersionHelper.GetAssemblyVersion();  
+#else
+        currentVersion = VersionHelper.GetAssemblyVersion();
+#endif
+        Debug.Assert(currentVersion != null);
+        
         var updateInfo = await DownloadAndParseUpdateInfo(tempJsonPath);
         if (updateInfo == null)
         {
-            return;
+            return false;
+        }
+        
+        var remoteVersion = new Version(updateInfo.Version);
+        if (remoteVersion <= currentVersion)
+        {
+            return false;
         }
 
         // Handle update based on platform and installation type
-        await HandlePlatformSpecificUpdate(vm, updateInfo, currentVersion, tempPath);
+        await HandlePlatformSpecificUpdate(vm, updateInfo, tempPath);
+        return true;
     }
 
     #region Utilities
@@ -102,63 +104,25 @@ public static class UpdateManager
     /// <summary>
     ///     Checks if the application needs to be elevated and restarts it if needed
     /// </summary>
-    /// <returns>True if the application was restarted with admin privileges</returns>
-    private static bool HandleAdminPrivilegesIfNeeded()
+    private static void HandleAdminPrivilegesIfNeeded()
     {
         if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
         {
-            return false;
+            return;
         }
 
-        return IsDirectoryAccessRestricted() && RestartWithAdminPrivileges();
-    }
-
-    /// <summary>
-    ///     Determines if the current directory has restricted access
-    /// </summary>
-    private static bool IsDirectoryAccessRestricted()
-    {
-        var currentDirectory = new DirectoryInfo(Environment.ProcessPath);
         try
         {
-            return currentDirectory.GetAccessControl().AreAccessRulesProtected;
+            // Determines if the current directory has restricted access
+            var currentDirectory = new DirectoryInfo(Environment.ProcessPath);
+            _ = currentDirectory.GetAccessControl().AreAccessRulesProtected;
         }
         catch (Exception)
         {
-            return false;
-        }
-    }
-
-    /// <summary>
-    ///     Restarts the application with admin privileges
-    /// </summary>
-    private static bool RestartWithAdminPrivileges()
-    {
-        var process = new Process
-        {
-            StartInfo = new ProcessStartInfo
-            {
-                Verb = "runas",
-                UseShellExecute = true,
-                FileName = ExecutableName,
-                Arguments = UpdateArgument,
-                WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory
-            }
-        };
-
-        try
-        {
-            process.Start();
+            ProcessHelper.StartProcessWithElevatedPermission(UpdateArgument);
             Environment.Exit(0);
-            return true;
-        }
-        catch (Exception e)
-        {
-            LogDebug(e);
-            return false;
         }
     }
-
     #endregion
 
     #region Update Info
@@ -173,19 +137,6 @@ public static class UpdateManager
         return tempPath;
     }
 
-    /// <summary>
-    ///     Gets the current application version
-    /// </summary>
-    private static Version? GetCurrentVersion()
-    {
-#if DEBUG
-        // Use a lower version in debug mode to test update functionality
-        return new Version("3.0.0.3");
-#else
-        return VersionHelper.GetAssemblyVersion();
-#endif
-    }
-
     /// <summary>
     ///     Downloads and parses the update information
     /// </summary>
@@ -231,17 +182,17 @@ public static class UpdateManager
         try
         {
             var jsonString = await File.ReadAllTextAsync(jsonFilePath);
-            var updateInfo = JsonSerializer.Deserialize(
-                jsonString, typeof(UpdateInfo),
-                UpdateSourceGenerationContext.Default) as UpdateInfo;
 
-            if (updateInfo == null)
+            if (JsonSerializer.Deserialize(
+                    jsonString, typeof(UpdateInfo),
+                    UpdateSourceGenerationContext.Default) is UpdateInfo updateInfo)
             {
-                await TooltipHelper.ShowTooltipMessageAsync("Update information is missing or corrupted.");
-                return null;
+                return updateInfo;
             }
 
-            return updateInfo;
+            await TooltipHelper.ShowTooltipMessageAsync("Update information is missing or corrupted.");
+            return null;
+
         }
         catch (Exception e)
         {
@@ -261,12 +212,11 @@ public static class UpdateManager
     private static async Task HandlePlatformSpecificUpdate(
         MainViewModel vm,
         UpdateInfo updateInfo,
-        Version? currentVersion,
         string tempPath)
     {
         if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
         {
-            await HandleWindowsUpdate(vm, updateInfo, currentVersion, tempPath);
+            await HandleWindowsUpdate(vm, updateInfo, tempPath);
         }
         else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
         {
@@ -284,32 +234,13 @@ public static class UpdateManager
     private static async Task HandleWindowsUpdate(
         MainViewModel vm,
         UpdateInfo updateInfo,
-        Version? currentVersion,
         string tempPath)
     {
         // Determine if application is installed or portable
         var isInstalled = IsApplicationInstalled();
 
         // Determine architecture
-        var architecture = DetermineArchitecture(isInstalled);
-
-        // Check if update is needed
-        var remoteVersion = new Version(updateInfo.Version);
-        if (remoteVersion <= currentVersion)
-        {
-            return;
-        }
-
-        // Apply update based on architecture and installation type
-        await ApplyWindowsUpdate(vm, updateInfo, architecture, tempPath);
-    }
-
-    /// <summary>
-    ///     Determines the installed architecture type
-    /// </summary>
-    private static InstalledArchitecture DetermineArchitecture(bool isInstalled)
-    {
-        return RuntimeInformation.ProcessArchitecture switch
+        var architecture = RuntimeInformation.ProcessArchitecture switch
         {
             Architecture.X64 => isInstalled ? InstalledArchitecture.X64Install : InstalledArchitecture.X64Portable,
             Architecture.Arm64 => isInstalled
@@ -317,6 +248,9 @@ public static class UpdateManager
                 : InstalledArchitecture.Arm64Portable,
             _ => InstalledArchitecture.X64Install
         };
+
+        // Apply update based on architecture and installation type
+        await ApplyWindowsUpdate(vm, updateInfo, architecture, tempPath);
     }
 
     /// <summary>
@@ -409,13 +343,7 @@ public static class UpdateManager
             "PicView",
             ExecutableName);
 
-        if (File.Exists(x64Path))
-        {
-            return true;
-        }
-
-        // Check registry for installation
-        return CheckRegistryForInstallation();
+        return File.Exists(x64Path) || CheckRegistryForInstallation();
     }
 
     /// <summary>

+ 23 - 1
src/PicView.Avalonia/Views/AboutView.axaml

@@ -113,7 +113,21 @@
     </UserControl.Resources>
 
     <Panel>
-        <uc:SpinWaiter IsVisible="False" x:Name="SpinWaiter" />
+
+        <uc:SpinWaiter
+            HorizontalAlignment="Center"
+            IsVisible="False"
+            VerticalAlignment="Center"
+            x:Name="SpinWaiter" />
+        <TextBlock
+            Classes="txt"
+            FontFamily="/Assets/Fonts/Roboto-Bold.ttf#Roboto"
+            FontSize="14"
+            HorizontalAlignment="Center"
+            IsVisible="{Binding IsVisible, ElementName=SpinWaiter}"
+            Margin="0,75,0,0"
+            Text="{CompiledBinding Translation.Downloading}"
+            VerticalAlignment="Center" />
 
         <StackPanel Margin="0,10,0,10" x:Name="ParentContainer">
 
@@ -191,6 +205,14 @@
                     Text="{CompiledBinding Translation.CheckForUpdates}" />
             </Button>
 
+            <TextBlock
+                Classes="txt"
+                Foreground="{Binding Path=Foreground, ElementName=UpdateButton}"
+                HorizontalAlignment="Center"
+                IsVisible="False"
+                Margin="0,10,0,15"
+                x:Name="UpdateStatus" />
+
             <HyperlinkButton
                 HorizontalAlignment="Center"
                 Margin="0,20,0,20"

+ 8 - 1
src/PicView.Avalonia/Views/AboutView.axaml.cs

@@ -6,6 +6,7 @@ using Avalonia.Styling;
 using PicView.Avalonia.Update;
 using PicView.Avalonia.ViewModels;
 using PicView.Core.Config;
+using PicView.Core.Localization;
 using PicView.Core.ProcessHandling;
 
 namespace PicView.Avalonia.Views;
@@ -85,7 +86,13 @@ public partial class AboutView : UserControl
                 SpinWaiter.IsVisible = true;
                 try
                 {
-                    await UpdateManager.UpdateCurrentVersion(DataContext as MainViewModel);
+                   var checkIfNewUpdate = await UpdateManager.UpdateCurrentVersion(DataContext as MainViewModel);
+                   UpdateButton.IsVisible = false;
+                   UpdateStatus.IsVisible = true;
+                   if (!checkIfNewUpdate)
+                   {
+                       UpdateStatus.Text = TranslationManager.Translation.NoUpdateFound;
+                   }
                 }
                 finally
                 {

+ 1 - 0
src/PicView.Avalonia/Views/UC/PopUps/CloseDialog.axaml

@@ -15,6 +15,7 @@
     <Panel Background="Transparent">
         <TextBlock
             Classes="txt"
+            FontFamily="/Assets/Fonts/Roboto-Bold.ttf#Roboto"
             FontSize="14"
             Foreground="{DynamicResource MainTextColor}"
             HorizontalAlignment="Center"

+ 2 - 0
src/PicView.Core/Config/Languages/da.json

@@ -94,6 +94,7 @@
   "DiskSize": "Disk størrelse",
   "DoubleClick": "Dobbeltklik",
   "Down": "Ned",
+  "Downloading": "Downloader",
   "Dpi": "DPI",
   "DragFileTo": "Slip filen til stifinderen eller et andet program/browser",
   "DragImage": "Træk billede",
@@ -220,6 +221,7 @@
   "NoImage": "Intet billede er indlæst",
   "NoImages": "Ingen billeder",
   "NoResize": "Ingen ændring",
+  "NoUpdateFound": "Ingen opdatering fundet.",
   "None": "Ingen",
   "Normal": "Normal",
   "NormalWindow": "Normalt vindue",

+ 2 - 0
src/PicView.Core/Config/Languages/de.json

@@ -94,6 +94,7 @@
   "DiskSize": "Festplattengröße",
   "DoubleClick": "Doppelklick",
   "Down": "Runter",
+  "Downloading": "Herunterladen",
   "Dpi": "DPI",
   "DragFileTo": "Ziehen Sie die Datei in den Windows Explorer oder eine andere Anwendung/einen anderen Browser",
   "DragImage": "Bild ziehen",
@@ -220,6 +221,7 @@
   "NoImage": "Kein Bild geladen",
   "NoImages": "Keine Bilder",
   "NoResize": "Keine Größenänderung",
+  "NoUpdateFound": "Kein Update gefunden.",
   "None": "Keine",
   "Normal": "Normal",
   "NormalWindow": "Normales Fenster",

+ 2 - 0
src/PicView.Core/Config/Languages/en.json

@@ -94,6 +94,7 @@
   "DiskSize": "Disk size",
   "DoubleClick": "Double Click",
   "Down": "Down",
+  "Downloading": "Downloading",
   "Dpi": "DPI",
   "DragFileTo": "Drag file to Windows Explorer or another application/browser",
   "DragImage": "Drag image",
@@ -220,6 +221,7 @@
   "NoImage": "No image loaded",
   "NoImages": "No Images",
   "NoResize": "No resize",
+  "NoUpdateFound": "No update found.",
   "None": "None",
   "Normal": "Normal",
   "NormalWindow": "Normal window",

+ 2 - 0
src/PicView.Core/Config/Languages/es.json

@@ -94,6 +94,7 @@
   "DiskSize": "Tamaño en disco",
   "DoubleClick": "Doble Click",
   "Down": "Abajo",
+  "Downloading": "Descargando",
   "Dpi": "DPI",
   "DragFileTo": "Arrastra el archivo al Explorador de Windows o a otra aplicación/navegador",
   "DragImage": "Arrastrar imagen",
@@ -220,6 +221,7 @@
   "NoImage": "No se ha cargado imagen",
   "NoImages": "No hay imágenes",
   "NoResize": "No resize",
+  "NoUpdateFound": "No se encontraron actualizaciones.",
   "None": "Ninguna",
   "Normal": "Normal",
   "NormalWindow": "Ventana normal",

+ 2 - 0
src/PicView.Core/Config/Languages/fr.json

@@ -94,6 +94,7 @@
   "DiskSize": "Taille sur le disque",
   "DoubleClick": "Double-clic",
   "Down": "Bas",
+  "Downloading": "Téléchargement",
   "Dpi": "DPI",
   "DragFileTo": "Faites glisser le fichier vers l'explorateur Windows ou une autre application/navigateur",
   "DragImage": "Faire glisser l'image",
@@ -220,6 +221,7 @@
   "NoImage": "Aucune image chargée",
   "NoImages": "Aucune image",
   "NoResize": "Pas de redimensionnement",
+  "NoUpdateFound": "Aucune mise à jour trouvée.",
   "None": "Rien",
   "Normal": "Normal",
   "NormalWindow": "Fenêtre normale",

+ 2 - 0
src/PicView.Core/Config/Languages/it.json

@@ -94,6 +94,7 @@
   "DiskSize": "Dimensione del disco",
   "DoubleClick": "Doppio clic",
   "Down": "Giù",
+  "Downloading": "Download in corso",
   "Dpi": "DPI",
   "DragFileTo": "Trascina il file nel Esploratore di Windows o in un'altra applicazione/browser",
   "DragImage": "Trascina l'immagine",
@@ -220,6 +221,7 @@
   "NoImage": "Nessuna immagine caricata",
   "NoImages": "Nessuna immagine",
   "NoResize": "No resize",
+  "NoUpdateFound": "Nessun aggiornamento trovato.",
   "None": "Nessuno",
   "Normal": "Normale",
   "NormalWindow": "Finestra normale",

+ 2 - 0
src/PicView.Core/Config/Languages/ja.json

@@ -94,6 +94,7 @@
   "DiskSize": "ディスクサイズ",
   "DoubleClick": "ダブルクリック",
   "Down": "下",
+  "Downloading": "ダウンロード中",
   "Dpi": "DPI",
   "DragFileTo": "ファイルをWindowsエクスプローラーまたは他のアプリケーション/ブラウザにドラッグします",
   "DragImage": "画像をドラッグ",
@@ -220,6 +221,7 @@
   "NoImage": "画像が読み込まれていません",
   "NoImages": "画像無し",
   "NoResize": "サイズ変更なし",
+  "NoUpdateFound": "アップデートは見つかりませんでした。",
   "None": "なし",
   "Normal": "通常",
   "NormalWindow": "通常のウィンドウ",

+ 2 - 0
src/PicView.Core/Config/Languages/ko.json

@@ -94,6 +94,7 @@
   "DiskSize": "디스크 크기",
   "DoubleClick": "더블 클릭",
   "Down": "아래로",
+  "Downloading": "다운로드 중",
   "Dpi": "DPI",
   "DragFileTo": "파일을 Windows 탐색기 또는 다른 응용 프로그램/브라우저로 끌어다 놓기",
   "DragImage": "이미지 끌기",
@@ -220,6 +221,7 @@
   "NoImage": "불러온 이미지가 없습니다",
   "NoImages": "이미지 없음",
   "NoResize": "크기 조정 안 함",
+  "NoUpdateFound": "업데이트를 찾을 수 없습니다.",
   "None": "없음",
   "Normal": "일반",
   "NormalWindow": "일반 창",

+ 2 - 0
src/PicView.Core/Config/Languages/nl.json

@@ -94,6 +94,7 @@
   "DiskSize": "Schijfgrootte",
   "DoubleClick": "Dubbelklik",
   "Down": "Omlaag",
+  "Downloading": "Downloaden",
   "Dpi": "DPI",
   "DragFileTo": "Bestand verslepen naar andere applicatie/browser",
   "DragImage": "Afbeelding slepen",
@@ -220,6 +221,7 @@
   "NoImage": "Geen afbeelding",
   "NoImages": "Geen afbeeldingen",
   "NoResize": "Niet aanpassen",
+  "NoUpdateFound": "Geen update gevonden.",
   "None": "Geen",
   "Normal": "Normaal",
   "NormalWindow": "Normaal venster",

+ 2 - 0
src/PicView.Core/Config/Languages/pl.json

@@ -94,6 +94,7 @@
   "DiskSize": "Rozmiar na dysku",
   "DoubleClick": "Podwójne kliknięcie",
   "Down": "Dół",
+  "Downloading": "Pobieranie",
   "Dpi": "DPI",
   "DragFileTo": "Przeciągnij plik do Eksploratora lub innej aplikacji/przeglądarki",
   "DragImage": "Przeciągnij obraz",
@@ -220,6 +221,7 @@
   "NoImage": "Brak obrazu",
   "NoImages": "Brak obrazów",
   "NoResize": "Brak zmiany",
+  "NoUpdateFound": "Brak aktualizacji.",
   "None": "Nic",
   "Normal": "Normalny",
   "NormalWindow": "Normalne okno",

+ 2 - 0
src/PicView.Core/Config/Languages/pt-br.json

@@ -94,6 +94,7 @@
   "DiskSize": "Tamanho do disco",
   "DoubleClick": "Duplo clique",
   "Down": "Para baixo",
+  "Downloading": "Baixando",
   "Dpi": "DPI",
   "DragFileTo": "Arraste o arquivo para o Windows Explorer ou outro aplicativo/navegador",
   "DragImage": "Arraste a imagem",
@@ -220,6 +221,7 @@
   "NoImage": "Nenhuma imagem foi carregada",
   "NoImages": "Sem imagens",
   "NoResize": "Sem redimensionamento",
+  "NoUpdateFound": "Nenhuma atualização encontrada.",
   "None": "Nenhum",
   "Normal": "Normal",
   "NormalWindow": "Janela normal",

+ 2 - 0
src/PicView.Core/Config/Languages/ro.json

@@ -94,6 +94,7 @@
   "DiskSize": "Mărime disc",
   "DoubleClick": "Dublu clic",
   "Down": "Jos",
+  "Downloading": "Se descarcă",
   "Dpi": "DPI",
   "DragFileTo": "Glisează fișierul către Windows Explorer sau altă aplicație/navigator",
   "DragImage": "Glisare imagine",
@@ -220,6 +221,7 @@
   "NoImage": "Nicio imagine încărcată",
   "NoImages": "Fără imagini",
   "NoResize": "Fără redimensionare",
+  "NoUpdateFound": "Nicio actualizare găsită.",
   "None": "Nici unul",
   "Normal": "Normal",
   "NormalWindow": "Fereastră normală",

+ 2 - 0
src/PicView.Core/Config/Languages/ru.json

@@ -94,6 +94,7 @@
   "DiskSize": "Размер диска",
   "DoubleClick": "Двойной клик",
   "Down": "Вниз",
+  "Downloading": "Загрузка",
   "Dpi": "DPI",
   "DragFileTo": "Перетащите файл в проводник Windows или другое приложение/браузер",
   "DragImage": "Перетащите изображение",
@@ -220,6 +221,7 @@
   "NoImage": "Изображение не загружено",
   "NoImages": "Нет изображений",
   "NoResize": "Нет изменений",
+  "NoUpdateFound": "Обновлений не найдено.",
   "None": "Никто",
   "Normal": "Нормальный",
   "NormalWindow": "Обычное окно",

+ 2 - 0
src/PicView.Core/Config/Languages/sv.json

@@ -94,6 +94,7 @@
   "DiskSize": "Skivstorlek",
   "DoubleClick": "Dubbelklick",
   "Down": "Ner",
+  "Downloading": "Laddar ner",
   "Dpi": "DPI",
   "DragFileTo": "Dra filen till Utforskaren eller annat program",
   "DragImage": "Dra bild",
@@ -220,6 +221,7 @@
   "NoImage": "Bild saknas",
   "NoImages": "Inga bilder",
   "NoResize": "Ingen storleksändring",
+  "NoUpdateFound": "Ingen uppdatering hittades.",
   "None": "Ingen",
   "Normal": "Normal",
   "NormalWindow": "Normalt fönster",

+ 2 - 0
src/PicView.Core/Config/Languages/tr.json

@@ -94,6 +94,7 @@
   "DiskSize": "Disk boyutu",
   "DoubleClick": "Çift tıklama",
   "Down": "Aşağı",
+  "Downloading": "İndiriliyor",
   "Dpi": "DPI",
   "DragFileTo": "Dosyayı Windows Gezgini'ne veya başka bir uygulama/tarayıcıya sürükle",
   "DragImage": "Resmi sürükle",
@@ -220,6 +221,7 @@
   "NoImage": "Yüklenen resim yok",
   "NoImages": "Resim yok",
   "NoResize": "Yeniden boyutlandırma yok",
+  "NoUpdateFound": "Güncelleme bulunamadı.",
   "None": "Yok",
   "Normal": "Normal",
   "NormalWindow": "Normal pencere",

+ 2 - 0
src/PicView.Core/Config/Languages/zh-CN.json

@@ -94,6 +94,7 @@
   "DiskSize": "磁盘大小",
   "DoubleClick": "双击",
   "Down": "下",
+  "Downloading": "正在下载",
   "Dpi": "DPI",
   "DragFileTo": "将文件拖拽至 Windows 资源管理器或者其他应用程序/浏览器",
   "DragImage": "拖拽图片",
@@ -220,6 +221,7 @@
   "NoImage": "请打开图片",
   "NoImages": "无图像",
   "NoResize": "禁止缩放",
+  "NoUpdateFound": "未找到更新。",
   "None": "没有任何",
   "Normal": "正常",
   "NormalWindow": "正常窗口",

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

@@ -94,6 +94,7 @@
   "DiskSize": "磁碟大小",
   "DoubleClick": "雙擊",
   "Down": "下",
+  "Downloading": "下載中",
   "Dpi": "DPI",
   "DragFileTo": "將檔案拖曳至 Windows 檔案總管或者其他應用程式/瀏覽器",
   "DragImage": "拖曳圖片",
@@ -220,6 +221,7 @@
   "NoImage": "請開啟圖片",
   "NoImages": "無影像",
   "NoResize": "不調整尺寸",
+  "NoUpdateFound": "未找到更新。",
   "None": "沒有任何",
   "Normal": "正常",
   "NormalWindow": "正常視窗",

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

@@ -47,7 +47,6 @@ public class LanguageModel
     public string? CameraMaker { get; set; }
     public string? CameraModel { get; set; }
     public string? Cancel { get; set; }
-    public string? ShowConfirmationDialogWhenPermanentlyDeletingFile { get; set; }
     public string? Center { get; set; }
     public string? CenterWindow { get; set; }
     public string? Centimeters { get; set; }
@@ -106,6 +105,7 @@ public class LanguageModel
     public string? DiskSize { get; set; }
     public string? DoubleClick { get; set; }
     public string? Down { get; set; }
+    public string? Downloading { get; set; }
     public string? Dpi { get; set; }
     public string? DragFileTo { get; set; }
     public string? DragImage { get; set; }
@@ -236,6 +236,7 @@ public class LanguageModel
     public string? Normal { get; set; }
     public string? NormalWindow { get; set; }
     public string? NotDefined { get; set; }
+    public string? NoUpdateFound { get; set; }
     public string? NumpadMinus { get; set; }
     public string? NumpadPlus { get; set; }
     public string? OldMovie { get; set; }
@@ -321,6 +322,7 @@ public class LanguageModel
     public string? ShowBottomGalleryWhenUiIsHidden { get; set; }
     public string? ShowBottomToolbar { get; set; }
     public string? ShowConfirmationDialogWhenMovingFileToRecycleBin { get; set; }
+    public string? ShowConfirmationDialogWhenPermanentlyDeletingFile { get; set; }
     public string? ShowConfirmationOnEsc { get; set; }
     public string? ShowFadeInButtonsOnHover { get; set; }
     public string? ShowFileSavingDialog { get; set; }

Разница между файлами не показана из-за своего большого размера
+ 260 - 253
src/PicView.Core/ViewModels/TranslationViewModel.cs


Некоторые файлы не были показаны из-за большого количества измененных файлов