Add PowerKit and replace custom utility extensions (#1525)

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot
2026-04-19 23:10:45 +03:00
committed by GitHub
parent 757daa7a60
commit 7456f0fe3a
75 changed files with 133 additions and 603 deletions

View File

@@ -3,20 +3,19 @@ using System.Globalization;
using System.Runtime.CompilerServices;
using CommunityToolkit.Mvvm.ComponentModel;
using DiscordChatExporter.Gui.Services;
using DiscordChatExporter.Gui.Utils;
using DiscordChatExporter.Gui.Utils.Extensions;
using PowerKit;
using PowerKit.Extensions;
namespace DiscordChatExporter.Gui.Localization;
public partial class LocalizationManager : ObservableObject, IDisposable
{
private readonly DisposableCollector _eventRoot = new();
private readonly IDisposable _eventSubscription;
public LocalizationManager(SettingsService settingsService)
{
_eventRoot.Add(settingsService.WatchProperty(o => o.Language, v => Language = v, true));
_eventRoot.Add(
_eventSubscription = Disposable.Merge(
settingsService.WatchProperty(o => o.Language, v => Language = v, true),
this.WatchProperty(
o => o.Language,
_ =>
@@ -66,7 +65,7 @@ public partial class LocalizationManager : ObservableObject, IDisposable
return $"Missing localization for '{key}'";
}
public void Dispose() => _eventRoot.Dispose();
public void Dispose() => _eventSubscription.Dispose();
}
public partial class LocalizationManager