[GUI] Modernize XAML localization.

This commit is contained in:
2025-10-25 12:53:52 +01:00
parent 3add9f9264
commit 2cee66a08d
66 changed files with 615 additions and 1181 deletions

View File

@@ -88,18 +88,6 @@ public sealed partial class AboutViewModel : ViewModelBase
});
}
[NotNull]
public string AboutLabel => UI.Label_About;
[NotNull]
public string LibrariesLabel => UI.Label_Libraries;
[NotNull]
public string AuthorsLabel => UI.Label_Authors;
[NotNull]
public string Title => UI.Title_About_Aaru;
[NotNull]
public string SoftwareName => "Aaru";

View File

@@ -42,7 +42,6 @@ using Aaru.Localization;
using Aaru.Logging;
using Avalonia.Platform.Storage;
using CommunityToolkit.Mvvm.Input;
using JetBrains.Annotations;
using MsBox.Avalonia;
using MsBox.Avalonia.Enums;
using Console = Aaru.Gui.Views.Dialogs.Console;
@@ -63,27 +62,10 @@ public sealed class ConsoleViewModel : ViewModelBase
ClearCommand = new RelayCommand(Clear);
}
[NotNull]
public string Title => UI.Title_Console;
public ICommand ClearCommand { get; }
public ICommand SaveCommand { get; }
public ObservableCollection<LogEntry> Entries => ConsoleHandler.Entries;
[NotNull]
public string DebugText => UI.Enable_debug_console;
[NotNull]
public string SaveLabel => UI.ButtonLabel_Save;
[NotNull]
public string ClearLabel => UI.ButtonLabel_Clear;
public string TimeLabel => UI.Title_Time;
public string TypeLabel => UI.Title_Type;
public string ModuleLabel => UI.Title_Module;
public string MessageLabel => UI.Title_Message;
public bool DebugChecked
{
get => _debugChecked;

View File

@@ -37,9 +37,7 @@ using System.Threading.Tasks;
using System.Windows.Input;
using Aaru.Gui.Models;
using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using CommunityToolkit.Mvvm.Input;
using JetBrains.Annotations;
namespace Aaru.Gui.ViewModels.Dialogs;
@@ -74,15 +72,6 @@ public sealed class EncodingsViewModel : ViewModelBase
});
}
[NotNull]
public string Title => UI.Encodings;
[NotNull]
public string CloseLabel => UI.ButtonLabel_Close;
public string CodeLabel => UI.Title_Code_for_encoding;
public string NameLabel => UI.Title_Name;
public ICommand CloseCommand { get; }
public ObservableCollection<EncodingModel> Encodings { get; }

View File

@@ -34,9 +34,7 @@ using System.IO;
using System.Reflection;
using System.Windows.Input;
using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using CommunityToolkit.Mvvm.Input;
using JetBrains.Annotations;
namespace Aaru.Gui.ViewModels.Dialogs;
@@ -60,12 +58,6 @@ public sealed class LicenseViewModel : ViewModelBase
LicenseText = reader.ReadToEnd();
}
[NotNull]
public string Title => UI.Title_Aaru_license;
[NotNull]
public string CloseLabel => UI.ButtonLabel_Close;
public string LicenseText { get; }
public ICommand CloseCommand { get; }

View File

@@ -37,9 +37,7 @@ using Aaru.CommonTypes;
using Aaru.CommonTypes.Interfaces;
using Aaru.Gui.Models;
using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using CommunityToolkit.Mvvm.Input;
using JetBrains.Annotations;
namespace Aaru.Gui.ViewModels.Dialogs;
@@ -166,41 +164,6 @@ public sealed class PluginsViewModel : ViewModelBase
}
}
[NotNull]
public string Title => UI.Title_Plugins;
[NotNull]
public string FiltersLabel => UI.Title_Filters;
[NotNull]
public string PartitionsLabel => UI.Title_Partitions;
[NotNull]
public string FilesystemsLabel => UI.Title_Filesystems;
[NotNull]
public string IdentifyLabel => UI.Title_Identify_only;
[NotNull]
public string ImagesLabel => UI.Title_Media_images;
[NotNull]
public string FloppyImagesLabel => UI.Title_Floppy_images;
[NotNull]
public string ReadableLabel => UI.Title_Readable;
[NotNull]
public string WritableLabel => UI.Title_Writable;
[NotNull]
public string CloseLabel => UI.ButtonLabel_Close;
public string NameLabel => UI.Title_Name;
public string UuidLabel => UI.Title_UUID;
public string VersionLabel => UI.Title_Version;
public string AuthorLabel => UI.Title_Author;
public ICommand CloseCommand { get; }
public ObservableCollection<PluginModel> Filters { get; }
public ObservableCollection<PluginModel> PartitionSchemes { get; }

View File

