From cf2b78358aa28a2e74269ecb068f832f77760db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20La=C5=A1t=C5=AFvka?= Date: Fri, 31 May 2024 10:59:25 +0200 Subject: [PATCH 1/4] Fix: ConflictingItemsDialogSubtitleConflictsNonConflicts --- src/Files.App/Strings/en-US/Resources.resw | 2 +- .../FileSystemDialog/FileSystemDialogViewModel.cs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 15749f17e487..54aa2cd93b79 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -1239,7 +1239,7 @@ {0, plural, one {There is one conflicting file name} other {There are # conflicting file names}} - {0, plural, one {, and one outgoing item} other {, and # outgoing items}} + {0, plural, one {There is one conflicting file name} other {There are # conflicting file names}}, and {1, plural, one {one outgoing item} other {# outgoing items}} Conflicting {0, plural, one {file name} other {file names}} diff --git a/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs b/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs index 5c33e7f8c6a5..c211b0a93b50 100644 --- a/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs +++ b/src/Files.App/ViewModels/Dialogs/FileSystemDialog/FileSystemDialogViewModel.cs @@ -151,14 +151,10 @@ public static FileSystemDialogViewModel GetDialogViewModel(FileSystemDialogMode { titleText = "ConflictingItemsDialogTitle".GetLocalizedFormatResource(totalCount); - var descriptionLocalized = new StringBuilder(); - descriptionLocalized.Append("ConflictingItemsDialogSubtitleConflicts".GetLocalizedFormatResource(conflictingItems.Count)); + descriptionText = nonConflictingItems.Count > 0 + ? "ConflictingItemsDialogSubtitleConflictsNonConflicts".GetLocalizedFormatResource(conflictingItems.Count, nonConflictingItems.Count) + : "ConflictingItemsDialogSubtitleConflicts".GetLocalizedFormatResource(conflictingItems.Count); - if (nonConflictingItems.Count > 0) - descriptionLocalized.Append("ConflictingItemsDialogSubtitleConflictsNonConflicts".GetLocalizedFormatResource(nonConflictingItems.Count)); - - descriptionLocalized.Append('.'); - descriptionText = descriptionLocalized.ToString(); primaryButtonText = "ConflictingItemsDialogPrimaryButtonText".ToLocalized(); secondaryButtonText = "Cancel".ToLocalized(); } From c0eec691d0d13e6487b6a8ed917a5ccfc1d6f604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20La=C5=A1t=C5=AFvka?= Date: Fri, 31 May 2024 11:08:45 +0200 Subject: [PATCH 2/4] Fix: PropertiesFilesAndFoldersAndLocationsCountString --- src/Files.App/Strings/en-US/Resources.resw | 4 ++-- .../ViewModels/Properties/Items/BaseProperties.cs | 14 ++++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 54aa2cd93b79..2357471b07dc 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -455,8 +455,8 @@ {0, number} {0, plural, one {file} other {files}}, {1, number} {1, plural, one {folder} other {folders}} - - from {0, number} {0, plural, one {location} other {locations}} + + {0, number} {0, plural, one {file} other {files}}, {1, number} {1, plural, one {folder} other {folders}} from {2, number} {2, plural, one {location} other {locations}} Run as another user diff --git a/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs b/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs index 9c385812df57..c49a766cf96b 100644 --- a/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs @@ -3,6 +3,7 @@ using Microsoft.UI.Dispatching; using System.IO; +using System.Resources; using System.Text; using Windows.Storage.FileProperties; using static Files.App.Helpers.Win32Helper; @@ -122,16 +123,9 @@ await Dispatcher.EnqueueOrInvokeAsync(() => public void SetItemsCountString() { - var resourceText = new StringBuilder(); - resourceText.Append("PropertiesFilesAndFoldersCountString".GetLocalizedFormatResource(ViewModel.FilesCount, ViewModel.FoldersCount)); - - if (ViewModel.LocationsCount > 0) - { - resourceText.Append(' '); - resourceText.Append("PropertiesLocationsCountString".GetLocalizedFormatResource(ViewModel.LocationsCount)); - } - - ViewModel.FilesAndFoldersCountString = resourceText.ToString(); + ViewModel.FilesAndFoldersCountString = ViewModel.LocationsCount > 0 + ? "PropertiesFilesAndFoldersAndLocationsCountString".GetLocalizedFormatResource(ViewModel.FilesCount, ViewModel.FoldersCount, ViewModel.LocationsCount) + : "PropertiesFilesAndFoldersCountString".GetLocalizedFormatResource(ViewModel.FilesCount, ViewModel.FoldersCount); } } } From e857940c1642513b31d00f13496823d7a1f2e94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20La=C5=A1t=C5=AFvka?= <84145589+XTorLukas@users.noreply.github.com> Date: Fri, 31 May 2024 17:42:32 +0200 Subject: [PATCH 3/4] Update BaseProperties.cs --- src/Files.App/ViewModels/Properties/Items/BaseProperties.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs b/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs index c49a766cf96b..6021a5d93457 100644 --- a/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs @@ -3,8 +3,6 @@ using Microsoft.UI.Dispatching; using System.IO; -using System.Resources; -using System.Text; using Windows.Storage.FileProperties; using static Files.App.Helpers.Win32Helper; using FileAttributes = System.IO.FileAttributes; From 780af0e20b1d9db6518f99b456a47f4de97f4ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20La=C5=A1t=C5=AFvka?= Date: Fri, 31 May 2024 23:22:26 +0200 Subject: [PATCH 4/4] Fix: Remove `String` --- src/Files.App/Strings/en-US/Resources.resw | 2 +- src/Files.App/ViewModels/Properties/Items/BaseProperties.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 2357471b07dc..4c9ebf1059ba 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -455,7 +455,7 @@ {0, number} {0, plural, one {file} other {files}}, {1, number} {1, plural, one {folder} other {folders}} - + {0, number} {0, plural, one {file} other {files}}, {1, number} {1, plural, one {folder} other {folders}} from {2, number} {2, plural, one {location} other {locations}} diff --git a/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs b/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs index 6021a5d93457..3af11e5162eb 100644 --- a/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs +++ b/src/Files.App/ViewModels/Properties/Items/BaseProperties.cs @@ -122,7 +122,7 @@ await Dispatcher.EnqueueOrInvokeAsync(() => public void SetItemsCountString() { ViewModel.FilesAndFoldersCountString = ViewModel.LocationsCount > 0 - ? "PropertiesFilesAndFoldersAndLocationsCountString".GetLocalizedFormatResource(ViewModel.FilesCount, ViewModel.FoldersCount, ViewModel.LocationsCount) + ? "PropertiesFilesAndFoldersAndLocationsCount".GetLocalizedFormatResource(ViewModel.FilesCount, ViewModel.FoldersCount, ViewModel.LocationsCount) : "PropertiesFilesAndFoldersCountString".GetLocalizedFormatResource(ViewModel.FilesCount, ViewModel.FoldersCount); } }