Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

feat: add translations

itsfatduck141f94fd24b9
diff --git a/optimizerDuck/Resources/Languages/Translations.Designer.cs b/optimizerDuck/Resources/Languages/Translations.Designer.cs
index 87f6ad3..ba59132 100644
--- a/optimizerDuck/Resources/Languages/Translations.Designer.cs
+++ b/optimizerDuck/Resources/Languages/Translations.Designer.cs
@@ -59,6 +59,24 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Removing {0} ({1}/{2}).
+ /// </summary>
+ public static string BloatwareDialog_Removing {
+ get {
+ return ResourceManager.GetString("BloatwareDialog.Removing", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Removing {0} AppX Package(s).
+ /// </summary>
+ public static string BloatwareDialog_Title {
+ get {
+ return ResourceManager.GetString("BloatwareDialog.Title", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
diff --git a/optimizerDuck/Resources/Languages/Translations.resx b/optimizerDuck/Resources/Languages/Translations.resx
index 607b77c..ec8b9ef 100644
--- a/optimizerDuck/Resources/Languages/Translations.resx
+++ b/optimizerDuck/Resources/Languages/Translations.resx
@@ -800,4 +800,10 @@ Current version: {0}]]></value>
<data name="Button.ViewLatestRelease" xml:space="preserve">
<value>View latest release</value>
</data>
+ <data name="BloatwareDialog.Title" xml:space="preserve">
+ <value>Removing {0} AppX Package(s)</value>
+ </data>
+ <data name="BloatwareDialog.Removing" xml:space="preserve">
+ <value>Removing {0} ({1}/{2})</value>
+ </data>
</root>
\ No newline at end of file
diff --git a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs
index 4e18906..ecceb9b 100644
--- a/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Pages/BloatwareViewModel.cs
@@ -5,6 +5,7 @@ using System.ComponentModel;
using System.Linq;
using optimizerDuck.Core.Models.Bloatware;
using optimizerDuck.Core.Models.UI;
+using optimizerDuck.Resources.Languages;
using optimizerDuck.Services;
using optimizerDuck.Services.Managers;
using optimizerDuck.UI.ViewModels;
@@ -29,7 +30,8 @@ public partial class BloatwareViewModel : ViewModel
public bool HasSelectedItems => AppxPackages.Any(x => x.IsSelected);
public int SelectedCount => AppxPackages.Count(x => x.IsSelected);
- public BloatwareViewModel(BloatwareService bloatwareService, IContentDialogService contentDialogService, ISnackbarService snackbarService)
+ public BloatwareViewModel(BloatwareService bloatwareService, IContentDialogService contentDialogService,
+ ISnackbarService snackbarService)
{
_bloatwareService = bloatwareService;
_contentDialogService = contentDialogService;
@@ -67,10 +69,12 @@ public partial class BloatwareViewModel : ViewModel
[RelayCommand(CanExecute = nameof(CanRemoveSelected))]
private async Task RemoveSelected()
{
+ var toRemove = AppxPackages.Where(x => x.IsSelected).ToList();
+
var viewModel = new ProcessingViewModel();
var dialog = new ContentDialog
{
- Title = Loc.Instance["BloatwareDialog.Title"],
+ Title = string.Format(Translations.BloatwareDialog_Title, toRemove.Count),
Content = new ProcessingDialog { DataContext = viewModel },
IsFooterVisible = false
};
@@ -78,19 +82,18 @@ public partial class BloatwareViewModel : ViewModel
try
{
_ = _contentDialogService.ShowAsync(dialog, CancellationToken.None);
-
- var toRemove = AppxPackages.Where(x => x.IsSelected).ToList();
+
for (var i = 0; i < toRemove.Count; i++)
{
var item = toRemove[i];
-
+
viewModel.ProgressReporter.Report(new ProcessingProgress
{
- Message = string.Format(Loc.Instance["BloatwareDialog.Removing"], i + 1, toRemove.Count),
+ Message = string.Format(Translations.BloatwareDialog_Removing, item.Name, i + 1, toRemove.Count),
IsIndeterminate = false,
Total = toRemove.Count,
- Value = i
+ Value = i
});
await _bloatwareService.RemoveAppXPackage(item);
}
@@ -115,7 +118,6 @@ public partial class BloatwareViewModel : ViewModel
AppxPackages.Add(package);
}
-
#endregion
#region Property Changed