@@ -32,11 +32,9 @@
using System.Windows.Input;
using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using Aaru.Settings;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using JetBrains.Annotations;
namespace Aaru.Gui.ViewModels.Dialogs;
@@ -105,81 +103,6 @@ public sealed partial class SettingsViewModel : ViewModelBase
}
// TODO: Show Preferences in macOS
[NotNull]
public string Title => UI.Title_Settings;
[NotNull]
public string GdprLabel => UI.Title_GDPR;
[NotNull]
public string ReportsLabel => UI.Title_Reports;
[NotNull]
public string StatisticsLabel => UI.Title_Statistics;
[NotNull]
public string SaveLabel => UI.ButtonLabel_Save;
[NotNull]
public string CancelLabel => UI.ButtonLabel_Cancel;
[NotNull]
public string GdprText1 => UI.GDPR_Compliance;
[NotNull]
public string GdprText2 => UI.GDPR_Open_Source_Disclaimer;
[NotNull]
public string GdprText3 => UI.GDPR_Information_sharing;
[NotNull]
public string ReportsGloballyText => UI.Configure_Device_Report_information_disclaimer;
[NotNull]
public string SaveReportsGloballyText => UI.Save_device_reports_in_shared_folder_of_your_computer_Q;
[NotNull]
public string ReportsText => UI.Configure_share_report_disclaimer;
[NotNull]
public string ShareReportsText => UI.Share_your_device_reports_with_us_Q;
[NotNull]
public string StatisticsText => UI.Statistics_disclaimer;
[NotNull]
public string SaveStatsText => UI.Save_stats_about_your_Aaru_usage_Q;
[NotNull]
public string ShareStatsText => UI.Share_your_stats_anonymously_Q;
[NotNull]
public string CommandStatsText => UI.Gather_statistics_about_command_usage_Q;
[NotNull]
public string DeviceStatsText => UI.Gather_statistics_about_found_devices_Q;
[NotNull]
public string FilesystemStatsText => UI.Gather_statistics_about_found_filesystems_Q;
[NotNull]
public string FilterStatsText => UI.Gather_statistics_about_found_file_filters_Q;
[NotNull]
public string MediaImageStatsText => UI.Gather_statistics_about_found_media_image_formats_Q;
[NotNull]
public string MediaScanStatsText => UI.Gather_statistics_about_scanned_media_Q;
[NotNull]
public string PartitionStatsText => UI.Gather_statistics_about_found_partitioning_schemes_Q;
[NotNull]
public string MediaStatsText => UI.Gather_statistics_about_media_types_Q;
[NotNull]
public string VerifyStatsText => UI.Gather_statistics_about_media_image_verifications_Q;
public ICommand CancelCommand { get; }
public ICommand SaveCommand { get; }

View File

@@ -39,7 +39,6 @@ using Aaru.Gui.Models;
using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using CommunityToolkit.Mvvm.Input;
using JetBrains.Annotations;
using NameCountModel = Aaru.Gui.Models.NameCountModel;
namespace Aaru.Gui.ViewModels.Dialogs;
@@ -712,66 +711,6 @@ public sealed class StatisticsViewModel : ViewModelBase
set => SetProperty(ref _mediasVisible, value);
}
[NotNull]
public string CommandsLabel => UI.Title_Commands;
[NotNull]
public string FilterLabel => UI.Title_Filter;
[NotNull]
public string PartitionLabel => UI.Title_Partition;
[NotNull]
public string PartitionsLabel => UI.Title_Partitions;
[NotNull]
public string FiltersLabel => UI.Title_Filters;
[NotNull]
public string FormatsLabel => UI.Title_Formats;
[NotNull]
public string FormatLabel => UI.Title_Format;
[NotNull]
public string FilesystemsLabel => UI.Title_Filesystems;
[NotNull]
public string FilesystemLabel => UI.Title_Filesystem;
[NotNull]
public string TimesFoundLabel => UI.Title_Times_used;
[NotNull]
public string DevicesLabel => UI.Title_Devices;
[NotNull]
public string DeviceLabel => UI.Title_Device;
[NotNull]
public string ManufacturerLabel => UI.Title_Manufacturer;
[NotNull]
public string RevisionLabel => UI.Title_Revision;
[NotNull]
public string BusLabel => UI.Title_Bus;
[NotNull]
public string MediasLabel => UI.Title_Medias;
[NotNull]
public string MediaLabel => UI.Title_Media;
[NotNull]
public string TypeLabel => Localization.Core.Title_Type_for_media;
[NotNull]
public string Title => UI.Encodings;
[NotNull]
public string CloseLabel => UI.ButtonLabel_Close;
public ICommand CloseCommand { get; }
public ObservableCollection<NameCountModel> Filters { get; }
public ObservableCollection<NameCountModel> Formats { get; }