Move all localizable strings from Aaru.Gui project to resources.

This commit is contained in:
2022-11-19 21:10:41 +00:00
parent 887e58c6e5
commit 81195f8630
42 changed files with 1128 additions and 1059 deletions

View File

@@ -48,6 +48,7 @@
<ProjectReference Include="..\Aaru.Core\Aaru.Core.csproj"/> <ProjectReference Include="..\Aaru.Core\Aaru.Core.csproj"/>
<ProjectReference Include="..\Aaru.Devices\Aaru.Devices.csproj"/> <ProjectReference Include="..\Aaru.Devices\Aaru.Devices.csproj"/>
<ProjectReference Include="..\Aaru.Checksums\Aaru.Checksums.csproj"/> <ProjectReference Include="..\Aaru.Checksums\Aaru.Checksums.csproj"/>
<ProjectReference Include="..\Aaru.Localization\Aaru.Localization.csproj"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Assets\Logos\Media\AIT1.png"/> <EmbeddedResource Include="Assets\Logos\Media\AIT1.png"/>

View File

@@ -34,6 +34,7 @@
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using Aaru.Console; using Aaru.Console;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
namespace Aaru.Gui; namespace Aaru.Gui;
@@ -96,7 +97,7 @@ static class ConsoleHandler
Message = string.Format(format, arg), Message = string.Format(format, arg),
Module = null, Module = null,
Timestamp = DateTime.Now, Timestamp = DateTime.Now,
Type = "Info" Type = UI.LogEntry_Type_Info
}); });
} }

View File

@@ -33,6 +33,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using Aaru.Localization;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.LogicalTree; using Avalonia.LogicalTree;
@@ -247,7 +248,7 @@ public sealed class BlockMap : ItemsControl
case NotifyCollectionChangedAction.Replace: case NotifyCollectionChangedAction.Replace:
{ {
if(e.NewItems is not {} items) if(e.NewItems is not {} items)
throw new ArgumentException("Invalid list of items"); throw new ArgumentException(UI.Invalid_list_of_items);
using IDrawingContextImpl ctxi = _bitmap.CreateDrawingContext(null); using IDrawingContextImpl ctxi = _bitmap.CreateDrawingContext(null);
using var ctx = new DrawingContext(ctxi, false); using var ctx = new DrawingContext(ctxi, false);
@@ -255,7 +256,7 @@ public sealed class BlockMap : ItemsControl
foreach(object item in items) foreach(object item in items)
{ {
if(item is not ValueTuple<ulong, double> block) if(item is not ValueTuple<ulong, double> block)
throw new ArgumentException("Invalid item in list", nameof(Items)); throw new ArgumentException(UI.Invalid_item_in_list, nameof(Items));
DrawCluster(block.Item1, block.Item2, false, ctx); DrawCluster(block.Item1, block.Item2, false, ctx);
} }
@@ -269,7 +270,7 @@ public sealed class BlockMap : ItemsControl
{ {
if(e.NewItems is not {} newItems || if(e.NewItems is not {} newItems ||
e.OldItems is not {} oldItems) e.OldItems is not {} oldItems)
throw new ArgumentException("Invalid list of items"); throw new ArgumentException(UI.Invalid_list_of_items);
using IDrawingContextImpl ctxi = _bitmap.CreateDrawingContext(null); using IDrawingContextImpl ctxi = _bitmap.CreateDrawingContext(null);
using var ctx = new DrawingContext(ctxi, false); using var ctx = new DrawingContext(ctxi, false);
@@ -277,7 +278,7 @@ public sealed class BlockMap : ItemsControl
foreach(object item in oldItems) foreach(object item in oldItems)
{ {
if(item is not ValueTuple<ulong, double> block) if(item is not ValueTuple<ulong, double> block)
throw new ArgumentException("Invalid item in list", nameof(Items)); throw new ArgumentException(UI.Invalid_item_in_list, nameof(Items));
DrawCluster(block.Item1, block.Item2, false, ctx); DrawCluster(block.Item1, block.Item2, false, ctx);
} }
@@ -285,7 +286,7 @@ public sealed class BlockMap : ItemsControl
foreach(object item in newItems) foreach(object item in newItems)
{ {
if(item is not ValueTuple<ulong, double> block) if(item is not ValueTuple<ulong, double> block)
throw new ArgumentException("Invalid item in list", nameof(Items)); throw new ArgumentException(UI.Invalid_item_in_list, nameof(Items));
DrawCluster(block.Item1, block.Item2, false, ctx); DrawCluster(block.Item1, block.Item2, false, ctx);
} }
@@ -315,7 +316,7 @@ public sealed class BlockMap : ItemsControl
foreach(object item in Items) foreach(object item in Items)
{ {
if(item is not ValueTuple<ulong, double> block) if(item is not ValueTuple<ulong, double> block)
throw new ArgumentException("Invalid item in list", nameof(Items)); throw new ArgumentException(UI.Invalid_item_in_list, nameof(Items));
DrawCluster(block.Item1, block.Item2, false, ctx); DrawCluster(block.Item1, block.Item2, false, ctx);
} }
@@ -327,7 +328,7 @@ public sealed class BlockMap : ItemsControl
{ {
if(double.IsNegative(duration) || if(double.IsNegative(duration) ||
double.IsInfinity(duration)) double.IsInfinity(duration))
throw new ArgumentException("Duration cannot be negative or infinite", nameof(duration)); throw new ArgumentException(UI.Duration_cannot_be_negative_or_infinite, nameof(duration));
bool newContext = ctx is null; bool newContext = ctx is null;
ulong clustersPerRow = (ulong)Width / BLOCK_SIZE; ulong clustersPerRow = (ulong)Width / BLOCK_SIZE;
@@ -385,8 +386,7 @@ public sealed class BlockMap : ItemsControl
{ {
if(e.NewValue != null && if(e.NewValue != null &&
e.NewValue is not IList<(ulong, double)>) e.NewValue is not IList<(ulong, double)>)
throw new throw new ArgumentException(UI.Items_must_be_a_IList_ulong_double);
ArgumentException("Items must be a IList<(ulong, double)> with ulong being the block and double being the time spent reading it, or NaN for an error.");
base.ItemsChanged(e); base.ItemsChanged(e);

View File

@@ -40,6 +40,7 @@ using System.Runtime.InteropServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Gui.Views.Dialogs; using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -88,13 +89,13 @@ public sealed class AboutViewModel : ViewModelBase
} }
[NotNull] [NotNull]
public string AboutLabel => "About"; public string AboutLabel => UI.Label_About;
[NotNull] [NotNull]
public string LibrariesLabel => "Libraries"; public string LibrariesLabel => UI.Label_Libraries;
[NotNull] [NotNull]
public string AuthorsLabel => "Authors"; public string AuthorsLabel => UI.Label_Authors;
[NotNull] [NotNull]
public string Title => "About Aaru"; public string Title => UI.Title_About_Aaru;
[NotNull] [NotNull]
public string SoftwareName => "Aaru"; public string SoftwareName => "Aaru";
[NotNull] [NotNull]
@@ -104,27 +105,15 @@ public sealed class AboutViewModel : ViewModelBase
[NotNull] [NotNull]
public string Website => "https://aaru.app"; public string Website => "https://aaru.app";
[NotNull] [NotNull]
public string License => "License: GNU General Public License Version 3"; public string License => UI.Label_License;
[NotNull] [NotNull]
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
[NotNull] [NotNull]
public string AssembliesLibraryText => "Library"; public string AssembliesLibraryText => UI.Title_Library;
[NotNull] [NotNull]
public string AssembliesVersionText => "Version"; public string AssembliesVersionText => UI.Title_Version;
[NotNull] [NotNull]
public string Authors => @"Developers: public string Authors => UI.Text_Authors;
Natalia Portillo
Michael Drüing
Rebecca Wallander
Testers:
Silas Laspada
Public relations:
Noah Bacon
Logo and art:
Juan Carlos Pastor Segura (Denymetanol)";
public ReactiveCommand<Unit, Unit> WebsiteCommand { get; } public ReactiveCommand<Unit, Unit> WebsiteCommand { get; }
public ReactiveCommand<Unit, Unit> LicenseCommand { get; } public ReactiveCommand<Unit, Unit> LicenseCommand { get; }
public ReactiveCommand<Unit, Unit> CloseCommand { get; } public ReactiveCommand<Unit, Unit> CloseCommand { get; }

View File

@@ -39,6 +39,7 @@ using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using Aaru.CommonTypes.Interop; using Aaru.CommonTypes.Interop;
using Aaru.Console; using Aaru.Console;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using JetBrains.Annotations; using JetBrains.Annotations;
using MessageBox.Avalonia; using MessageBox.Avalonia;
@@ -62,21 +63,21 @@ public sealed class ConsoleViewModel : ViewModelBase
} }
[NotNull] [NotNull]
public string Title => "Console"; public string Title => UI.Title_Console;
public ReactiveCommand<Unit, Unit> ClearCommand { get; } public ReactiveCommand<Unit, Unit> ClearCommand { get; }
public ReactiveCommand<Unit, Task> SaveCommand { get; } public ReactiveCommand<Unit, Task> SaveCommand { get; }
public ObservableCollection<LogEntry> Entries => ConsoleHandler.Entries; public ObservableCollection<LogEntry> Entries => ConsoleHandler.Entries;
[NotNull] [NotNull]
public string DebugText => "Enable debug console"; public string DebugText => UI.Enable_debug_console;
[NotNull] [NotNull]
public string SaveLabel => "Save"; public string SaveLabel => UI.ButtonLabel_Save;
[NotNull] [NotNull]
public string ClearLabel => "Clear"; public string ClearLabel => UI.ButtonLabel_Clear;
public string TimeLabel => "Time"; public string TimeLabel => UI.Title_Time;
public string TypeLabel => "Type"; public string TypeLabel => UI.Title_Type;
public string ModuleLabel => "Module"; public string ModuleLabel => UI.Title_Module;
public string MessageLabel => "Message"; public string MessageLabel => UI.Title_Message;
public bool DebugChecked public bool DebugChecked
{ {
@@ -98,7 +99,7 @@ public sealed class ConsoleViewModel : ViewModelBase
{ {
"log" "log"
}), }),
Name = "Log files" Name = UI.Dialog_Log_files
}); });
string result = await dlgSave.ShowAsync(_view); string result = await dlgSave.ShowAsync(_view);
@@ -111,7 +112,7 @@ public sealed class ConsoleViewModel : ViewModelBase
var logFs = new FileStream(result, FileMode.Create, FileAccess.ReadWrite); var logFs = new FileStream(result, FileMode.Create, FileAccess.ReadWrite);
var logSw = new StreamWriter(logFs); var logSw = new StreamWriter(logFs);
logSw.WriteLine("Log saved at {0}", DateTime.Now); logSw.WriteLine(UI.Log_saved_at_0, DateTime.Now);
PlatformID platId = DetectOS.GetRealPlatformID(); PlatformID platId = DetectOS.GetRealPlatformID();
string platVer = DetectOS.GetVersion(); string platVer = DetectOS.GetVersion();
@@ -121,7 +122,7 @@ public sealed class ConsoleViewModel : ViewModelBase
typeof(AssemblyInformationalVersionAttribute)) as typeof(AssemblyInformationalVersionAttribute)) as
AssemblyInformationalVersionAttribute; AssemblyInformationalVersionAttribute;
logSw.WriteLine("################# System information #################"); logSw.WriteLine(UI.System_information);
logSw.WriteLine("{0} {1} ({2}-bit)", DetectOS.GetPlatformName(platId, platVer), platVer, logSw.WriteLine("{0} {1} ({2}-bit)", DetectOS.GetPlatformName(platId, platVer), platVer,
Environment.Is64BitOperatingSystem ? 64 : 32); Environment.Is64BitOperatingSystem ? 64 : 32);
@@ -130,19 +131,19 @@ public sealed class ConsoleViewModel : ViewModelBase
logSw.WriteLine(); logSw.WriteLine();
logSw.WriteLine("################# Program information ################"); logSw.WriteLine(UI.Program_information);
logSw.WriteLine("Aaru {0}", assemblyVersion?.InformationalVersion); logSw.WriteLine("Aaru {0}", assemblyVersion?.InformationalVersion);
logSw.WriteLine("Running in {0}-bit", Environment.Is64BitProcess ? 64 : 32); logSw.WriteLine(UI.Running_in_0_bit, Environment.Is64BitProcess ? 64 : 32);
#if DEBUG #if DEBUG
logSw.WriteLine("DEBUG version"); logSw.WriteLine(UI.DEBUG_version);
#endif #endif
logSw.WriteLine("Command line: {0}", Environment.CommandLine); logSw.WriteLine(UI.Command_line_0, Environment.CommandLine);
logSw.WriteLine(); logSw.WriteLine();
logSw.WriteLine("################# Console ################"); logSw.WriteLine(UI.Console_with_ornament);
foreach(LogEntry entry in ConsoleHandler.Entries) foreach(LogEntry entry in ConsoleHandler.Entries)
if(entry.Type != "Info") if(entry.Type != UI.LogEntry_Type_Info)
logSw.WriteLine("{0}: ({1}) {2}", entry.Timestamp, entry.Type.ToLower(), entry.Message); logSw.WriteLine("{0}: ({1}) {2}", entry.Timestamp, entry.Type.ToLower(), entry.Message);
else else
logSw.WriteLine("{0}: {1}", entry.Timestamp, entry.Message); logSw.WriteLine("{0}: {1}", entry.Timestamp, entry.Message);
@@ -153,10 +154,11 @@ public sealed class ConsoleViewModel : ViewModelBase
catch(Exception exception) catch(Exception exception)
{ {
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Exception {exception.Message string.
} trying to save logfile, details has been sent to console.", Format(UI.Exception_0_trying_to_save_logfile_details_has_been_sent_to_console,
ButtonEnum.Ok, Icon.Error).ShowDialog(_view); exception.Message), ButtonEnum.Ok, Icon.Error).
ShowDialog(_view);
AaruConsole.ErrorWriteLine("Console", exception.Message); AaruConsole.ErrorWriteLine("Console", exception.Message);
AaruConsole.ErrorWriteLine("Console", exception.StackTrace); AaruConsole.ErrorWriteLine("Console", exception.StackTrace);

View File

@@ -38,6 +38,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Gui.Views.Dialogs; using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -73,12 +74,12 @@ public sealed class EncodingsViewModel : ViewModelBase
} }
[NotNull] [NotNull]
public string Title => "Encodings"; public string Title => UI.Encodings;
[NotNull] [NotNull]
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string CodeLabel => "Code"; public string CodeLabel => UI.Title_Code_for_encoding;
public string NameLabel => "Name"; public string NameLabel => UI.Title_Name;
public ReactiveCommand<Unit, Unit> CloseCommand { get; } public ReactiveCommand<Unit, Unit> CloseCommand { get; }
public ObservableCollection<EncodingModel> Encodings { get; } public ObservableCollection<EncodingModel> Encodings { get; }

View File

@@ -34,6 +34,7 @@ using System.IO;
using System.Reactive; using System.Reactive;
using System.Reflection; using System.Reflection;
using Aaru.Gui.Views.Dialogs; using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -49,6 +50,7 @@ public sealed class LicenseViewModel : ViewModelBase
_view = view; _view = view;
CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand); CloseCommand = ReactiveCommand.Create(ExecuteCloseCommand);
// TODO: Localize
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Aaru.Gui.LICENSE"); using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Aaru.Gui.LICENSE");
if(stream == null) if(stream == null)
@@ -60,9 +62,9 @@ public sealed class LicenseViewModel : ViewModelBase
} }
[NotNull] [NotNull]
public string Title => "Aaru's license"; public string Title => UI.Title_Aaru_license;
[NotNull] [NotNull]
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string LicenseText { get; } public string LicenseText { get; }
public ReactiveCommand<Unit, Unit> CloseCommand { get; } public ReactiveCommand<Unit, Unit> CloseCommand { get; }

View File

@@ -37,6 +37,7 @@ using Aaru.CommonTypes.Interfaces;
using Aaru.Core; using Aaru.Core;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Gui.Views.Dialogs; using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -139,29 +140,29 @@ public sealed class PluginsViewModel : ViewModelBase
} }
[NotNull] [NotNull]
public string Title => "Plugins"; public string Title => UI.Title_Plugins;
[NotNull] [NotNull]
public string FiltersLabel => "Filters"; public string FiltersLabel => UI.Title_Filters;
[NotNull] [NotNull]
public string PartitionsLabel => "Partitions"; public string PartitionsLabel => UI.Title_Partitions;
[NotNull] [NotNull]
public string FilesystemsLabel => "Filesystems"; public string FilesystemsLabel => UI.Title_Filesystems;
[NotNull] [NotNull]
public string IdentifyLabel => "Identify only:"; public string IdentifyLabel => UI.Title_Identify_only;
[NotNull] [NotNull]
public string ImagesLabel => "Media images"; public string ImagesLabel => UI.Title_Media_images;
[NotNull] [NotNull]
public string FloppyImagesLabel => "Floppy images"; public string FloppyImagesLabel => UI.Title_Floppy_images;
[NotNull] [NotNull]
public string ReadableLabel => "Readable:"; public string ReadableLabel => UI.Title_Readable;
[NotNull] [NotNull]
public string WritableLabel => "Writable:"; public string WritableLabel => UI.Title_Writable;
[NotNull] [NotNull]
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string NameLabel => "Name"; public string NameLabel => UI.Title_Name;
public string UUIDLabel => "UUID"; public string UUIDLabel => UI.Title_UUID;
public string VersionLabel => "Version"; public string VersionLabel => UI.Title_Version;
public string AuthorLabel => "Author"; public string AuthorLabel => UI.Title_Author;
public ReactiveCommand<Unit, Unit> CloseCommand { get; } public ReactiveCommand<Unit, Unit> CloseCommand { get; }
public ObservableCollection<PluginModel> Filters { get; } public ObservableCollection<PluginModel> Filters { get; }

View File

@@ -32,6 +32,7 @@
using System.Reactive; using System.Reactive;
using Aaru.Gui.Views.Dialogs; using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using Aaru.Settings; using Aaru.Settings;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -90,85 +91,61 @@ public sealed class SettingsViewModel : ViewModelBase
// TODO: Show Preferences in macOS // TODO: Show Preferences in macOS
[NotNull] [NotNull]
public string Title => "Settings"; public string Title => UI.Title_Settings;
[NotNull] [NotNull]
public string GdprLabel => "GDPR"; public string GdprLabel => UI.Title_GDPR;
[NotNull] [NotNull]
public string ReportsLabel => "Reports"; public string ReportsLabel => UI.Title_Reports;
[NotNull] [NotNull]
public string StatisticsLabel => "Statistics"; public string StatisticsLabel => UI.Title_Statistics;
[NotNull] [NotNull]
public string SaveLabel => "Save"; public string SaveLabel => UI.ButtonLabel_Save;
[NotNull] [NotNull]
public string CancelLabel => "Cancel"; public string CancelLabel => UI.ButtonLabel_Cancel;
[NotNull] [NotNull]
public string GdprText1 => public string GdprText1 => UI.GDPR_Compliance;
@"In compliance with the European Union General Data Protection Regulation 2016/679 (GDPR),
we must give you the following information about Aaru and ask if you want to opt-in
in some information sharing.";
[NotNull] [NotNull]
public string GdprText2 => @"Disclaimer: Because Aaru is an open source software this information, and therefore, public string GdprText2 => UI.GDPR_Open_Source_Disclaimer;
compliance with GDPR only holds true if you obtained a certificated copy from its original
authors. In case of doubt, close Aaru now and ask in our IRC support channel.";
[NotNull] [NotNull]
public string GdprText3 => public string GdprText3 => UI.GDPR_Information_sharing;
@"For any information sharing your IP address may be stored in our server, in a way that is not
possible for any person, manual, or automated process, to link with your identity, unless
specified otherwise.";
[NotNull] [NotNull]
public string ReportsGloballyText => public string ReportsGloballyText => UI.Configure_Device_Report_information_disclaimer;
@"With the 'device-report' command, Aaru creates a report of a device, that includes its
manufacturer, model, firmware revision and/or version, attached bus, size, and supported commands.
The serial number of the device is not stored in the report. If used with the debug parameter,
extra information about the device will be stored in the report. This information is known to contain
the device serial number in non-standard places that prevent the automatic removal of it on a handful
of devices. A human-readable copy of the report in XML format is always created in the same directory
where Aaru is being run from.";
[NotNull] [NotNull]
public string SaveReportsGloballyText => "Save device reports in shared folder of your computer?"; public string SaveReportsGloballyText => UI.Save_device_reports_in_shared_folder_of_your_computer_Q;
[NotNull] [NotNull]
public string ReportsText => public string ReportsText => UI.Configure_share_report_disclaimer;
@"Sharing a report with us will send it to our server, that's in the european union territory, where it
will be manually analyzed by an european union citizen to remove any trace of personal identification
from it. Once that is done, it will be shared in our stats website, https://www.aaru.app
These report will be used to improve Aaru support, and in some cases, to provide emulation of the
devices to other open-source projects. In any case, no information linking the report to you will be stored.";
[NotNull] [NotNull]
public string ShareReportsText => "Share your device reports with us?"; public string ShareReportsText => UI.Share_your_device_reports_with_us_Q;
[NotNull] [NotNull]
public string StatisticsText => public string StatisticsText => UI.Statistics_disclaimer;
@"Aaru can store some usage statistics. These statistics are limited to the number of times a
command is executed, a filesystem, partition, or device is used, the operating system version, and other.
In no case, any information besides pure statistical usage numbers is stored, and they're just joint to the
pool with no way of using them to identify you.";
[NotNull] [NotNull]
public string SaveStatsText => "Save stats about your Aaru usage?"; public string SaveStatsText => UI.Save_stats_about_your_Aaru_usage_Q;
[NotNull] [NotNull]
public string ShareStatsText => "Share your stats (anonymously)?"; public string ShareStatsText => UI.Share_your_stats_anonymously_Q;
[NotNull] [NotNull]
public string CommandStatsText => "Gather statistics about command usage?"; public string CommandStatsText => UI.Gather_statistics_about_command_usage_Q;
[NotNull] [NotNull]
public string DeviceStatsText => "Gather statistics about found devices?"; public string DeviceStatsText => UI.Gather_statistics_about_found_devices_Q;
[NotNull] [NotNull]
public string FilesystemStatsText => "Gather statistics about found filesystems?"; public string FilesystemStatsText => UI.Gather_statistics_about_found_filesystems_Q;
[NotNull] [NotNull]
public string FilterStatsText => "Gather statistics about found file filters?"; public string FilterStatsText => UI.Gather_statistics_about_found_file_filters_Q;
[NotNull] [NotNull]
public string MediaImageStatsText => "Gather statistics about found media image formats?"; public string MediaImageStatsText => UI.Gather_statistics_about_found_media_image_formats_Q;
[NotNull] [NotNull]
public string MediaScanStatsText => "Gather statistics about scanned media?"; public string MediaScanStatsText => UI.Gather_statistics_about_scanned_media_Q;
[NotNull] [NotNull]
public string PartitionStatsText => "Gather statistics about found partitioning schemes?"; public string PartitionStatsText => UI.Gather_statistics_about_found_partitioning_schemes_Q;
[NotNull] [NotNull]
public string MediaStatsText => "Gather statistics about media types?"; public string MediaStatsText => UI.Gather_statistics_about_media_types_Q;
[NotNull] [NotNull]
public string VerifyStatsText => "Gather statistics about media image verifications?"; public string VerifyStatsText => UI.Gather_statistics_about_media_image_verifications_Q;
public ReactiveCommand<Unit, Unit> CancelCommand { get; } public ReactiveCommand<Unit, Unit> CancelCommand { get; }
public ReactiveCommand<Unit, Unit> SaveCommand { get; } public ReactiveCommand<Unit, Unit> SaveCommand { get; }

View File

@@ -37,6 +37,7 @@ using Aaru.Database;
using Aaru.Database.Models; using Aaru.Database.Models;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Gui.Views.Dialogs; using Aaru.Gui.Views.Dialogs;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
using NameCountModel = Aaru.Gui.Models.NameCountModel; using NameCountModel = Aaru.Gui.Models.NameCountModel;
@@ -135,7 +136,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "fs-info" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "fs-info" && !c.Synchronized);
FsInfoVisible = true; FsInfoVisible = true;
FsInfoText = $"You have called the Filesystem Info command {count} times"; FsInfoText = string.Format(UI.You_have_called_the_Filesystem_Info_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "checksum")) if(ctx.Commands.Any(c => c.Name == "checksum"))
@@ -146,7 +147,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "checksum" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "checksum" && !c.Synchronized);
ChecksumVisible = true; ChecksumVisible = true;
ChecksumText = $"You have called the Checksum command {count} times"; ChecksumText = string.Format(UI.You_have_called_the_Checksum_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "compare")) if(ctx.Commands.Any(c => c.Name == "compare"))
@@ -157,7 +158,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "compare" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "compare" && !c.Synchronized);
CompareVisible = true; CompareVisible = true;
CompareText = $"You have called the Compare command {count} times"; CompareText = string.Format(UI.You_have_called_the_Compare_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "convert-image")) if(ctx.Commands.Any(c => c.Name == "convert-image"))
@@ -168,7 +169,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "convert-image" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "convert-image" && !c.Synchronized);
ConvertImageVisible = true; ConvertImageVisible = true;
ConvertImageText = $"You have called the Convert-Image command {count} times"; ConvertImageText = string.Format(UI.You_have_called_the_Convert_Image_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "create-sidecar")) if(ctx.Commands.Any(c => c.Name == "create-sidecar"))
@@ -179,7 +180,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "create-sidecar" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "create-sidecar" && !c.Synchronized);
CreateSidecarVisible = true; CreateSidecarVisible = true;
CreateSidecarText = $"You have called the Create-Sidecar command {count} times"; CreateSidecarText = string.Format(UI.You_have_called_the_Create_Sidecar_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "decode")) if(ctx.Commands.Any(c => c.Name == "decode"))
@@ -190,7 +191,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "decode" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "decode" && !c.Synchronized);
DecodeVisible = true; DecodeVisible = true;
DecodeText = $"You have called the Decode command {count} times"; DecodeText = string.Format(UI.You_have_called_the_Decode_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "device-info")) if(ctx.Commands.Any(c => c.Name == "device-info"))
@@ -201,7 +202,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "device-info" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "device-info" && !c.Synchronized);
DeviceInfoVisible = true; DeviceInfoVisible = true;
DeviceInfoText = $"You have called the Device-Info command {count} times"; DeviceInfoText = string.Format(UI.You_have_called_the_Device_Info_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "device-report")) if(ctx.Commands.Any(c => c.Name == "device-report"))
@@ -212,7 +213,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "device-report" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "device-report" && !c.Synchronized);
DeviceReportVisible = true; DeviceReportVisible = true;
DeviceReportText = $"You have called the Device-Report command {count} times"; DeviceReportText = string.Format(UI.You_have_called_the_Device_Report_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "dump-media")) if(ctx.Commands.Any(c => c.Name == "dump-media"))
@@ -223,7 +224,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "dump-media" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "dump-media" && !c.Synchronized);
DumpMediaVisible = true; DumpMediaVisible = true;
DumpMediaText = $"You have called the Dump-Media command {count} times"; DumpMediaText = string.Format(UI.You_have_called_the_Dump_Media_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "entropy")) if(ctx.Commands.Any(c => c.Name == "entropy"))
@@ -234,7 +235,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "entropy" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "entropy" && !c.Synchronized);
EntropyVisible = true; EntropyVisible = true;
EntropyText = $"You have called the Entropy command {count} times"; EntropyText = string.Format(UI.You_have_called_the_Entropy_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "formats")) if(ctx.Commands.Any(c => c.Name == "formats"))
@@ -245,7 +246,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "formats" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "formats" && !c.Synchronized);
FormatsCommandVisible = true; FormatsCommandVisible = true;
FormatsCommandText = $"You have called the Formats command {count} times"; FormatsCommandText = string.Format(UI.You_have_called_the_Formats_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "image-info")) if(ctx.Commands.Any(c => c.Name == "image-info"))
@@ -256,7 +257,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "image-info" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "image-info" && !c.Synchronized);
ImageInfoVisible = true; ImageInfoVisible = true;
ImageInfoText = $"You have called the Image-Info command {count} times"; ImageInfoText = string.Format(UI.You_have_called_the_Image_Info_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "media-info")) if(ctx.Commands.Any(c => c.Name == "media-info"))
@@ -267,7 +268,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "media-info" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "media-info" && !c.Synchronized);
MediaInfoVisible = true; MediaInfoVisible = true;
MediaInfoText = $"You have called the Media-Info command {count} times"; MediaInfoText = string.Format(UI.You_have_called_the_Media_Info_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "media-scan")) if(ctx.Commands.Any(c => c.Name == "media-scan"))
@@ -278,7 +279,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "media-scan" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "media-scan" && !c.Synchronized);
MediaScanVisible = true; MediaScanVisible = true;
MediaScanText = $"You have called the Media-Scan command {count} times"; MediaScanText = string.Format(UI.You_have_called_the_Media_Scan_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "printhex")) if(ctx.Commands.Any(c => c.Name == "printhex"))
@@ -289,7 +290,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "printhex" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "printhex" && !c.Synchronized);
PrintHexVisible = true; PrintHexVisible = true;
PrintHexText = $"You have called the Print-Hex command {count} times"; PrintHexText = string.Format(UI.You_have_called_the_Print_Hex_command_0_times, count);
} }
if(ctx.Commands.Any(c => c.Name == "verify")) if(ctx.Commands.Any(c => c.Name == "verify"))
@@ -300,7 +301,7 @@ public sealed class StatisticsViewModel : ViewModelBase
count += (ulong)ctx.Commands.LongCount(c => c.Name == "verify" && !c.Synchronized); count += (ulong)ctx.Commands.LongCount(c => c.Name == "verify" && !c.Synchronized);
VerifyVisible = true; VerifyVisible = true;
VerifyText = $"You have called the Verify command {count} times"; VerifyText = string.Format(UI.You_have_called_the_Verify_command_0_times, count);
} }
CommandsVisible = FsInfoVisible || ChecksumVisible || CompareVisible || ConvertImageVisible || CommandsVisible = FsInfoVisible || ChecksumVisible || CompareVisible || ConvertImageVisible ||
@@ -417,7 +418,7 @@ public sealed class StatisticsViewModel : ViewModelBase
{ {
Name = media, Name = media,
Count = count, Count = count,
Type = "real" Type = UI.Media_found_type_real
}); });
count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && !c.Real).Select(c => c.Count). count = ctx.Medias.Where(c => c.Type == media && c.Synchronized && !c.Real).Select(c => c.Count).
@@ -432,7 +433,7 @@ public sealed class StatisticsViewModel : ViewModelBase
{ {
Name = media, Name = media,
Count = count, Count = count,
Type = "image" Type = UI.Media_found_type_image
}); });
} }
} }
@@ -672,45 +673,45 @@ public sealed class StatisticsViewModel : ViewModelBase
} }
[NotNull] [NotNull]
public string CommandsLabel => "Commands"; public string CommandsLabel => UI.Title_Commands;
[NotNull] [NotNull]
public string FilterLabel => "Filter"; public string FilterLabel => UI.Title_Filter;
[NotNull] [NotNull]
public string PartitionLabel => "Partition"; public string PartitionLabel => UI.Title_Partition;
[NotNull] [NotNull]
public string PartitionsLabel => "Partitions"; public string PartitionsLabel => UI.Title_Partitions;
[NotNull] [NotNull]
public string FiltersLabel => "Filters"; public string FiltersLabel => UI.Title_Filters;
[NotNull] [NotNull]
public string FormatsLabel => "Formats"; public string FormatsLabel => UI.Title_Formats;
[NotNull] [NotNull]
public string FormatLabel => "Format"; public string FormatLabel => UI.Title_Format;
[NotNull] [NotNull]
public string FilesystemsLabel => "Filesystems"; public string FilesystemsLabel => UI.Title_Filesystems;
[NotNull] [NotNull]
public string FilesystemLabel => "Filesystem"; public string FilesystemLabel => UI.Title_Filesystem;
[NotNull] [NotNull]
public string TimesFoundLabel => "Times found"; public string TimesFoundLabel => UI.Title_Times_used;
[NotNull] [NotNull]
public string DevicesLabel => "Devices"; public string DevicesLabel => UI.Title_Devices;
[NotNull] [NotNull]
public string DeviceLabel => "Device"; public string DeviceLabel => UI.Title_Device;
[NotNull] [NotNull]
public string ManufacturerLabel => "Manufacturer"; public string ManufacturerLabel => UI.Title_Manufacturer;
[NotNull] [NotNull]
public string RevisionLabel => "Revision"; public string RevisionLabel => UI.Title_Revision;
[NotNull] [NotNull]
public string BusLabel => "Bus"; public string BusLabel => UI.Title_Bus;
[NotNull] [NotNull]
public string MediasLabel => "Medias"; public string MediasLabel => UI.Title_Medias;
[NotNull] [NotNull]
public string MediaLabel => "Media"; public string MediaLabel => UI.Title_Media;
[NotNull] [NotNull]
public string TypeLabel => "Type"; public string TypeLabel => UI.Title_Type_for_media;
[NotNull] [NotNull]
public string Title => "Encodings"; public string Title => UI.Encodings;
[NotNull] [NotNull]
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public ReactiveCommand<Unit, Unit> CloseCommand { get; } public ReactiveCommand<Unit, Unit> CloseCommand { get; }
public ObservableCollection<NameCountModel> Filters { get; } public ObservableCollection<NameCountModel> Filters { get; }

View File

@@ -39,6 +39,7 @@ using Aaru.Decoders.SCSI.SSC;
using Aaru.Devices; using Aaru.Devices;
using Aaru.Gui.ViewModels.Tabs; using Aaru.Gui.ViewModels.Tabs;
using Aaru.Gui.Views.Tabs; using Aaru.Gui.Views.Tabs;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using ReactiveUI; using ReactiveUI;
using DeviceInfo = Aaru.Core.Devices.Info.DeviceInfo; using DeviceInfo = Aaru.Core.Devices.Info.DeviceInfo;
@@ -234,26 +235,28 @@ public sealed class DeviceInfoViewModel : ViewModelBase
{ {
PlextorPoweRecRecommendedVisible = true; PlextorPoweRecRecommendedVisible = true;
PlextorPoweRecRecommended = $"{devInfo.PlextorFeatures.PoweRecRecommendedSpeed} Kb/sec."; PlextorPoweRecRecommended =
string.Format(UI._0_Kb_sec, devInfo.PlextorFeatures.PoweRecRecommendedSpeed);
} }
if(devInfo.PlextorFeatures.PoweRecSelected > 0) if(devInfo.PlextorFeatures.PoweRecSelected > 0)
{ {
PlextorPoweRecSelectedVisible = true; PlextorPoweRecSelectedVisible = true;
PlextorPoweRecSelected = $"{devInfo.PlextorFeatures.PoweRecSelected} Kb/sec."; PlextorPoweRecSelected =
string.Format(UI._0_Kb_sec, devInfo.PlextorFeatures.PoweRecSelected);
} }
if(devInfo.PlextorFeatures.PoweRecMax > 0) if(devInfo.PlextorFeatures.PoweRecMax > 0)
{ {
PlextorPoweRecMaxVisible = true; PlextorPoweRecMaxVisible = true;
PlextorPoweRecMax = $"{devInfo.PlextorFeatures.PoweRecMax} Kb/sec."; PlextorPoweRecMax = string.Format(UI._0_Kb_sec, devInfo.PlextorFeatures.PoweRecMax);
} }
if(devInfo.PlextorFeatures.PoweRecLast > 0) if(devInfo.PlextorFeatures.PoweRecLast > 0)
{ {
PlextorPoweRecLastVisible = true; PlextorPoweRecLastVisible = true;
PlextorPoweRecLast = $"{devInfo.PlextorFeatures.PoweRecLast} Kb/sec."; PlextorPoweRecLast = string.Format(UI._0_Kb_sec, devInfo.PlextorFeatures.PoweRecLast);
} }
} }
} }
@@ -267,15 +270,16 @@ public sealed class DeviceInfoViewModel : ViewModelBase
if(devInfo.PlextorFeatures.SilentModeEnabled) if(devInfo.PlextorFeatures.SilentModeEnabled)
{ {
PlextorSilentModeAccessTime = devInfo.PlextorFeatures.AccessTimeLimit == 2 PlextorSilentModeAccessTime = devInfo.PlextorFeatures.AccessTimeLimit == 2
? "\tAccess time is slow" : "\tAccess time is fast"; ? Localization.Core.Access_time_is_slow
: Localization.Core.Access_time_is_fast;
PlextorSilentModeCdReadSpeedLimit = PlextorSilentModeCdReadSpeedLimit =
devInfo.PlextorFeatures.CdReadSpeedLimit > 0 devInfo.PlextorFeatures.CdReadSpeedLimit > 0
? $"{devInfo.PlextorFeatures.CdReadSpeedLimit}x" : "unlimited"; ? $"{devInfo.PlextorFeatures.CdReadSpeedLimit}x" : UI.unlimited_as_in_speed;
PlextorSilentModeCdWriteSpeedLimit = PlextorSilentModeCdWriteSpeedLimit =
devInfo.PlextorFeatures.CdWriteSpeedLimit > 0 devInfo.PlextorFeatures.CdWriteSpeedLimit > 0
? $"{devInfo.PlextorFeatures.CdReadSpeedLimit}x" : "unlimited"; ? $"{devInfo.PlextorFeatures.CdReadSpeedLimit}x" : UI.unlimited_as_in_speed;
if(devInfo.PlextorFeatures.IsDvd) if(devInfo.PlextorFeatures.IsDvd)
{ {
@@ -283,7 +287,7 @@ public sealed class DeviceInfoViewModel : ViewModelBase
PlextorSilentModeDvdReadSpeedLimit = PlextorSilentModeDvdReadSpeedLimit =
devInfo.PlextorFeatures.DvdReadSpeedLimit > 0 devInfo.PlextorFeatures.DvdReadSpeedLimit > 0
? $"{devInfo.PlextorFeatures.DvdReadSpeedLimit}x" : "unlimited"; ? $"{devInfo.PlextorFeatures.DvdReadSpeedLimit}x" : UI.unlimited_as_in_speed;
} }
} }
} }
@@ -340,18 +344,23 @@ public sealed class DeviceInfoViewModel : ViewModelBase
Ssc = true; Ssc = true;
if(blockLimits.Value.minBlockLen == blockLimits.Value.maxBlockLen) if(blockLimits.Value.minBlockLen == blockLimits.Value.maxBlockLen)
MinBlockSize = $"Device's block size is fixed at {blockLimits.Value.minBlockLen} bytes"; MinBlockSize = string.Format(Localization.Core.Device_block_size_is_fixed_at_0_bytes,
blockLimits.Value.minBlockLen);
else else
{ {
MaxBlockSize = blockLimits.Value.maxBlockLen > 0 MaxBlockSize = blockLimits.Value.maxBlockLen > 0
? $"Device's maximum block size is {blockLimits.Value.maxBlockLen} bytes" ? string.Format(Localization.Core.Device_maximum_block_size_is_0_bytes,
: "Device does not specify a maximum block size"; blockLimits.Value.maxBlockLen) : Localization.Core.
Device_does_not_specify_a_maximum_block_size;
MinBlockSize = $"Device's minimum block size is {blockLimits.Value.minBlockLen} bytes"; MinBlockSize = string.Format(Localization.Core.Device_minimum_block_size_is_0_bytes,
blockLimits.Value.minBlockLen);
if(blockLimits.Value.granularity > 0) if(blockLimits.Value.granularity > 0)
BlockSizeGranularity = $"Device's needs a block size granularity of 2^{ BlockSizeGranularity =
blockLimits.Value.granularity} ({Math.Pow(2, blockLimits.Value.granularity)}) bytes"; string.Format(Localization.Core.Device_needs_a_block_size_granularity_of_pow_0_1_bytes,
blockLimits.Value.granularity,
Math.Pow(2, blockLimits.Value.granularity));
} }
} }
} }
@@ -912,75 +921,75 @@ public sealed class DeviceInfoViewModel : ViewModelBase
set => this.RaiseAndSetIfChanged(ref _sdMmcInfo, value); set => this.RaiseAndSetIfChanged(ref _sdMmcInfo, value);
} }
public string DeviceInformationLabel => "Device information"; public string DeviceInformationLabel => UI.Title_Device_information;
public string GeneralLabel => "General"; public string GeneralLabel => UI.Title_General;
public string DeviceTypeLabel => "Device type"; public string DeviceTypeLabel => UI.Title_Device_type;
public string ManufacturerLabel => "Manufacturer"; public string ManufacturerLabel => UI.Title_Manufacturer;
public string ModelLabel => "Model"; public string ModelLabel => UI.Title_Model;
public string RevisionLabel => "Revision"; public string RevisionLabel => UI.Title_Revision;
public string SerialNumberLabel => "Serial number"; public string SerialNumberLabel => UI.Title_Serial_number;
public string ScsiTypeLabel => "Peripheral device type"; public string ScsiTypeLabel => UI.Title_Peripheral_device_type;
public string RemovableMediaLabel => "Removable media"; public string RemovableMediaLabel => UI.Title_Removable_media;
public string UsbConnectedLabel => "Connected by USB"; public string UsbConnectedLabel => UI.Title_Connected_by_USB;
public string USBLabel => "USB"; public string USBLabel => UI.Title_USB;
public string VendorIDLabel => "Vendor ID"; public string VendorIDLabel => UI.Title_Vendor_ID;
public string ProductIDLabel => "Product ID"; public string ProductIDLabel => UI.Title_Product_ID;
public string ProductLabel => "Product"; public string ProductLabel => UI.Title_Product;
public string SaveUsbDescriptorsLabel => "Save descriptors to file"; public string SaveUsbDescriptorsLabel => UI.Save_descriptors_to_file;
public string FireWireLabel => "FireWire"; public string FireWireLabel => UI.Title_FireWire;
public string ModelIDLabel => "Model ID"; public string ModelIDLabel => UI.Title_Model_ID;
public string GUIDLabel => "GUID"; public string GUIDLabel => UI.Title_GUID;
public string PlextorLabel => "Plextor"; public string PlextorLabel => UI.Title_Plextor;
public string PlextorDiscsLabel => "Total loaded discs:"; public string PlextorDiscsLabel => UI.Total_loaded_discs;
public string PlextorCdReadTimeLabel => "Time spent reading CDs"; public string PlextorCdReadTimeLabel => UI.Time_spent_reading_CDs;
public string PlextorCdWriteTimeLabel => "Time spent writing CDs"; public string PlextorCdWriteTimeLabel => UI.Time_spent_writing_CDs;
public string PlextorDvdReadTimeLabel => "Time spent reading DVDs"; public string PlextorDvdReadTimeLabel => UI.Time_spent_reading_DVDs;
public string PlextorDvdWriteTimeLabel => "Time spent writing DVDs"; public string PlextorDvdWriteTimeLabel => UI.Time_spent_writing_DVDs;
public string PlextorPoweRecLabel => "Supports PoweRec"; public string PlextorPoweRecLabel => UI.Supports_PoweRec;
public string PlextorPoweRecEnabledLabel => "PoweRec is enabled"; public string PlextorPoweRecEnabledLabel => UI.PoweRec_is_enabled;
public string PlextorPoweRecRecommendedLabel => "Recommended speed"; public string PlextorPoweRecRecommendedLabel => UI.Recommended_speed;
public string PlextorPoweRecSelectedLabel => "Selected PoweRec speed for currently inserted media:"; public string PlextorPoweRecSelectedLabel => UI.Selected_PoweRec_speed_for_currently_inserted_media;
public string PlextorPoweRecMaxLabel => "Maximum PoweRec speed for currently inserted media:"; public string PlextorPoweRecMaxLabel => UI.Maximum_PoweRec_speed_for_currently_inserted_media;
public string PlextorPoweRecLastLabel => "Last PoweRec used speed"; public string PlextorPoweRecLastLabel => UI.Last_PoweRec_used_speed;
public string PlextorSilentModeLabel => "Supports SilentMode"; public string PlextorSilentModeLabel => UI.Supports_SilentMode;
public string PlextorSilentModeEnabledLabel => "SilentMode is enabled"; public string PlextorSilentModeEnabledLabel => UI.SilentMode_is_enabled;
public string PlextorSilentModeCdReadSpeedLimitLabel => "CD read speed limited to"; public string PlextorSilentModeCdReadSpeedLimitLabel => UI.CD_read_speed_limited_to;
public string PlextorSilentModeCdWriteSpeedLimitLabel => "CD write speed limited to"; public string PlextorSilentModeCdWriteSpeedLimitLabel => UI.CD_write_speed_limited_to;
public string PlextorSilentModeDvdReadSpeedLimitLabel => "DVD read speed limited to"; public string PlextorSilentModeDvdReadSpeedLimitLabel => UI.DVD_read_speed_limited_to;
public string PlextorGigaRecLabel => "Supports GigaRec"; public string PlextorGigaRecLabel => UI.Supports_GigaRec;
public string PlextorSecuRecLabel => "Supports SecuRec"; public string PlextorSecuRecLabel => UI.Supports_SecuRec;
public string PlextorSpeedReadLabel => "Supports SpeedRead"; public string PlextorSpeedReadLabel => UI.Supports_SpeedRead;
public string PlextorSpeedEnabledLabel => "SpeedRead is enabled"; public string PlextorSpeedEnabledLabel => UI.SpeedRead_is_enabled;
public string PlextorHidingLabel => "Supports hiding CD-Rs and sessions"; public string PlextorHidingLabel => UI.Supports_hiding_CD_Rs_and_sessions;
public string PlextorHidesRecordablesLabel => "Is hiding CD-Rs"; public string PlextorHidesRecordablesLabel => UI.Is_hiding_CD_Rs;
public string PlextorHidesSessionsLabel => "Is forcing only first session"; public string PlextorHidesSessionsLabel => UI.Is_forcing_only_first_session;
public string PlextorVariRecLabel => "Supports VariRec"; public string PlextorVariRecLabel => UI.Supports_VariRec;
public string PlextorVariRecDvdLabel => "Supports VariRec on DVDs"; public string PlextorVariRecDvdLabel => UI.Supports_VariRec_on_DVDs;
public string PlextorBitSettingLabel => "Supports bitsetting DVD+R book type"; public string PlextorBitSettingLabel => UI.Supports_bitsetting_DVD_R_book_type;
public string PlextorBitSettingDlLabel => "Supports bitsetting DVD+R DL book type"; public string PlextorBitSettingDlLabel => UI.Supports_bitsetting_DVD_R_DL_book_type;
public string PlextorDvdPlusWriteTestLabel => "Supports test writing DVD+"; public string PlextorDvdPlusWriteTestLabel => UI.Supports_test_writing_DVD_Plus;
public string KreonLabel => "Kreon"; public string KreonLabel => UI.Title_Kreon;
public string KreonChallengeResponseLabel => "Can do challenge/response with Xbox discs"; public string KreonChallengeResponseLabel => Localization.Core.Can_do_challenge_response_with_Xbox_discs;
public string KreonDecryptSsLabel => "Can read and decrypt SS from Xbox discs"; public string KreonDecryptSsLabel => Localization.Core.Can_read_and_decrypt_SS_from_Xbox_discs;
public string KreonXtremeUnlockLabel => "Can set xtreme unlock state with Xbox discs"; public string KreonXtremeUnlockLabel => Localization.Core.Can_set_xtreme_unlock_state_with_Xbox_discs;
public string KreonWxripperUnlockLabel => "Can set wxripper unlock state with Xbox discs"; public string KreonWxripperUnlockLabel => Localization.Core.Can_set_wxripper_unlock_state_with_Xbox_discs;
public string KreonChallengeResponse360Label => "Can do challenge/response with Xbox 360 discs"; public string KreonChallengeResponse360Label => Localization.Core.Can_do_challenge_response_with_Xbox_360_discs;
public string KreonDecryptSs360Label => "Can read and decrypt SS from Xbox 360 discs"; public string KreonDecryptSs360Label => Localization.Core.Can_read_and_decrypt_SS_from_Xbox_360_discs;
public string KreonXtremeUnlock360Label => "Can set xtreme unlock state with Xbox 360 discs"; public string KreonXtremeUnlock360Label => Localization.Core.Can_set_xtreme_unlock_state_with_Xbox_360_discs;
public string KreonWxripperUnlock360Label => "Can set wxripper unlock state with Xbox 360 discs"; public string KreonWxripperUnlock360Label => Localization.Core.Can_set_wxripper_unlock_state_with_Xbox_360_discs;
public string KreonSetLockedLabel => "Can set locked state"; public string KreonSetLockedLabel => Localization.Core.Can_set_Kreon_locked_state;
public string KreonErrorSkippingLabel => "Can skip read errors"; public string KreonErrorSkippingLabel => Localization.Core.Kreon_Can_skip_read_errors;
public string DensitiesSupportedByDeviceLabel => "Densities supported by device:"; public string DensitiesSupportedByDeviceLabel => UI.Densities_supported_by_device;
public string MediumTypesSupportedByDeviceLabel => "Medium types supported by device:"; public string MediumTypesSupportedByDeviceLabel => UI.Medium_types_supported_by_device;
public string CIDLabel => "CID"; public string CIDLabel => UI.Title_CID;
public string CSDLabel => "CSD"; public string CSDLabel => UI.Title_CSD;
public string OCRLabel => "OCR"; public string OCRLabel => UI.Title_OCR;
public string ExtendedCSDLabel => "Extended CSD"; public string ExtendedCSDLabel => UI.Title_Extended_CSD;
public string SCRLabel => "SCR"; public string SCRLabel => UI.Title_SCR;
public string PCMCIALabel => "PCMCIA"; public string PCMCIALabel => UI.Title_PCMCIA;
public string ATA_ATAPILabel => "ATA/ATAPI"; public string ATA_ATAPILabel => UI.Title_ATA_ATAPI;
public string SCSILabel => "SCSI"; public string SCSILabel => UI.Title_SCSI;
public string SD_MMCLabel => "SD/MMC"; public string SD_MMCLabel => UI.Title_SD_MMC;
async Task ExecuteSaveUsbDescriptorsCommand() async Task ExecuteSaveUsbDescriptorsCommand()
{ {
@@ -992,7 +1001,7 @@ public sealed class DeviceInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);

View File

@@ -30,6 +30,7 @@
// Copyright © 2011-2022 Natalia Portillo // Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
using Schemas; using Schemas;
@@ -39,27 +40,38 @@ public sealed class FileSystemViewModel
{ {
public FileSystemViewModel([NotNull] FileSystemType xmlFsType, string information) public FileSystemViewModel([NotNull] FileSystemType xmlFsType, string information)
{ {
TypeText = $"Filesystem type: {xmlFsType.Type}"; TypeText = string.Format(Localization.Core.Filesystem_type_0, xmlFsType.Type);
VolumeNameText = $"Volume name: {xmlFsType.VolumeName}"; VolumeNameText = string.Format(Localization.Core.Volume_name_0, xmlFsType.VolumeName);
SerialNumberText = $"Serial number: {xmlFsType.VolumeSerial}"; SerialNumberText = string.Format(Localization.Core.Volume_serial_0, xmlFsType.VolumeSerial);
ApplicationIdentifierText = $"Application identifier: {xmlFsType.ApplicationIdentifier}";
SystemIdentifierText = $"System identifier: {xmlFsType.SystemIdentifier}";
VolumeSetIdentifierText = $"Volume set identifier: {xmlFsType.VolumeSetIdentifier}";
DataPreparerIdentifierText = $"Data preparer identifier: {xmlFsType.DataPreparerIdentifier}";
PublisherIdentifierText = $"Publisher identifier: {xmlFsType.PublisherIdentifier}";
CreationDateText = $"Volume created on {xmlFsType.CreationDate:F}";
EffectiveDateText = $"Volume effective from {xmlFsType.EffectiveDate:F}";
ModificationDateText = $"Volume last modified on {xmlFsType.ModificationDate:F}";
ExpirationDateText = $"Volume expired on {xmlFsType.ExpirationDate:F}";
BackupDateText = $"Volume last backed up on {xmlFsType.BackupDate:F}";
ClustersText = $"Volume has {xmlFsType.Clusters} clusters of {xmlFsType.ClusterSize} bytes each (total of { ApplicationIdentifierText =
xmlFsType.Clusters * xmlFsType.ClusterSize} bytes)"; string.Format(Localization.Core.Application_identifier_0, xmlFsType.ApplicationIdentifier);
FreeClustersText = $"Volume has {xmlFsType.FreeClusters} clusters free ({ SystemIdentifierText = string.Format(Localization.Core.System_identifier_0, xmlFsType.SystemIdentifier);
xmlFsType.FreeClusters / xmlFsType.Clusters:P})";
FilesText = $"Volume contains {xmlFsType.Files} files"; VolumeSetIdentifierText =
string.Format(Localization.Core.Volume_set_identifier_0, xmlFsType.VolumeSetIdentifier);
DataPreparerIdentifierText =
string.Format(Localization.Core.Data_preparer_identifier_0, xmlFsType.DataPreparerIdentifier);
PublisherIdentifierText =
string.Format(Localization.Core.Publisher_identifier_0, xmlFsType.PublisherIdentifier);
CreationDateText = string.Format(Localization.Core.Volume_created_on_0, xmlFsType.CreationDate);
EffectiveDateText = string.Format(Localization.Core.Volume_effective_from_0, xmlFsType.EffectiveDate);
ModificationDateText = string.Format(Localization.Core.Volume_last_modified_on_0, xmlFsType.ModificationDate);
ExpirationDateText = string.Format(Localization.Core.Volume_expired_on_0, xmlFsType.ExpirationDate);
BackupDateText = string.Format(Localization.Core.Volume_last_backed_up_on_0, xmlFsType.BackupDate);
ClustersText = string.Format(Localization.Core.Volume_has_0_clusters_of_1_bytes_each_total_of_2_bytes,
xmlFsType.Clusters, xmlFsType.ClusterSize,
xmlFsType.Clusters * xmlFsType.ClusterSize);
FreeClustersText = string.Format(Localization.Core.Volume_has_0_clusters_free_1, xmlFsType.FreeClusters,
xmlFsType.FreeClusters / xmlFsType.Clusters);
FilesText = string.Format(Localization.Core.Volume_contains_0_files, xmlFsType.Files);
BootableChecked = xmlFsType.Bootable; BootableChecked = xmlFsType.Bootable;
DirtyChecked = xmlFsType.Dirty; DirtyChecked = xmlFsType.Dirty;
InformationText = information; InformationText = information;
@@ -73,9 +85,9 @@ public sealed class FileSystemViewModel
FilesVisible = xmlFsType.FilesSpecified; FilesVisible = xmlFsType.FilesSpecified;
} }
public string BootableLabel => "Filesystem contains boot code"; public string BootableLabel => Localization.Core.Filesystem_contains_boot_code;
public string DirtyLabel => "Filesystem has not been unmounted correctly or contains errors"; public string DirtyLabel => Localization.Core.Filesystem_has_not_been_unmounted_correctly_or_contains_errors;
public string DetailsLabel => "Details"; public string DetailsLabel => UI.Title_Details;
public string TypeText { get; } public string TypeText { get; }
public string VolumeNameText { get; } public string VolumeNameText { get; }

View File

@@ -49,6 +49,7 @@ using Aaru.Gui.ViewModels.Windows;
using Aaru.Gui.Views.Tabs; using Aaru.Gui.Views.Tabs;
using Aaru.Gui.Views.Windows; using Aaru.Gui.Views.Windows;
using Aaru.Helpers; using Aaru.Helpers;
using Aaru.Localization;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
@@ -112,82 +113,89 @@ public sealed class ImageInfoViewModel : ViewModelBase
? genericOpticalIcon ? genericOpticalIcon
: genericFolderIcon; : genericFolderIcon;
ImagePathText = $"Path: {imagePath}"; ImagePathText = string.Format(UI.Path_0, imagePath);
FilterText = $"Filter: {filter.Name}"; FilterText = string.Format(UI.Filter_0, filter.Name);
ImageIdentifiedText = $"Image format identified by {imageFormat.Name} ({imageFormat.Id})."; ImageIdentifiedText = string.Format(UI.Image_format_identified_by_0_1, imageFormat.Name, imageFormat.Id);
ImageFormatText = !string.IsNullOrWhiteSpace(imageFormat.Info.Version) ImageFormatText = !string.IsNullOrWhiteSpace(imageFormat.Info.Version)
? $"Format: {imageFormat.Format} version {imageFormat.Info.Version}" ? string.Format(UI.Format_0_version_1, imageFormat.Format, imageFormat.Info.Version)
: $"Format: {imageFormat.Format}"; : string.Format(UI.Format_0, imageFormat.Format);
ImageSizeText = $"Image without headers is {imageFormat.Info.ImageSize} bytes long"; ImageSizeText = string.Format(Localization.Core.Image_without_headers_is_0_bytes_long,
imageFormat.Info.ImageSize);
SectorsText = $"Contains a media of {imageFormat.Info.Sectors} sectors with a maximum sector size of { SectorsText =
imageFormat.Info.SectorSize} bytes (if all sectors are of the same size this would be { string.Format(Localization.Core.Contains_a_media_of_0_sectors_with_a_maximum_sector_size_of_1_bytes_etc,
imageFormat.Info.Sectors * imageFormat.Info.SectorSize} bytes)"; imageFormat.Info.Sectors, imageFormat.Info.SectorSize,
imageFormat.Info.Sectors * imageFormat.Info.SectorSize);
MediaTypeText = $"Contains a media of type {imageFormat.Info.MediaType} and XML type { MediaTypeText = string.Format(Localization.Core.Contains_a_media_of_type_0_and_XML_type_1,
imageFormat.Info.XmlMediaType}"; imageFormat.Info.MediaType, imageFormat.Info.XmlMediaType);
HasPartitionsText = $"{(imageFormat.Info.HasPartitions ? "Has" : "Doesn't have")} partitions"; HasPartitionsText = imageFormat.Info.HasPartitions ? UI.Has_partitions : UI.Doesnt_have_partitions;
HasSessionsText = $"{(imageFormat.Info.HasSessions ? "Has" : "Doesn't have")} sessions"; HasSessionsText = imageFormat.Info.HasSessions ? UI.Has_sessions : UI.Doesnt_have_sessions;
if(!string.IsNullOrWhiteSpace(imageFormat.Info.Application)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.Application))
ApplicationText = !string.IsNullOrWhiteSpace(imageFormat.Info.ApplicationVersion) ApplicationText = !string.IsNullOrWhiteSpace(imageFormat.Info.ApplicationVersion)
? $"Was created with {imageFormat.Info.Application} version { ? string.Format(Localization.Core.Was_created_with_0_version_1,
imageFormat.Info.ApplicationVersion}" imageFormat.Info.Application, imageFormat.Info.ApplicationVersion)
: $"Was created with {imageFormat.Info.Application}"; : string.Format(Localization.Core.Was_created_with_0, imageFormat.Info.Application);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.Creator)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.Creator))
CreatorText = $"Created by: {imageFormat.Info.Creator}"; CreatorText = string.Format(Localization.Core.Created_by_0, imageFormat.Info.Creator);
if(imageFormat.Info.CreationTime != DateTime.MinValue) if(imageFormat.Info.CreationTime != DateTime.MinValue)
CreationTimeText = $"Created on {imageFormat.Info.CreationTime}"; CreationTimeText = string.Format(Localization.Core.Created_on_0, imageFormat.Info.CreationTime);
if(imageFormat.Info.LastModificationTime != DateTime.MinValue) if(imageFormat.Info.LastModificationTime != DateTime.MinValue)
LastModificationTimeText = $"Last modified on {imageFormat.Info.LastModificationTime}"; LastModificationTimeText =
string.Format(Localization.Core.Last_modified_on_0, imageFormat.Info.LastModificationTime);
if(imageFormat.Info.MediaSequence != 0 && if(imageFormat.Info.MediaSequence != 0 &&
imageFormat.Info.LastMediaSequence != 0) imageFormat.Info.LastMediaSequence != 0)
MediaSequenceText = $"Media is number {imageFormat.Info.MediaSequence} on a set of { MediaSequenceText = string.Format(Localization.Core.Media_is_number_0_on_a_set_of_1_medias,
imageFormat.Info.LastMediaSequence} medias"; imageFormat.Info.MediaSequence, imageFormat.Info.LastMediaSequence);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaTitle)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaTitle))
MediaTitleText = $"Media title: {imageFormat.Info.MediaTitle}"; MediaTitleText = string.Format(UI.Media_title_0, imageFormat.Info.MediaTitle);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaManufacturer)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaManufacturer))
MediaManufacturerText = $"Media manufacturer: {imageFormat.Info.MediaManufacturer}"; MediaManufacturerText =
string.Format(Localization.Core.Media_manufacturer_0, imageFormat.Info.MediaManufacturer);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaModel)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaModel))
MediaModelText = $"Media model: {imageFormat.Info.MediaModel}"; MediaModelText = string.Format(UI.Media_model_0, imageFormat.Info.MediaModel);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaSerialNumber)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaSerialNumber))
MediaSerialNumberText = $"Media serial number: {imageFormat.Info.MediaSerialNumber}"; MediaSerialNumberText =
string.Format(Localization.Core.Media_serial_number_0, imageFormat.Info.MediaSerialNumber);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaBarcode)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaBarcode))
MediaBarcodeText = $"Media barcode: {imageFormat.Info.MediaBarcode}"; MediaBarcodeText = string.Format(UI.Media_barcode_0, imageFormat.Info.MediaBarcode);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaPartNumber)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaPartNumber))
MediaPartNumberText = $"Media part number: {imageFormat.Info.MediaPartNumber}"; MediaPartNumberText = string.Format(UI.Media_part_number_0, imageFormat.Info.MediaPartNumber);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveManufacturer)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveManufacturer))
DriveManufacturerText = $"Drive manufacturer: {imageFormat.Info.DriveManufacturer}"; DriveManufacturerText = string.Format(UI.Drive_manufacturer_0, imageFormat.Info.DriveManufacturer);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveModel)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveModel))
DriveModelText = $"Drive model: {imageFormat.Info.DriveModel}"; DriveModelText = string.Format(UI.Drive_model_0, imageFormat.Info.DriveModel);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveSerialNumber)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveSerialNumber))
DriveSerialNumberText = $"Drive serial number: {imageFormat.Info.DriveSerialNumber}"; DriveSerialNumberText =
string.Format(Localization.Core.Drive_serial_number_0, imageFormat.Info.DriveSerialNumber);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveFirmwareRevision)) if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveFirmwareRevision))
DriveFirmwareRevisionText = $"Drive firmware info: {imageFormat.Info.DriveFirmwareRevision}"; DriveFirmwareRevisionText = string.Format(UI.Drive_firmware_info_0, imageFormat.Info.DriveFirmwareRevision);
if(imageFormat.Info.Cylinders > 0 && if(imageFormat.Info.Cylinders > 0 &&
imageFormat.Info is { Heads: > 0, SectorsPerTrack: > 0 } && imageFormat.Info is { Heads: > 0, SectorsPerTrack: > 0 } &&
imageFormat.Info.XmlMediaType != XmlMediaType.OpticalDisc && imageFormat.Info.XmlMediaType != XmlMediaType.OpticalDisc &&
imageFormat is not ITapeImage { IsTape: true }) imageFormat is not ITapeImage { IsTape: true })
MediaGeometryText = $"Media geometry: {imageFormat.Info.Cylinders} cylinders, {imageFormat.Info.Heads MediaGeometryText = string.Format(UI.Media_geometry_0_cylinders_1_heads_2_sectors_per_track,
} heads, {imageFormat.Info.SectorsPerTrack} sectors per track"; imageFormat.Info.Cylinders, imageFormat.Info.Heads,
imageFormat.Info.SectorsPerTrack);
if(imageFormat.Info.ReadableMediaTags is { Count: > 0 }) if(imageFormat.Info.ReadableMediaTags is { Count: > 0 })
foreach(MediaTagType tag in imageFormat.Info.ReadableMediaTags.OrderBy(t => t)) foreach(MediaTagType tag in imageFormat.Info.ReadableMediaTags.OrderBy(t => t))
@@ -720,51 +728,51 @@ public sealed class ImageInfoViewModel : ViewModelBase
MediaSerialNumberText != null || MediaBarcodeText != null || MediaSerialNumberText != null || MediaBarcodeText != null ||
MediaPartNumberText != null; MediaPartNumberText != null;
public string ImageInformationLabel => "Image information"; public string ImageInformationLabel => UI.Title_Image_information;
public string GeneralLabel => "General"; public string GeneralLabel => UI.Title_General;
public string CommentsLabel => "Comments:"; public string CommentsLabel => UI.Title_Comments;
public string MediaInformationLabel => "Media information"; public string MediaInformationLabel => UI.Title_Media_information;
public string DriveInformationLabel => "Drive information"; public string DriveInformationLabel => UI.Title_Drive_information;
public string ReadableMediaTagsLabel => "Readable media tags"; public string ReadableMediaTagsLabel => UI.Title_Readable_media_tags;
public string TagLabel => "Readable media tags"; public string TagLabel => UI.Title_Readable_media_tags;
public string ReadableSectorTagsLabel => "Readable sector tags"; public string ReadableSectorTagsLabel => UI.Title_Readable_sector_tags;
public string SessionsLabel => "Sessions"; public string SessionsLabel => UI.Title_Sessions;
public string SessionLabel => "Session"; public string SessionLabel => Localization.Core.Title_Session;
public string FirstTrackLabel => "First track"; public string FirstTrackLabel => Localization.Core.Title_First_track;
public string LastTrackLabel => "Last track"; public string LastTrackLabel => Localization.Core.Title_Last_track;
public string StartLabel => "Start"; public string StartLabel => Localization.Core.Title_Start;
public string EndLabel => "End"; public string EndLabel => Localization.Core.Title_End;
public string TracksLabel => "Tracks"; public string TracksLabel => UI.Title_Tracks;
public string TrackLabel => "Track"; public string TrackLabel => Localization.Core.Title_Track;
public string TypeLabel => "Type"; public string TypeLabel => UI.Title_Type;
public string BpsLabel => "Bps"; public string BpsLabel => Localization.Core.Title_Bps;
public string RawBpsLabel => "Raw bps"; public string RawBpsLabel => Localization.Core.Title_Raw_bps;
public string SubchannelLabel => "Subchannel"; public string SubchannelLabel => Localization.Core.Title_Subchannel;
public string PregapLabel => "Pregap"; public string PregapLabel => Localization.Core.Title_Pregap;
public string DumpHardwareLabel => "Dump hardware"; public string DumpHardwareLabel => UI.Title_Dump_hardware;
public string ManufacturerLabel => "Manufacturer"; public string ManufacturerLabel => UI.Title_Manufacturer;
public string ModelLabel => "Model"; public string ModelLabel => UI.Title_Model;
public string RevisionLabel => "Revision"; public string RevisionLabel => UI.Title_Revision;
public string SerialLabel => "Serial"; public string SerialLabel => UI.Serial;
public string SoftwareLabel => "Software"; public string SoftwareLabel => UI.Title_Software;
public string VersionLabel => "Version"; public string VersionLabel => UI.Title_Version;
public string OperatingSystemLabel => "Operating system"; public string OperatingSystemLabel => UI.Title_Operating_system;
public string SCSILabel => "SCSI"; public string SCSILabel => UI.Title_SCSI;
public string ATA_ATAPILabel => "ATA / ATAPI"; public string ATA_ATAPILabel => UI.Title_ATA_ATAPI;
public string CompactDiscLabel => "CompactDisc"; public string CompactDiscLabel => Localization.Core.Title_CompactDisc;
public string DVD_HD_DVDLabel => "DVD / HD DVD"; public string DVD_HD_DVDLabel => Localization.Core.Title_DVD_HD_DVD;
public string DVD_R_WLabel => "DVD-R(W)"; public string DVD_R_WLabel => Localization.Core.Title_DVD_Plus_Dash_R_W;
public string BluRayLabel => "Blu-ray"; public string BluRayLabel => Localization.Core.Title_Blu_ray;
public string PCMCIALabel => "PCMCIA"; public string PCMCIALabel => UI.Title_PCMCIA;
public string SD_MMCLabel => "SD / MMC"; public string SD_MMCLabel => UI.Title_SD_MMC;
public string XboxLabel => "Xbox"; public string XboxLabel => Localization.Core.Title_Xbox;
public string EntropyLabel => "Calculate entropy"; public string EntropyLabel => UI.ButtonLabel_Calculate_entropy;
public string VerifyLabel => "Verify"; public string VerifyLabel => UI.ButtonLabel_Verify;
public string ChecksumLabel => "Checksum"; public string ChecksumLabel => UI.ButtonLabel_Checksum;
public string ConvertLabel => "Convert to..."; public string ConvertLabel => UI.ButtonLabel_Convert_to;
public string CreateSidecarLabel => "Create CICM XML sidecar..."; public string CreateSidecarLabel => UI.ButtonLabel_Create_CICM_XML_sidecar;
public string ViewSectorsLabel => "View sectors"; public string ViewSectorsLabel => UI.ButtonLabel_View_sectors;
public string DecodeMediaTagLabel => "Decode media tags"; public string DecodeMediaTagLabel => UI.ButtonLabel_Decode_media_tags;
void ExecuteEntropyCommand() void ExecuteEntropyCommand()
{ {

View File

@@ -40,6 +40,7 @@ using Aaru.Gui.ViewModels.Tabs;
using Aaru.Gui.ViewModels.Windows; using Aaru.Gui.ViewModels.Windows;
using Aaru.Gui.Views.Tabs; using Aaru.Gui.Views.Tabs;
using Aaru.Gui.Views.Windows; using Aaru.Gui.Views.Windows;
using Aaru.Localization;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
@@ -109,16 +110,17 @@ public sealed class MediaInfoViewModel : ViewModelBase
MediaSize = totalSize switch MediaSize = totalSize switch
{ {
> 1099511627776 => $"Media has {scsiInfo.Blocks} blocks of {scsiInfo.BlockSize > 1099511627776 =>
} bytes/each. (for a total of {totalSize / 1099511627776d:F3} TiB)", string.Format(Localization.Core.Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2_TiB,
> 1073741824 => $"Media has {scsiInfo.Blocks} blocks of {scsiInfo.BlockSize scsiInfo.Blocks, scsiInfo.BlockSize, totalSize / 1099511627776d),
} bytes/each. (for a total of {totalSize / 1073741824d:F3} GiB)", > 1073741824 => string.Format(Localization.Core.Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2_GiB,
> 1048576 => $"Media has {scsiInfo.Blocks} blocks of {scsiInfo.BlockSize} bytes/each. (for a total of { scsiInfo.Blocks, scsiInfo.BlockSize, totalSize / 1073741824d),
totalSize / 1048576d:F3} MiB)", > 1048576 => string.Format(Localization.Core.Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2_MiB,
> 1024 => $"Media has {scsiInfo.Blocks} blocks of {scsiInfo.BlockSize} bytes/each. (for a total of { scsiInfo.Blocks, scsiInfo.BlockSize, totalSize / 1048576d),
totalSize / 1024d:F3} KiB)", > 1024 => string.Format(Localization.Core.Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2_KiB,
_ => $"Media has {scsiInfo.Blocks} blocks of {scsiInfo.BlockSize} bytes/each. (for a total of {totalSize scsiInfo.Blocks, scsiInfo.BlockSize, totalSize / 1024d),
} bytes)" _ => string.Format(Localization.Core.Media_has_0_blocks_of_1_bytes_each_for_a_total_of_2_bytes,
scsiInfo.Blocks, scsiInfo.BlockSize, totalSize)
}; };
} }
@@ -344,29 +346,29 @@ public sealed class MediaInfoViewModel : ViewModelBase
set => this.RaiseAndSetIfChanged(ref _blurayInfo, value); set => this.RaiseAndSetIfChanged(ref _blurayInfo, value);
} }
public string MediaInformationLabel => "Media information"; public string MediaInformationLabel => UI.Title_Media_information;
public string GeneralLabel => "General"; public string GeneralLabel => UI.Title_General;
public string MediaTypeLabel => "Media type"; public string MediaTypeLabel => UI.Title_Media_type;
public string MediaSerialNumberLabel => "Media serial number"; public string MediaSerialNumberLabel => UI.Title_Media_serial_number;
public string SaveReadMediaSerialLabel => "Save READ MEDIA SERIAL NUMBER response"; public string SaveReadMediaSerialLabel => UI.ButtonLabel_Save_READ_MEDIA_SERIAL_NUMBER_response;
public string SaveReadCapacityLabel => "Save READ CAPACITY response"; public string SaveReadCapacityLabel => UI.ButtonLabel_Save_READ_CAPACITY_response;
public string SaveReadCapacity16Label => "Save READ CAPACITY (16) response"; public string SaveReadCapacity16Label => UI.ButtonLabel_Save_READ_CAPACITY_16_response;
public string MMCLabel => "MMC"; public string MMCLabel => Localization.Core.Title_MMC;
public string SaveGetConfigurationLabel => "Save GET CONFIGURATION response"; public string SaveGetConfigurationLabel => UI.ButtonLabel_Save_GET_CONFIGURATION_response;
public string SaveRecognizedFormatLayersLabel => "Save RECOGNIZED FORMAT LAYERS response"; public string SaveRecognizedFormatLayersLabel => UI.ButtonLabel_Save_RECOGNIZED_FORMAT_LAYERS_response;
public string SaveWriteProtectionStatusLabel => "Save WRITE PROTECTION STATUS response"; public string SaveWriteProtectionStatusLabel => UI.ButtonLabel_Save_WRITE_PROTECTION_STATUS_response;
public string SSCLabel => "SSC"; public string SSCLabel => Localization.Core.Title_SSC;
public string DensitySupportLabel => "Densities supported by currently inserted media"; public string DensitySupportLabel => UI.Densities_supported_by_currently_inserted_media;
public string MediumSupportLabel => "Medium types currently inserted in device"; public string MediumSupportLabel => UI.Medium_types_currently_inserted_in_device;
public string SaveDensitySupportLabel => "Save REPORT DENSITY SUPPORT (MEDIA) response"; public string SaveDensitySupportLabel => UI.ButtonLabel_Save_REPORT_DENSITY_SUPPORT_MEDIA_response;
public string SaveMediumSupportLabel => "Save REPORT DENSITY SUPPORT (MEDIUM & MEDIA) response"; public string SaveMediumSupportLabel => UI.ButtonLabel_Save_REPORT_DENSITY_SUPPORT_MEDIUM_MEDIA_response;
public string CompactDiscLabel => "CompactDisc"; public string CompactDiscLabel => Localization.Core.Title_CompactDisc;
public string DVDLabel => "DVD"; public string DVDLabel => Localization.Core.Title_DVD;
public string DVD_R_WLabel => "DVD±R(W)"; public string DVD_R_WLabel => Localization.Core.Title_DVD_Plus_Dash_R_W;
public string XboxLabel => "Xbox"; public string XboxLabel => Localization.Core.Title_Xbox;
public string BluRayLabel => "Blu-ray"; public string BluRayLabel => Localization.Core.Title_Blu_ray;
public string DumpLabel => "Dump media to image"; public string DumpLabel => UI.ButtonLabel_Dump_media_to_image;
public string ScanLabel => "Scan media surface"; public string ScanLabel => UI.ButtonLabel_Scan_media_surface;
async Task SaveElement(byte[] data) async Task SaveElement(byte[] data)
{ {
@@ -378,7 +380,7 @@ public sealed class MediaInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -414,15 +416,17 @@ public sealed class MediaInfoViewModel : ViewModelBase
{ {
case CommonTypes.MediaType.GDR or CommonTypes.MediaType.GDROM: case CommonTypes.MediaType.GDR or CommonTypes.MediaType.GDROM:
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", "GD-ROM dump support is not yet implemented.", ButtonEnum.Ok, GetMessageBoxStandardWindow(UI.Title_Error,
Icon.Error).ShowDialog(_view); Localization.Core.GD_ROM_dump_support_is_not_yet_implemented,
ButtonEnum.Ok, Icon.Error).ShowDialog(_view);
return; return;
case CommonTypes.MediaType.XGD or CommonTypes.MediaType.XGD2 or CommonTypes.MediaType.XGD3 case CommonTypes.MediaType.XGD or CommonTypes.MediaType.XGD2 or CommonTypes.MediaType.XGD3
when _scsiInfo.DeviceInfo.ScsiInquiry?.KreonPresent != true: when _scsiInfo.DeviceInfo.ScsiInquiry?.KreonPresent != true:
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", "Dumping Xbox discs require a Kreon drive.", ButtonEnum.Ok, GetMessageBoxStandardWindow(UI.Title_Error,
Icon.Error).ShowDialog(_view); Localization.Core.Dumping_Xbox_discs_require_a_Kreon_drive,
ButtonEnum.Ok, Icon.Error).ShowDialog(_view);
return; return;
} }
@@ -443,8 +447,9 @@ public sealed class MediaInfoViewModel : ViewModelBase
case CommonTypes.MediaType.GDR: case CommonTypes.MediaType.GDR:
case CommonTypes.MediaType.GDROM: case CommonTypes.MediaType.GDROM:
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", "GD-ROM scan support is not yet implemented.", ButtonEnum.Ok, GetMessageBoxStandardWindow(UI.Title_Error,
Icon.Error).ShowDialog(_view); Localization.Core.GD_ROM_scan_support_is_not_yet_implemented,
ButtonEnum.Ok, Icon.Error).ShowDialog(_view);
return; return;
@@ -453,8 +458,9 @@ public sealed class MediaInfoViewModel : ViewModelBase
case CommonTypes.MediaType.XGD2: case CommonTypes.MediaType.XGD2:
case CommonTypes.MediaType.XGD3: case CommonTypes.MediaType.XGD3:
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", "Scanning Xbox discs is not yet supported.", ButtonEnum.Ok, GetMessageBoxStandardWindow(UI.Title_Error,
Icon.Error).ShowDialog(_view); Localization.Core.Scanning_Xbox_discs_is_not_yet_supported,
ButtonEnum.Ok, Icon.Error).ShowDialog(_view);
return; return;
} }

View File

@@ -38,11 +38,14 @@ public sealed class PartitionViewModel
{ {
public PartitionViewModel(Partition partition) public PartitionViewModel(Partition partition)
{ {
NameText = $"Partition name: {partition.Name}"; NameText = string.Format(Localization.Core.Partition_name_0, partition.Name);
TypeText = $"Partition type: {partition.Type}"; TypeText = string.Format(Localization.Core.Partition_type_0, partition.Type);
StartText = $"Partition start: sector {partition.Start}, byte {partition.Offset}"; StartText = string.Format(Localization.Core.Partition_start_sector_0_byte_1, partition.Start, partition.Offset);
LengthText = $"Partition length: {partition.Length} sectors, {partition.Size} bytes";
DescriptionLabelText = "Partition description:"; LengthText = string.Format(Localization.Core.Partition_length_0_sectors_1_bytes, partition.Length,
partition.Size);
DescriptionLabelText = Localization.Core.Title_Partition_description;
DescriptionText = partition.Description; DescriptionText = partition.Description;
} }

View File

@@ -43,6 +43,7 @@ using Aaru.CommonTypes.Structs;
using Aaru.Console; using Aaru.Console;
using Aaru.Core; using Aaru.Core;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using JetBrains.Annotations; using JetBrains.Annotations;
using MessageBox.Avalonia; using MessageBox.Avalonia;
@@ -69,10 +70,11 @@ public sealed class SubdirectoryViewModel
if(errno != ErrorNumber.NoError) if(errno != ErrorNumber.NoError)
{ {
MessageBoxManager. MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error,
GetMessageBoxStandardWindow("Error", string.
$"Error {errno} trying to read \"{model.Path}\" of chosen filesystem", Format(UI.Error_0_trying_to_read_1_of_chosen_filesystem,
ButtonEnum.Ok, Icon.Error).ShowDialog(view); errno, model.Path), ButtonEnum.Ok, Icon.Error).
ShowDialog(view);
return; return;
} }
@@ -83,8 +85,9 @@ public sealed class SubdirectoryViewModel
if(errno != ErrorNumber.NoError) if(errno != ErrorNumber.NoError)
{ {
AaruConsole.ErrorWriteLine($"Error {errno} trying to get information about filesystem entry named { AaruConsole.
dirent}"); ErrorWriteLine(string.Format(UI.Error_0_trying_to_get_information_about_filesystem_entry_named_1,
errno, dirent));
continue; continue;
} }
@@ -114,20 +117,20 @@ public sealed class SubdirectoryViewModel
public List<FileModel> SelectedEntries { get; } public List<FileModel> SelectedEntries { get; }
public ReactiveCommand<Unit, Task> ExtractFilesCommand { get; } public ReactiveCommand<Unit, Task> ExtractFilesCommand { get; }
public string ExtractFilesLabel => "Extract to..."; public string ExtractFilesLabel => UI.ButtonLabel_Extract_to;
public string NameLabel => "Name"; public string NameLabel => UI.Title_Name;
public string LengthLabel => "Length"; public string LengthLabel => UI.Title_Length;
public string CreationLabel => "Creation"; public string CreationLabel => UI.Title_Creation;
public string LastAccessLabel => "Last access"; public string LastAccessLabel => UI.Title_Last_access;
public string ChangedLabel => "Changed"; public string ChangedLabel => UI.Title_Changed;
public string LastBackupLabel => "Last backup"; public string LastBackupLabel => UI.Title_Last_backup;
public string LastWriteLabel => "Last write"; public string LastWriteLabel => UI.Title_Last_write;
public string AttributesLabel => "Attributes"; public string AttributesLabel => UI.Title_Attributes;
public string GIDLabel => "GID"; public string GIDLabel => UI.Title_GID;
public string UIDLabel => "UID"; public string UIDLabel => UI.Title_UID;
public string InodeLabel => "Inode"; public string InodeLabel => UI.Title_Inode;
public string LinksLabel => "Links"; public string LinksLabel => UI.Title_Links;
public string ModeLabel => "Mode"; public string ModeLabel => UI.Title_Mode;
async Task ExecuteExtractFilesCommand() async Task ExecuteExtractFilesCommand()
{ {
@@ -136,7 +139,7 @@ public sealed class SubdirectoryViewModel
var saveFilesFolderDialog = new OpenFolderDialog var saveFilesFolderDialog = new OpenFolderDialog
{ {
Title = "Choose destination folder..." Title = UI.Dialog_Choose_destination_folder
}; };
string result = await saveFilesFolderDialog.ShowAsync(_view); string result = await saveFilesFolderDialog.ShowAsync(_view);
@@ -261,10 +264,13 @@ public sealed class SubdirectoryViewModel
string corrected = new(chars); string corrected = new(chars);
mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow("Unsupported filename", mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow(UI.Unsupported_filename,
$"The file name {filename string.
} is not supported on this platform.\nDo you want to rename it to {corrected Format(UI.Filename_0_not_supported_want_to_rename_to_1,
}?", ButtonEnum.YesNoCancel, Icon.Warning).ShowDialog(_view); filename,
corrected), ButtonEnum.YesNoCancel,
Icon.Warning).
ShowDialog(_view);
switch(mboxResult) switch(mboxResult)
{ {
@@ -281,9 +287,8 @@ public sealed class SubdirectoryViewModel
if(File.Exists(outputPath)) if(File.Exists(outputPath))
{ {
mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow("Existing file", mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow(UI.Existing_file,
$"A file named {filename string.Format(UI.File_named_0_exists_overwrite_Q, filename),
} already exists on the destination folder.\nDo you want to overwrite it?",
ButtonEnum.YesNoCancel, Icon.Warning).ShowDialog(_view); ButtonEnum.YesNoCancel, Icon.Warning).ShowDialog(_view);
switch(mboxResult) switch(mboxResult)
@@ -297,9 +302,9 @@ public sealed class SubdirectoryViewModel
} }
catch(IOException) catch(IOException)
{ {
mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow("Cannot delete", mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow(UI.Cannot_delete,
"Could not delete existing file.\nDo you want to continue?", UI.Could_note_delete_existe_file_continue_Q, ButtonEnum.YesNo,
ButtonEnum.YesNo, Icon.Error).ShowDialog(_view); Icon.Error).ShowDialog(_view);
if(mboxResult == ButtonResult.No) if(mboxResult == ButtonResult.No)
return; return;
@@ -317,8 +322,8 @@ public sealed class SubdirectoryViewModel
if(error != ErrorNumber.NoError) if(error != ErrorNumber.NoError)
{ {
mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow("Error reading file", mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow(UI.Error_reading_file,
$"Error {error} reading file.\nDo you want to continue?", ButtonEnum.YesNo, string.Format(UI.Error_0_reading_file_continue_Q, error), ButtonEnum.YesNo,
Icon.Error).ShowDialog(_view); Icon.Error).ShowDialog(_view);
if(mboxResult == ButtonResult.No) if(mboxResult == ButtonResult.No)
@@ -366,9 +371,10 @@ public sealed class SubdirectoryViewModel
} }
catch(IOException) catch(IOException)
{ {
mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow("Cannot create file", mboxResult = await MessageBoxManager.GetMessageBoxStandardWindow(UI.Cannot_create_file,
"Could not create destination file.\nDo you want to continue?", ButtonEnum.YesNo, UI.Could_not_create_destination_file_continue_Q,
Icon.Error).ShowDialog(_view); ButtonEnum.YesNo, Icon.Error).
ShowDialog(_view);
if(mboxResult == ButtonResult.No) if(mboxResult == ButtonResult.No)
return; return;

View File

@@ -35,6 +35,7 @@ using System.IO;
using System.Reactive; using System.Reactive;
using System.Threading.Tasks; using System.Threading.Tasks;
using Aaru.Decoders.ATA; using Aaru.Decoders.ATA;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -71,12 +72,13 @@ public sealed class AtaInfoViewModel : ViewModelBase
{ {
AtaMcptText = (ataMcptError.Value.DeviceHead & 0x7) switch AtaMcptText = (ataMcptError.Value.DeviceHead & 0x7) switch
{ {
0 => "Device reports incorrect media card type", 0 => Localization.Core.Device_reports_incorrect_media_card_type,
1 => "Device contains a Secure Digital card", 1 => Localization.Core.Device_contains_SD_card,
2 => "Device contains a MultiMediaCard ", 2 => Localization.Core.Device_contains_MMC,
3 => "Device contains a Secure Digital I/O card", 3 => Localization.Core.Device_contains_SDIO_card,
4 => "Device contains a Smart Media card", 4 => Localization.Core.Device_contains_SM_card,
_ => $"Device contains unknown media card type {ataMcptError.Value.DeviceHead & 0x07}" _ => string.Format(Localization.Core.Device_contains_unknown_media_card_type_0,
ataMcptError.Value.DeviceHead & 0x07)
}; };
AtaMcptWriteProtectionChecked = (ataMcptError.Value.DeviceHead & 0x08) == 0x08; AtaMcptWriteProtectionChecked = (ataMcptError.Value.DeviceHead & 0x08) == 0x08;
@@ -84,7 +86,7 @@ public sealed class AtaInfoViewModel : ViewModelBase
ushort specificData = ushort specificData =
(ushort)((ataMcptError.Value.CylinderHigh * 0x100) + ataMcptError.Value.CylinderLow); (ushort)((ataMcptError.Value.CylinderHigh * 0x100) + ataMcptError.Value.CylinderLow);
AtaMcptSpecificDataText = $"Card specific data: 0x{specificData:X4}"; AtaMcptSpecificDataText = string.Format(Localization.Core.Card_specific_data_0, specificData);
} }
AtaIdentifyText = Identify.Prettify(_ata); AtaIdentifyText = Identify.Prettify(_ata);
@@ -107,10 +109,10 @@ public sealed class AtaInfoViewModel : ViewModelBase
public string AtaOrAtapiText { get; } public string AtaOrAtapiText { get; }
public string AtaMcptLabel => "Device is Media Card Pass Through"; public string AtaMcptLabel => Localization.Core.Device_supports_MCPT_Command_Set;
public string AtaMcptWriteProtectionLabel => "Media card is write protected"; public string AtaMcptWriteProtectionLabel => Localization.Core.Media_card_is_write_protected;
public string SaveAtaBinaryLabel => "Save binary to file"; public string SaveAtaBinaryLabel => UI.ButtonLabel_Save_binary_to_file;
public string SaveAtaTextLabel => "Save text to file"; public string SaveAtaTextLabel => UI.ButtonLabel_Save_text_to_file;
async Task ExecuteSaveAtaBinaryCommand() async Task ExecuteSaveAtaBinaryCommand()
{ {
@@ -122,7 +124,7 @@ public sealed class AtaInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -150,7 +152,7 @@ public sealed class AtaInfoViewModel : ViewModelBase
{ {
"*.txt" "*.txt"
}), }),
Name = "Text" Name = UI.Dialog_Text_files
}); });
string result = await dlgSaveText.ShowAsync(_view); string result = await dlgSaveText.ShowAsync(_view);

View File

@@ -36,6 +36,7 @@ using System.Reactive;
using System.Threading.Tasks; using System.Threading.Tasks;
using Aaru.Decoders.Bluray; using Aaru.Decoders.Bluray;
using Aaru.Decoders.SCSI.MMC; using Aaru.Decoders.SCSI.MMC;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -155,22 +156,22 @@ public sealed class BlurayInfoViewModel
public bool SaveBlurayRawDflVisible { get; } public bool SaveBlurayRawDflVisible { get; }
public bool SaveBlurayPacVisible { get; } public bool SaveBlurayPacVisible { get; }
public string DiscinformationLabel => "Disc information"; public string DiscinformationLabel => UI.Disc_information;
public string BurstCuttingAreaLabel => "Burst Cutting Area"; public string BurstCuttingAreaLabel => UI.Burst_Cutting_Area;
public string DiscDefinitionStructureLabel => "Disc Definition Structure"; public string DiscDefinitionStructureLabel => UI.Disc_Definition_Structure;
public string CartridgeStatusLabel => "Cartridge Status"; public string CartridgeStatusLabel => UI.Cartridge_Status;
public string SpareAreaInformationLabel => "Spare Area Information"; public string SpareAreaInformationLabel => UI.Spare_Area_Information;
public string PseudoOverWriteResourcesLabel => "Pseudo-OverWrite Resources"; public string PseudoOverWriteResourcesLabel => UI.Pseudo_OverWrite_Resources;
public string TrackResourcesLabel => "Track Resources"; public string TrackResourcesLabel => UI.Track_Resources;
public string SaveBlurayDiscInformationLabel => "Save Disc Information"; public string SaveBlurayDiscInformationLabel => UI.ButtonLabel_Save_Disc_Information;
public string SaveBlurayBurstCuttingAreaLabel => "Save Burst Cutting Area"; public string SaveBlurayBurstCuttingAreaLabel => UI.ButtonLabel_Save_Burst_Cutting_Area;
public string SaveBlurayDdsLabel => "Save Disc Definition Structure"; public string SaveBlurayDdsLabel => UI.ButtonLabel_Save_Disc_Definition_Structure;
public string SaveBlurayCartridgeStatusLabel => "Save Spare Area Information"; public string SaveBlurayCartridgeStatusLabel => UI.ButtonLabel_Save_Cartridge_Status;
public string SaveBluraySpareAreaInformationLabel => "Save Spare Area Information"; public string SaveBluraySpareAreaInformationLabel => UI.ButtonLabel_Save_Spare_Area_Information;
public string SaveBlurayPowResourcesLabel => "Save Pseudo-OverWrite Resources"; public string SaveBlurayPowResourcesLabel => UI.ButtonLabel_Save_Pseudo_OverWrite_Resources;
public string SaveBlurayTrackResourcesLabel => "Save Track Resources"; public string SaveBlurayTrackResourcesLabel => UI.ButtonLabel_Save_Track_Resources;
public string SaveBlurayRawDflLabel => "Save raw DFL"; public string SaveBlurayRawDflLabel => UI.ButtonLabel_Save_raw_DFL;
public string SaveBlurayPacLabel => "Save PAC"; public string SaveBlurayPacLabel => UI.ButtonLabel_Save_PAC;
async Task SaveElement(byte[] data) async Task SaveElement(byte[] data)
{ {
@@ -182,7 +183,7 @@ public sealed class BlurayInfoViewModel
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);

View File

@@ -38,6 +38,7 @@ using System.Threading.Tasks;
using Aaru.Decoders.CD; using Aaru.Decoders.CD;
using Aaru.Decoders.SCSI.MMC; using Aaru.Decoders.SCSI.MMC;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using ReactiveUI; using ReactiveUI;
@@ -129,24 +130,24 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
public ReactiveCommand<Unit, Task> SaveCdPmaCommand { get; } public ReactiveCommand<Unit, Task> SaveCdPmaCommand { get; }
public ObservableCollection<IsrcModel> IsrcList { get; } public ObservableCollection<IsrcModel> IsrcList { get; }
public string CdInformationLabel => "Information"; public string CdInformationLabel => UI.Title_Information;
public string SaveCdInformationLabel => "Save READ DISC INFORMATION response"; public string SaveCdInformationLabel => UI.ButtonLabel_Save_READ_DISC_INFORMATION_response;
public string CdTocLabel => "TOC"; public string CdTocLabel => UI.Title_TOC;
public string SaveCdTocLabel => "Save READ TOC response"; public string SaveCdTocLabel => UI.ButtonLabel_Save_READ_TOC_response;
public string CdFullTocLabel => "TOC (full)"; public string CdFullTocLabel => UI.Title_TOC_full;
public string SaveCdFullTocLabel => "Save READ RAW TOC response"; public string SaveCdFullTocLabel => UI.ButtonLabel_Save_READ_RAW_TOC_response;
public string CdSessionLabel => "Session"; public string CdSessionLabel => Localization.Core.Title_Session;
public string SaveCdSessionLabel => "Save READ SESSION response"; public string SaveCdSessionLabel => UI.ButtonLabel_Save_READ_SESSION_response;
public string CdTextLabel => "CD-TEXT"; public string CdTextLabel => UI.Title_CD_TEXT;
public string SaveCdTextLabel => "Save Lead-In CD-TEXT"; public string SaveCdTextLabel => UI.ButtonLabel_Save_Lead_In_CD_TEXT;
public string CdAtipLabel => "ATIP"; public string CdAtipLabel => UI.Title_ATIP;
public string SaveCdAtipLabel => "Save READ ATIP response"; public string SaveCdAtipLabel => UI.ButtonLabel_Save_READ_ATIP_response;
public string MiscellaneousLabel => "Miscellaneous"; public string MiscellaneousLabel => UI.Title_Miscellaneous;
public string McnLabel => "Media catalog number"; public string McnLabel => UI.Title_Media_catalog_number;
public string ISRCsLabel => "ISRCs"; public string ISRCsLabel => UI.Title_ISRCs;
public string TrackLabel => "Track"; public string TrackLabel => Localization.Core.Title_Track;
public string ISRCLabel => "ISRC"; public string ISRCLabel => UI.Title_ISRC;
public string SaveCdPmaLabel => "Save READ PMA response"; public string SaveCdPmaLabel => UI.ButtonLabel_Save_READ_PMA_response;
async Task ExecuteSaveCdInformationCommand() async Task ExecuteSaveCdInformationCommand()
{ {
@@ -158,7 +159,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -182,7 +183,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -206,7 +207,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -230,7 +231,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -254,7 +255,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -278,7 +279,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -302,7 +303,7 @@ public sealed class CompactDiscInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);

View File

@@ -36,6 +36,7 @@ using System.Reactive;
using System.Threading.Tasks; using System.Threading.Tasks;
using Aaru.CommonTypes; using Aaru.CommonTypes;
using Aaru.Decoders.DVD; using Aaru.Decoders.DVD;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -118,12 +119,12 @@ public sealed class DvdInfoViewModel
public bool SaveDvdBcaVisible { get; } public bool SaveDvdBcaVisible { get; }
public bool SaveDvdAacsVisible { get; } public bool SaveDvdAacsVisible { get; }
public string SaveDvdPfiLabel => "Save Physical Format Information"; public string SaveDvdPfiLabel => UI.ButtonLabel_Save_Physical_Format_Information;
public string SaveDvdDmiLabel => "Save Disc Manufacturer Information"; public string SaveDvdDmiLabel => UI.ButtonLabel_Save_Disc_Manufacturer_Information;
public string SaveDvdCmiLabel => "Save Copyright Management Information"; public string SaveDvdCmiLabel => UI.ButtonLabel_Save_Copyright_Management_Information;
public string SaveHdDvdCmiLabel => "Save Copyright Management Information"; public string SaveHdDvdCmiLabel => UI.ButtonLabel_Save_Copyright_Management_Information;
public string SaveDvdBcaLabel => "Save Burst Cutting Area"; public string SaveDvdBcaLabel => UI.ButtonLabel_Save_Burst_Cutting_Area;
public string SaveDvdAacsLabel => "Save AACS Information"; public string SaveDvdAacsLabel => UI.ButtonLabel_Save_AACS_Information;
async Task SaveElement(byte[] data) async Task SaveElement(byte[] data)
{ {
@@ -135,7 +136,7 @@ public sealed class DvdInfoViewModel
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);

View File

@@ -36,6 +36,7 @@ using System.Reactive;
using System.Threading.Tasks; using System.Threading.Tasks;
using Aaru.CommonTypes; using Aaru.CommonTypes;
using Aaru.Decoders.DVD; using Aaru.Decoders.DVD;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using ReactiveUI; using ReactiveUI;
@@ -233,25 +234,25 @@ public sealed class DvdWritableInfoViewModel
public ReactiveCommand<Unit, Task> SaveDvdPlusAdipCommand { get; } public ReactiveCommand<Unit, Task> SaveDvdPlusAdipCommand { get; }
public ReactiveCommand<Unit, Task> SaveDvdPlusDcbCommand { get; } public ReactiveCommand<Unit, Task> SaveDvdPlusDcbCommand { get; }
public string DvdRamDdsLabel => "Disc Definition Structure"; public string DvdRamDdsLabel => UI.Disc_Definition_Structure;
public string DvdRamCartridgeStatusLabel => "Cartridge Status"; public string DvdRamCartridgeStatusLabel => UI.Cartridge_Status;
public string DvdRamSpareAreaInformationLabel => "Spare Area Information"; public string DvdRamSpareAreaInformationLabel => UI.Spare_Area_Information;
public string SaveDvdRamDdsLabel => "Save Disc Definition Structure"; public string SaveDvdRamDdsLabel => UI.ButtonLabel_Save_Disc_Definition_Structure;
public string SaveDvdRamCartridgeStatusLabel => "Save Cartridge Status"; public string SaveDvdRamCartridgeStatusLabel => UI.ButtonLabel_Save_Cartridge_Status;
public string SaveDvdRamSpareAreaInformationLabel => "Save Spare Area Information"; public string SaveDvdRamSpareAreaInformationLabel => UI.ButtonLabel_Save_Spare_Area_Information;
public string SaveLastBorderOutRmdLabel => "Save Last Border-Out RMD"; public string SaveLastBorderOutRmdLabel => UI.ButtonLabel_Save_Last_Border_Out_RMD;
public string SaveDvdPreRecordedInfoLabel => "Save Pre-Recorded Physical Information"; public string SaveDvdPreRecordedInfoLabel => UI.ButtonLabel_Save_Pre_Recorded_Physical_Information;
public string SaveDvdrMediaIdentifierLabel => "Save Media Identifier"; public string SaveDvdrMediaIdentifierLabel => UI.ButtonLabel_Save_Media_Identifier;
public string SaveDvdrPhysicalInformationLabel => "Save Recordable Physical Information"; public string SaveDvdrPhysicalInformationLabel => UI.ButtonLabel_Save_Recordable_Physical_Information;
public string SaveHddvdrMediumStatusLabel => "Save Medium Status"; public string SaveHddvdrMediumStatusLabel => UI.ButtonLabel_Save_Medium_Status;
public string SaveHddvdrLastRmdLabel => "Save Last Border-Out RMD"; public string SaveHddvdrLastRmdLabel => UI.ButtonLabel_Save_Last_Border_Out_RMD;
public string SaveDvdrLayerCapacityLabel => "Save Layer Capacity"; public string SaveDvdrLayerCapacityLabel => UI.ButtonLabel_Save_Layer_Capacity;
public string SaveDvdrDlMiddleZoneStartLabel => "Save Middle Zone Start"; public string SaveDvdrDlMiddleZoneStartLabel => UI.ButtonLabel_Save_Middle_Zone_Start;
public string SaveDvdrDlJumpIntervalSizeLabel => "Save Jump Interval Size"; public string SaveDvdrDlJumpIntervalSizeLabel => UI.ButtonLabel_Save_Jump_Interval_Size;
public string SaveDvdrDlManualLayerJumpStartLbaLabel => "Save Manual Layer Jump Start LBA"; public string SaveDvdrDlManualLayerJumpStartLbaLabel => UI.ButtonLabel_Save_Manual_Layer_Jump_Start_LBA;
public string SaveDvdrDlRemapAnchorPointLabel => "Save Remap Anchor Point"; public string SaveDvdrDlRemapAnchorPointLabel => UI.ButtonLabel_Save_Remap_Anchor_Point;
public string SaveDvdPlusAdipLabel => "Save ADIP"; public string SaveDvdPlusAdipLabel => UI.ButtonLabel_Save_ADIP;
public string SaveDvdPlusDcbLabel => "Save Disc Control Blocks"; public string SaveDvdPlusDcbLabel => UI.ButtonLabel_Save_Disc_Control_Blocks;
async Task SaveElement(byte[] data) async Task SaveElement(byte[] data)
{ {
@@ -263,7 +264,7 @@ public sealed class DvdWritableInfoViewModel
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);

View File

@@ -38,6 +38,7 @@ using System.Threading.Tasks;
using Aaru.Console; using Aaru.Console;
using Aaru.Decoders.PCMCIA; using Aaru.Decoders.PCMCIA;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -76,17 +77,17 @@ public class PcmciaInfoViewModel : ViewModelBase
case TupleCodes.CISTPL_END: continue; case TupleCodes.CISTPL_END: continue;
case TupleCodes.CISTPL_DEVICEGEO: case TupleCodes.CISTPL_DEVICEGEO:
case TupleCodes.CISTPL_DEVICEGEO_A: case TupleCodes.CISTPL_DEVICEGEO_A:
tupleCode = "Device Geometry Tuples"; tupleCode = UI.Device_Geometry_Tuples;
tupleDescription = CIS.PrettifyDeviceGeometryTuple(tuple); tupleDescription = CIS.PrettifyDeviceGeometryTuple(tuple);
break; break;
case TupleCodes.CISTPL_MANFID: case TupleCodes.CISTPL_MANFID:
tupleCode = "Manufacturer Identification Tuple"; tupleCode = UI.Manufacturer_Identification_Tuple;
tupleDescription = CIS.PrettifyManufacturerIdentificationTuple(tuple); tupleDescription = CIS.PrettifyManufacturerIdentificationTuple(tuple);
break; break;
case TupleCodes.CISTPL_VERS_1: case TupleCodes.CISTPL_VERS_1:
tupleCode = "Level 1 Version / Product Information Tuple"; tupleCode = UI.Level_1_Version_Product_Information_Tuple;
tupleDescription = CIS.PrettifyLevel1VersionTuple(tuple); tupleDescription = CIS.PrettifyLevel1VersionTuple(tuple);
break; break;
@@ -124,13 +125,13 @@ public class PcmciaInfoViewModel : ViewModelBase
case TupleCodes.CISTPL_SPCL: case TupleCodes.CISTPL_SPCL:
case TupleCodes.CISTPL_SWIL: case TupleCodes.CISTPL_SWIL:
case TupleCodes.CISTPL_VERS_2: case TupleCodes.CISTPL_VERS_2:
tupleCode = $"Undecoded tuple ID {tuple.Code}"; tupleCode = string.Format(UI.Undecoded_tuple_ID_0, tuple.Code);
tupleDescription = $"Undecoded tuple ID {tuple.Code}"; tupleDescription = string.Format(UI.Undecoded_tuple_ID_0, tuple.Code);
break; break;
default: default:
tupleCode = $"0x{(byte)tuple.Code:X2}"; tupleCode = $"0x{(byte)tuple.Code:X2}";
tupleDescription = $"Found unknown tuple ID 0x{(byte)tuple.Code:X2}"; tupleDescription = string.Format(UI.Found_unknown_tuple_ID_0, (byte)tuple.Code);
break; break;
} }
@@ -142,11 +143,11 @@ public class PcmciaInfoViewModel : ViewModelBase
}); });
} }
else else
AaruConsole.DebugWriteLine("Device-Info command", "PCMCIA CIS returned no tuples"); AaruConsole.DebugWriteLine("Device-Info command", UI.PCMCIA_CIS_returned_no_tuples);
} }
public string CisLabel => "CIS"; public string CisLabel => UI.Title_CIS;
public string SavePcmciaCisLabel => "Save PCMCIA CIS to file"; public string SavePcmciaCisLabel => UI.ButtonLabel_Save_PCMCIA_CIS_to_file;
public ObservableCollection<PcmciaCisModel> CisList { get; } public ObservableCollection<PcmciaCisModel> CisList { get; }
@@ -181,7 +182,7 @@ public class PcmciaInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);

View File

@@ -42,6 +42,7 @@ using Aaru.Decoders.SCSI;
using Aaru.Decoders.SCSI.MMC; using Aaru.Decoders.SCSI.MMC;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Helpers; using Aaru.Helpers;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using ReactiveUI; using ReactiveUI;
using Inquiry = Aaru.CommonTypes.Structs.Devices.SCSI.Inquiry; using Inquiry = Aaru.CommonTypes.Structs.Devices.SCSI.Inquiry;
@@ -90,15 +91,15 @@ public sealed class ScsiInfoViewModel : ViewModelBase
{ {
ModeSensePages.Add(new ScsiPageModel ModeSensePages.Add(new ScsiPageModel
{ {
Page = "Header", Page = UI.Title_Header,
Description = Modes.PrettifyModeHeader(scsiMode.Value.Header, scsiType) Description = Modes.PrettifyModeHeader(scsiMode.Value.Header, scsiType)
}); });
if(scsiMode.Value.Pages != null) if(scsiMode.Value.Pages != null)
foreach(Modes.ModePage page in scsiMode.Value.Pages.OrderBy(t => t.Page).ThenBy(t => t.Subpage)) foreach(Modes.ModePage page in scsiMode.Value.Pages.OrderBy(t => t.Page).ThenBy(t => t.Subpage))
{ {
string pageNumberText = page.Subpage == 0 ? $"MODE {page.Page:X2}h" string pageNumberText = page.Subpage == 0 ? string.Format(UI.MODE_0, page.Page)
: $"MODE {page.Page:X2} Subpage {page.Subpage:X2}"; : string.Format(UI.MODE_0_Subpage_1, page.Page, page.Subpage);
string decodedText; string decodedText;
@@ -110,7 +111,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
page.Subpage == 0) page.Subpage == 0)
decodedText = Modes.PrettifyModePage_00_SFF(page.PageResponse); decodedText = Modes.PrettifyModePage_00_SFF(page.PageResponse);
else else
decodedText = "Undecoded"; decodedText = UI.Undecoded;
break; break;
} }
@@ -358,7 +359,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
case 0x30: case 0x30:
{ {
if(Modes.IsAppleModePage_30(page.PageResponse)) if(Modes.IsAppleModePage_30(page.PageResponse))
decodedText = "Drive identifies as Apple OEM drive"; decodedText = Localization.Core.Drive_identifies_as_Apple_OEM_drive;
else else
goto default; goto default;
@@ -406,14 +407,14 @@ public sealed class ScsiInfoViewModel : ViewModelBase
} }
default: default:
{ {
decodedText = "Undecoded"; decodedText = UI.Undecoded;
break; break;
} }
} }
// TODO: Automatic error reporting // TODO: Automatic error reporting
decodedText ??= "Error decoding page, please open an issue."; decodedText ??= UI.Error_decoding_page_please_open_an_issue;
ModeSensePages.Add(new ScsiPageModel ModeSensePages.Add(new ScsiPageModel
{ {
@@ -432,103 +433,103 @@ public sealed class ScsiInfoViewModel : ViewModelBase
switch(page.Key) switch(page.Key)
{ {
case >= 0x01 and <= 0x7F: case >= 0x01 and <= 0x7F:
evpdPageTitle = $"ASCII Page {page.Key:X2}h"; evpdPageTitle = string.Format(UI.ASCII_Page_0, page.Key);
evpdDecodedPage = EVPD.DecodeASCIIPage(page.Value); evpdDecodedPage = EVPD.DecodeASCIIPage(page.Value);
break; break;
case 0x80: case 0x80:
evpdPageTitle = "Unit Serial Number"; evpdPageTitle = UI.Unit_Serial_Number;
evpdDecodedPage = EVPD.DecodePage80(page.Value); evpdDecodedPage = EVPD.DecodePage80(page.Value);
break; break;
case 0x81: case 0x81:
evpdPageTitle = "SCSI Implemented operating definitions"; evpdPageTitle = UI.SCSI_Implemented_operating_definitions;
evpdDecodedPage = EVPD.PrettifyPage_81(page.Value); evpdDecodedPage = EVPD.PrettifyPage_81(page.Value);
break; break;
case 0x82: case 0x82:
evpdPageTitle = "ASCII implemented operating definitions"; evpdPageTitle = UI.ASCII_implemented_operating_definitions;
evpdDecodedPage = EVPD.DecodePage82(page.Value); evpdDecodedPage = EVPD.DecodePage82(page.Value);
break; break;
case 0x83: case 0x83:
evpdPageTitle = "SCSI Device identification"; evpdPageTitle = UI.SCSI_Device_identification;
evpdDecodedPage = EVPD.PrettifyPage_83(page.Value); evpdDecodedPage = EVPD.PrettifyPage_83(page.Value);
break; break;
case 0x84: case 0x84:
evpdPageTitle = "SCSI Software Interface Identifiers"; evpdPageTitle = UI.SCSI_Software_Interface_Identifiers;
evpdDecodedPage = EVPD.PrettifyPage_84(page.Value); evpdDecodedPage = EVPD.PrettifyPage_84(page.Value);
break; break;
case 0x85: case 0x85:
evpdPageTitle = "SCSI Management Network Addresses"; evpdPageTitle = UI.SCSI_Management_Network_Addresses;
evpdDecodedPage = EVPD.PrettifyPage_85(page.Value); evpdDecodedPage = EVPD.PrettifyPage_85(page.Value);
break; break;
case 0x86: case 0x86:
evpdPageTitle = "SCSI Extended INQUIRY Data"; evpdPageTitle = UI.SCSI_Extended_INQUIRY_Data;
evpdDecodedPage = EVPD.PrettifyPage_86(page.Value); evpdDecodedPage = EVPD.PrettifyPage_86(page.Value);
break; break;
case 0x89: case 0x89:
evpdPageTitle = "SCSI to ATA Translation Layer Data"; evpdPageTitle = UI.SCSI_to_ATA_Translation_Layer_Data;
evpdDecodedPage = EVPD.PrettifyPage_89(page.Value); evpdDecodedPage = EVPD.PrettifyPage_89(page.Value);
break; break;
case 0xB0: case 0xB0:
evpdPageTitle = "SCSI Sequential-access Device Capabilities"; evpdPageTitle = UI.SCSI_Sequential_access_Device_Capabilities;
evpdDecodedPage = EVPD.PrettifyPage_B0(page.Value); evpdDecodedPage = EVPD.PrettifyPage_B0(page.Value);
break; break;
case 0xB1: case 0xB1:
evpdPageTitle = "Manufacturer-assigned Serial Number"; evpdPageTitle = UI.Manufacturer_assigned_Serial_Number;
evpdDecodedPage = EVPD.DecodePageB1(page.Value); evpdDecodedPage = EVPD.DecodePageB1(page.Value);
break; break;
case 0xB2: case 0xB2:
evpdPageTitle = "TapeAlert Supported Flags Bitmap"; evpdPageTitle = UI.TapeAlert_Supported_Flags_Bitmap;
evpdDecodedPage = $"0x{EVPD.DecodePageB2(page.Value):X16}"; evpdDecodedPage = $"0x{EVPD.DecodePageB2(page.Value):X16}";
break; break;
case 0xB3: case 0xB3:
evpdPageTitle = "Automation Device Serial Number"; evpdPageTitle = UI.Automation_Device_Serial_Number;
evpdDecodedPage = EVPD.DecodePageB3(page.Value); evpdDecodedPage = EVPD.DecodePageB3(page.Value);
break; break;
case 0xB4: case 0xB4:
evpdPageTitle = "Data Transfer Device Element Address"; evpdPageTitle = UI.Data_Transfer_Device_Element_Address;
evpdDecodedPage = EVPD.DecodePageB4(page.Value); evpdDecodedPage = EVPD.DecodePageB4(page.Value);
break; break;
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant(). case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
Trim() == "quantum": Trim() == "quantum":
evpdPageTitle = "Quantum Firmware Build Information page"; evpdPageTitle = UI.Quantum_Firmware_Build_Information_page;
evpdDecodedPage = EVPD.PrettifyPage_C0_Quantum(page.Value); evpdDecodedPage = EVPD.PrettifyPage_C0_Quantum(page.Value);
break; break;
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant(). case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
Trim() == "seagate": Trim() == "seagate":
evpdPageTitle = "Seagate Firmware Numbers page"; evpdPageTitle = UI.Seagate_Firmware_Numbers_page;
evpdDecodedPage = EVPD.PrettifyPage_C0_Seagate(page.Value); evpdDecodedPage = EVPD.PrettifyPage_C0_Seagate(page.Value);
break; break;
case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant(). case 0xC0 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
Trim() == "ibm": Trim() == "ibm":
evpdPageTitle = "IBM Drive Component Revision Levels page"; evpdPageTitle = UI.IBM_Drive_Component_Revision_Levels_page;
evpdDecodedPage = EVPD.PrettifyPage_C0_IBM(page.Value); evpdDecodedPage = EVPD.PrettifyPage_C0_IBM(page.Value);
break; break;
case 0xC1 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant(). case 0xC1 when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
Trim() == "ibm": Trim() == "ibm":
evpdPageTitle = "IBM Drive Serial Numbers page"; evpdPageTitle = UI.IBM_Drive_Serial_Numbers_page;
evpdDecodedPage = EVPD.PrettifyPage_C1_IBM(page.Value); evpdDecodedPage = EVPD.PrettifyPage_C1_IBM(page.Value);
break; break;
case 0xC0 or 0xC1 case 0xC0 or 0xC1
when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant(). when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
Trim() == "certance": Trim() == "certance":
evpdPageTitle = "Certance Drive Component Revision Levels page"; evpdPageTitle = UI.Certance_Drive_Component_Revision_Levels_page;
evpdDecodedPage = EVPD.PrettifyPage_C0_C1_Certance(page.Value); evpdDecodedPage = EVPD.PrettifyPage_C0_C1_Certance(page.Value);
break; break;
@@ -537,11 +538,11 @@ public sealed class ScsiInfoViewModel : ViewModelBase
Trim() == "certance": Trim() == "certance":
evpdPageTitle = page.Key switch evpdPageTitle = page.Key switch
{ {
0xC2 => "Head Assembly Serial Number", 0xC2 => UI.Head_Assembly_Serial_Number,
0xC3 => "Reel Motor 1 Serial Number", 0xC3 => UI.Reel_Motor_1_Serial_Number,
0xC4 => "Reel Motor 2 Serial Number", 0xC4 => UI.Reel_Motor_2_Serial_Number,
0xC5 => "Board Serial Number", 0xC5 => UI.Board_Serial_Number,
0xC6 => "Base Mechanical Serial Number", 0xC6 => UI.Base_Mechanical_Serial_Number,
_ => evpdPageTitle _ => evpdPageTitle
}; };
@@ -553,12 +554,12 @@ public sealed class ScsiInfoViewModel : ViewModelBase
Trim() == "hp": Trim() == "hp":
evpdPageTitle = page.Key switch evpdPageTitle = page.Key switch
{ {
0xC0 => "HP Drive Firmware Revision Levels page:", 0xC0 => UI.HP_Drive_Firmware_Revision_Levels_page,
0xC1 => "HP Drive Hardware Revision Levels page:", 0xC1 => UI.HP_Drive_Hardware_Revision_Levels_page,
0xC2 => "HP Drive PCA Revision Levels page:", 0xC2 => UI.HP_Drive_PCA_Revision_Levels_page,
0xC3 => "HP Drive Mechanism Revision Levels page:", 0xC3 => UI.HP_Drive_Mechanism_Revision_Levels_page,
0xC4 => "HP Drive Head Assembly Revision Levels page:", 0xC4 => UI.HP_Drive_Head_Assembly_Revision_Levels_page,
0xC5 => "HP Drive ACI Revision Levels page:", 0xC5 => UI.HP_Drive_ACI_Revision_Levels_page,
_ => evpdPageTitle _ => evpdPageTitle
}; };
@@ -567,7 +568,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
break; break;
case 0xDF when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant(). case 0xDF when StringHandlers.CToString(scsiInquiry.Value.VendorIdentification).ToLowerInvariant().
Trim() == "certance": Trim() == "certance":
evpdPageTitle = "Certance drive status page"; evpdPageTitle = UI.Certance_drive_status_page;
evpdDecodedPage = EVPD.PrettifyPage_DF_Certance(page.Value); evpdDecodedPage = EVPD.PrettifyPage_DF_Certance(page.Value);
break; break;
@@ -576,11 +577,11 @@ public sealed class ScsiInfoViewModel : ViewModelBase
if(page.Key == 0x00) if(page.Key == 0x00)
continue; continue;
evpdPageTitle = $"Page {page.Key:X2}h"; evpdPageTitle = string.Format(UI.Page_0_h, page.Key);
evpdDecodedPage = "Undecoded"; evpdDecodedPage = UI.Undecoded;
AaruConsole.DebugWriteLine("Device-Info command", "Found undecoded SCSI VPD page 0x{0:X2}", AaruConsole.DebugWriteLine("Device-Info command",
page.Key); Localization.Core.Found_undecoded_SCSI_VPD_page_0, page.Key);
break; break;
} }
@@ -599,16 +600,17 @@ public sealed class ScsiInfoViewModel : ViewModelBase
Features.SeparatedFeatures ftr = Features.Separate(_configuration); Features.SeparatedFeatures ftr = Features.Separate(_configuration);
AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION length is {0} bytes", ftr.DataLength); AaruConsole.DebugWriteLine("Device-Info command", Localization.Core.GET_CONFIGURATION_length_is_0,
ftr.DataLength);
AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION current profile is {0:X4}h", AaruConsole.DebugWriteLine("Device-Info command", Localization.Core.GET_CONFIGURATION_current_profile_is_0,
ftr.CurrentProfile); ftr.CurrentProfile);
if(ftr.Descriptors != null) if(ftr.Descriptors != null)
foreach(Features.FeatureDescriptor desc in ftr.Descriptors) foreach(Features.FeatureDescriptor desc in ftr.Descriptors)
{ {
string featureNumber = $"Feature {desc.Code:X4}h"; string featureNumber = string.Format(Localization.Core.Feature_0, desc.Code);
AaruConsole.DebugWriteLine("Device-Info command", "Feature {0:X4}h", desc.Code); AaruConsole.DebugWriteLine("Device-Info command", Localization.Core.Feature_0, desc.Code);
string featureDescription = desc.Code switch string featureDescription = desc.Code switch
{ {
@@ -670,7 +672,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
0x0110 => Features.Prettify_0110(desc.Data), 0x0110 => Features.Prettify_0110(desc.Data),
0x0113 => Features.Prettify_0113(desc.Data), 0x0113 => Features.Prettify_0113(desc.Data),
0x0142 => Features.Prettify_0142(desc.Data), 0x0142 => Features.Prettify_0142(desc.Data),
_ => "Unknown feature" _ => UI.Unknown_feature
}; };
MmcFeatures.Add(new ScsiPageModel MmcFeatures.Add(new ScsiPageModel
@@ -680,7 +682,8 @@ public sealed class ScsiInfoViewModel : ViewModelBase
}); });
} }
else else
AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION returned no feature descriptors"); AaruConsole.DebugWriteLine("Device-Info command",
Localization.Core.GET_CONFIGURATION_returned_no_feature_descriptors);
} }
public byte[] InquiryData { get; } public byte[] InquiryData { get; }
@@ -758,19 +761,19 @@ public sealed class ScsiInfoViewModel : ViewModelBase
set => this.RaiseAndSetIfChanged(ref _mmcFeatureText, value); set => this.RaiseAndSetIfChanged(ref _mmcFeatureText, value);
} }
public string InquiryLabel => "INQUIRY"; public string InquiryLabel => UI.Title_INQUIRY;
public string ScsiInquiryLabel => "SCSI INQUIRY"; public string ScsiInquiryLabel => UI.Title_SCSI_INQUIRY;
public string SaveInquiryBinaryLabel => "Save binary to file"; public string SaveInquiryBinaryLabel => UI.ButtonLabel_Save_binary_to_file;
public string SaveInquiryTextLabel => "Save text to file"; public string SaveInquiryTextLabel => UI.ButtonLabel_Save_text_to_file;
public string ModeSenseLabel => "MODE SENSE"; public string ModeSenseLabel => UI.Title_MODE_SENSE;
public string PageLabel => "Page"; public string PageLabel => UI.Title_Page;
public string SaveModeSense6Label => "Save MODE SENSE (6) response to file"; public string SaveModeSense6Label => UI.ButtonLabel_Save_MODE_SENSE_6_response_to_file;
public string SaveModeSense10Label => "Save MODE SENSE (10) response to file"; public string SaveModeSense10Label => UI.ButtonLabel_Save_MODE_SENSE_10_response_to_file;
public string EvpdLabel => "EVPD"; public string EvpdLabel => UI.Title_EVPD;
public string SaveEvpdPageLabel => "Save EVPD page to file"; public string SaveEvpdPageLabel => UI.ButtonLabel_Save_EVPD_page_to_file;
public string MmcFeaturesLabel => "MMC FEATURES"; public string MmcFeaturesLabel => UI.Title_MMC_FEATURES;
public string FeatureLabel => "Feature"; public string FeatureLabel => UI.Title_Feature;
public string SaveMmcFeaturesLabel => "Save MMC GET CONFIGURATION response to file"; public string SaveMmcFeaturesLabel => UI.ButtonLabel_Save_MMC_GET_CONFIGURATION_response_to_file;
async Task ExecuteSaveInquiryBinaryCommand() async Task ExecuteSaveInquiryBinaryCommand()
{ {
@@ -782,7 +785,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -806,7 +809,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
{ {
"*.txt" "*.txt"
}), }),
Name = "Text" Name = UI.Dialog_Text_files
}); });
string result = await dlgSaveText.ShowAsync(_view); string result = await dlgSaveText.ShowAsync(_view);
@@ -830,7 +833,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -854,7 +857,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -881,7 +884,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);
@@ -905,7 +908,7 @@ public sealed class ScsiInfoViewModel : ViewModelBase
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);

View File

@@ -31,6 +31,7 @@
// ****************************************************************************/ // ****************************************************************************/
using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Enums;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
namespace Aaru.Gui.ViewModels.Tabs; namespace Aaru.Gui.ViewModels.Tabs;
@@ -87,9 +88,9 @@ public sealed class SdMmcInfoViewModel
public string ExtendedCsdText { get; } public string ExtendedCsdText { get; }
public string ScrText { get; } public string ScrText { get; }
public string CidLabel => "CID"; public string CidLabel => UI.Title_CID;
public string CsdLabel => "CSD"; public string CsdLabel => UI.Title_CSD;
public string OcrLabel => "OCR"; public string OcrLabel => UI.Title_OCR;
public string ExtendedCsdLabel => "Extended CSD"; public string ExtendedCsdLabel => UI.Title_Extended_CSD;
public string ScrLabel => "SCR"; public string ScrLabel => UI.Title_SCR;
} }

View File

@@ -36,6 +36,7 @@ using System.Reactive;
using System.Threading.Tasks; using System.Threading.Tasks;
using Aaru.Core.Media.Info; using Aaru.Core.Media.Info;
using Aaru.Decoders.Xbox; using Aaru.Decoders.Xbox;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -57,11 +58,11 @@ public sealed class XboxInfoViewModel
if(xgdInfo != null) if(xgdInfo != null)
{ {
XboxInformationVisible = true; XboxInformationVisible = true;
XboxL0VideoText = $"{xgdInfo.L0Video} sectors"; XboxL0VideoText = string.Format(Localization.Core._0_sectors, xgdInfo.L0Video);
XboxL1VideoText = $"{xgdInfo.L1Video} sectors"; XboxL1VideoText = string.Format(Localization.Core._0_sectors, xgdInfo.L1Video);
XboxMiddleZoneText = $"{xgdInfo.MiddleZone} sectors"; XboxMiddleZoneText = string.Format(Localization.Core._0_sectors, xgdInfo.MiddleZone);
XboxGameSizeText = $"{xgdInfo.GameSize} sectors"; XboxGameSizeText = string.Format(Localization.Core._0_sectors, xgdInfo.GameSize);
XboxTotalSizeText = $"{xgdInfo.TotalSize} sectors"; XboxTotalSizeText = string.Format(Localization.Core._0_sectors, xgdInfo.TotalSize);
XboxRealBreakText = xgdInfo.LayerBreak.ToString(); XboxRealBreakText = xgdInfo.LayerBreak.ToString();
} }
@@ -91,15 +92,15 @@ public sealed class XboxInfoViewModel
public string XboxDmiText { get; } public string XboxDmiText { get; }
public string XboxSsText { get; } public string XboxSsText { get; }
public string XboxL0VideoLabel => "Video layer 0 size"; public string XboxL0VideoLabel => Localization.Core.Video_layer_zero_size;
public string XboxL1VideoLabel => "Video layer 1 size"; public string XboxL1VideoLabel => Localization.Core.Video_layer_one_size;
public string XboxMiddleZoneLabel => "Middle zone size"; public string XboxMiddleZoneLabel => Localization.Core.Middle_zone_size;
public string XboxGameSizeLabel => "Game data size"; public string XboxGameSizeLabel => Localization.Core.Game_data_size;
public string XboxTotalSizeLabel => "Total size"; public string XboxTotalSizeLabel => Localization.Core.Total_size;
public string XboxRealBreakLabel => "Real layer break"; public string XboxRealBreakLabel => Localization.Core.Real_layer_break;
public string XboxDmiLabel => "Disc Manufacturing Information"; public string XboxDmiLabel => UI.Title_Disc_Manufacturing_Information;
public string XboxSsLabel => "Security Sector"; public string XboxSsLabel => UI.Title_Security_Sector;
public string SaveXboxSsLabel => "Save Xbox Security Sector"; public string SaveXboxSsLabel => UI.ButtonLabel_Save_Xbox_Security_Sector;
async Task SaveElement(byte[] data) async Task SaveElement(byte[] data)
{ {
@@ -111,7 +112,7 @@ public sealed class XboxInfoViewModel
{ {
"*.bin" "*.bin"
}), }),
Name = "Binary" Name = UI.Dialog_Binary_files
}); });
string result = await dlgSaveBinary.ShowAsync(_view); string result = await dlgSaveBinary.ShowAsync(_view);

View File

@@ -45,6 +45,7 @@ using Aaru.Decoders.SCSI.MMC;
using Aaru.Decoders.Xbox; using Aaru.Decoders.Xbox;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Helpers; using Aaru.Helpers;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
using BCA = Aaru.Decoders.Bluray.BCA; using BCA = Aaru.Decoders.Bluray.BCA;
@@ -249,7 +250,7 @@ public sealed class DecodeMediaTagsViewModel : ViewModelBase
set => this.RaiseAndSetIfChanged(ref _decodedText, value); set => this.RaiseAndSetIfChanged(ref _decodedText, value);
} }
public string TagLabel => "Tag:"; public string TagLabel => UI.Title_Tag;
public string HexViewLabel => "HexView"; public string HexViewLabel => UI.Title_HexView;
public string DecodedLabel => "Decoded"; public string DecodedLabel => UI.Title_Decoded;
} }

View File

@@ -41,6 +41,7 @@ using Aaru.CommonTypes.Structs;
using Aaru.Console; using Aaru.Console;
using Aaru.Core; using Aaru.Core;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Threading; using Avalonia.Threading;
using ReactiveUI; using ReactiveUI;
@@ -128,28 +129,28 @@ public sealed class ImageChecksumViewModel : ViewModelBase
} }
} }
public string ChecksumMediaLabel => "Checksums the whole disc."; public string ChecksumMediaLabel => UI.Checksums_the_whole_disc;
public string ChecksumTracksLabel => "Checksums each track separately."; public string ChecksumTracksLabel => UI.Checksums_each_track_separately;
public string Adler32Label => "Calculates Adler-32."; public string Adler32Label => UI.Calculates_Adler_32;
public string Crc16Label => "Calculates CRC16."; public string Crc16Label => UI.Calculates_CRC16;
public string Crc32Label => "Calculates CRC32."; public string Crc32Label => UI.Calculates_CRC32;
public string Crc64Label => "Calculates CRC64 (ECMA)."; public string Crc64Label => UI.Calculates_CRC64_ECMA;
public string Fletcher16Label => "Calculates Fletcher-16."; public string Fletcher16Label => UI.Calculates_Fletcher_16;
public string Fletcher32Label => "Calculates Fletcher-32."; public string Fletcher32Label => UI.Calculates_Fletcher_32;
public string Md5Label => "Calculates MD5."; public string Md5Label => UI.Calculates_MD5;
public string Sha1Label => "Calculates SHA1."; public string Sha1Label => UI.Calculates_SHA1;
public string Sha256Label => "Calculates SHA256."; public string Sha256Label => UI.Calculates_SHA256;
public string Sha384Label => "Calculates SHA384"; public string Sha384Label => UI.Calculates_SHA384;
public string Sha512Label => "Calculates SHA512."; public string Sha512Label => UI.Calculates_SHA512;
public string SpamSumLabel => "Calculates SpamSum fuzzy hash."; public string SpamSumLabel => UI.Calculates_SpamSum_fuzzy_hash;
public string TrackChecksumsLabel => "Track checksums:"; public string TrackChecksumsLabel => UI.Title_Track_checksums;
public string TrackLabel => "Track"; public string TrackLabel => Localization.Core.Title_Track;
public string AlgorithmsLabel => "Algorithms"; public string AlgorithmsLabel => UI.Title_Algorithms;
public string HashLabel => "Hash"; public string HashLabel => UI.Title_Hash;
public string MediaChecksumsLabel => "Media checksums:"; public string MediaChecksumsLabel => UI.Title_Media_checksums;
public string StartLabel => "Start"; public string StartLabel => UI.ButtonLabel_Start;
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string StopLabel => "Stop"; public string StopLabel => UI.ButtonLabel_Stop;
public string Title public string Title
{ {
@@ -482,7 +483,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = $"Hashing track {currentTrack.Sequence} of {opticalMediaImage.Tracks.Count}"; ProgressText = string.Format(UI.Hashing_track_0_of_1, currentTrack.Sequence,
opticalMediaImage.Tracks.Count);
ProgressValue++; ProgressValue++;
}); });
@@ -511,8 +513,7 @@ public sealed class ImageChecksumViewModel : ViewModelBase
mediaChecksum?.Update(hiddenSector); mediaChecksum?.Update(hiddenSector);
} }
AaruConsole.DebugWriteLine("Checksum command", AaruConsole.DebugWriteLine("Checksum command", UI.Track_0_starts_at_sector_1_and_ends_at_sector_2,
"Track {0} starts at sector {1} and ends at sector {2}",
currentTrack.Sequence, currentTrack.StartSector, currentTrack.EndSector); currentTrack.Sequence, currentTrack.StartSector, currentTrack.EndSector);
if(ChecksumTracksChecked) if(ChecksumTracksChecked)
@@ -655,7 +656,7 @@ public sealed class ImageChecksumViewModel : ViewModelBase
} }
catch(Exception ex) catch(Exception ex)
{ {
AaruConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message); AaruConsole.DebugWriteLine(UI.Could_not_get_tracks_because_0, ex.Message);
AaruConsole.WriteLine("Unable to get separate tracks, not checksumming them"); AaruConsole.WriteLine("Unable to get separate tracks, not checksumming them");
} }
else else
@@ -703,8 +704,8 @@ public sealed class ImageChecksumViewModel : ViewModelBase
{ {
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ); Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text = $"Hashing sectors {doneSectorsToInvoke} to { Progress2Text = string.Format(UI.Hashing_sectors_0_to_1, doneSectorsToInvoke,
doneSectorsToInvoke + SECTORS_TO_READ}"; doneSectorsToInvoke + SECTORS_TO_READ);
}); });
doneSectors += SECTORS_TO_READ; doneSectors += SECTORS_TO_READ;
@@ -728,8 +729,9 @@ public sealed class ImageChecksumViewModel : ViewModelBase
{ {
Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ); Progress2Value = (int)(doneSectorsToInvoke / SECTORS_TO_READ);
Progress2Text = $"Hashing sectors {doneSectorsToInvoke} to { Progress2Text = string.Format(UI.Hashing_sectors_0_to_1, doneSectorsToInvoke,
doneSectorsToInvoke + (_inputFormat.Info.Sectors - doneSectorsToInvoke)}"; doneSectorsToInvoke +
(_inputFormat.Info.Sectors - doneSectorsToInvoke));
}); });
doneSectors += _inputFormat.Info.Sectors - doneSectors; doneSectors += _inputFormat.Info.Sectors - doneSectors;

View File

@@ -51,6 +51,7 @@ using Aaru.Core;
using Aaru.Core.Media; using Aaru.Core.Media;
using Aaru.Devices; using Aaru.Devices;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Threading; using Avalonia.Threading;
using MessageBox.Avalonia; using MessageBox.Avalonia;
@@ -128,32 +129,32 @@ public sealed class ImageConvertViewModel : ViewModelBase
bool _stopVisible; bool _stopVisible;
string _title; string _title;
public string SourceImageLabel => "Source image"; public string SourceImageLabel => UI.Source_image;
public string OutputFormatLabel => "Output format"; public string OutputFormatLabel => UI.Output_format;
public string ChooseLabel => "Choose..."; public string ChooseLabel => UI.ButtonLabel_Choose;
public string SectorsLabel => "How many sectors to convert at once."; public string SectorsLabel => UI.How_many_sectors_to_convert_at_once;
public string ForceLabel => "Continue conversion even if sector or media tags will be lost in the process."; public string ForceLabel => UI.Continue_conversion_even_if_data_lost;
public string CreatorLabel => "Who (person) created the image?"; public string CreatorLabel => UI.Who_person_created_the_image;
public string GetFromSourceImageLabel => "Get from source image"; public string GetFromSourceImageLabel => UI.ButtonLabel_Get_from_source_image;
public string MetadataLabel => "Metadata"; public string MetadataLabel => UI.Title_Metadata;
public string MediaLabel => "Media"; public string MediaLabel => UI.Title_Media;
public string TitleLabel => "Title"; public string TitleLabel => UI.Title_Title;
public string ManufacturerLabel => "Manufacturer"; public string ManufacturerLabel => UI.Title_Manufacturer;
public string ModelLabel => "Model"; public string ModelLabel => UI.Title_Model;
public string SerialNumberLabel => "Serial number"; public string SerialNumberLabel => UI.Title_Serial_number;
public string BarcodeLabel => "Barcode"; public string BarcodeLabel => UI.Title_Barcode;
public string PartNumberLabel => "Part number"; public string PartNumberLabel => UI.Title_Part_number;
public string NumberInSequenceLabel => "Number in sequence"; public string NumberInSequenceLabel => UI.Title_Number_in_sequence;
public string LastMediaOfTheSequenceLabel => "Last media of the sequence"; public string LastMediaOfTheSequenceLabel => UI.Title_Last_media_of_the_sequence;
public string DriveLabel => "Drive"; public string DriveLabel => UI.Title_Drive;
public string FirmwareRevisionLabel => "Firmware revision"; public string FirmwareRevisionLabel => UI.Title_Firmware_revision;
public string CommentsLabel => "Comments"; public string CommentsLabel => UI.Title_Comments;
public string CicmXmlLabel => "Existing CICM XML sidecar"; public string CicmXmlLabel => UI.Title_Existing_CICM_XML_sidecar;
public string FromImageLabel => "From image..."; public string FromImageLabel => UI.Title_From_image;
public string ResumeFileLabel => "Existing resume file"; public string ResumeFileLabel => UI.Title_Existing_resume_file;
public string StartLabel => "Start"; public string StartLabel => UI.ButtonLabel_Start;
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string StopLabel => "Stop"; public string StopLabel => UI.ButtonLabel_Stop;
public ImageConvertViewModel([JetBrains.Annotations.NotNull] IMediaImage inputFormat, string imageSource, public ImageConvertViewModel([JetBrains.Annotations.NotNull] IMediaImage inputFormat, string imageSource,
Window view) Window view)
@@ -216,8 +217,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
_dumpHardware = inputFormat.DumpHardware?.Any() == true ? inputFormat.DumpHardware : null; _dumpHardware = inputFormat.DumpHardware?.Any() == true ? inputFormat.DumpHardware : null;
CicmXmlText = _cicmMetadata == null ? "" : "<From image>"; CicmXmlText = _cicmMetadata == null ? "" : UI._From_image_;
ResumeFileText = _dumpHardware == null ? "" : "<From image>"; ResumeFileText = _dumpHardware == null ? "" : UI._From_image_;
} }
public string Title public string Title
@@ -591,7 +592,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
if(SelectedPlugin is null) if(SelectedPlugin is null)
{ {
await MessageBoxManager.GetMessageBoxStandardWindow("Error", "Error trying to find selected plugin", await MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, UI.Error_trying_to_find_selected_plugin,
icon: Icon.Error).ShowDialog(_view); icon: Icon.Error).ShowDialog(_view);
return; return;
@@ -607,7 +608,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
if(plugin is not IWritableImage outputFormat) if(plugin is not IWritableImage outputFormat)
{ {
await MessageBoxManager.GetMessageBoxStandardWindow("Error", "Error trying to find selected plugin", await MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, UI.Error_trying_to_find_selected_plugin,
icon: Icon.Error).ShowDialog(_view); icon: Icon.Error).ShowDialog(_view);
return; return;
@@ -712,9 +713,10 @@ public sealed class ImageConvertViewModel : ViewModelBase
!outputFormat.SupportedMediaTags.Contains(mediaTag) && !ForceChecked)) !outputFormat.SupportedMediaTags.Contains(mediaTag) && !ForceChecked))
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Converting image will lose media tag { string.
mediaTag}, not continuing...", Format(UI.Converting_image_will_lose_media_tag_0,
mediaTag),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -737,9 +739,10 @@ public sealed class ImageConvertViewModel : ViewModelBase
} }
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Converting image will lose sector tag { string.
sectorTag}, not continuing...", Format(UI.Converting_image_will_lose_sector_tag_0,
sectorTag),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -782,7 +785,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = "Creating output image"; ProgressText = UI.Creating_output_image;
Progress2Text = ""; Progress2Text = "";
Progress2Indeterminate = true; Progress2Indeterminate = true;
}); });
@@ -791,20 +794,22 @@ public sealed class ImageConvertViewModel : ViewModelBase
_inputFormat.Info.SectorSize)) _inputFormat.Info.SectorSize))
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat.ErrorMessage string.
} creating output image.", Format(UI.Error_0_creating_output_image,
outputFormat.
ErrorMessage),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} creating output image.", outputFormat.ErrorMessage); AaruConsole.ErrorWriteLine(UI.Error_0_creating_output_image, outputFormat.ErrorMessage);
return; return;
} }
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = "Setting image metadata"; ProgressText = UI.Setting_image_metadata;
ProgressValue++; ProgressValue++;
Progress2Text = ""; Progress2Text = "";
Progress2Indeterminate = true; Progress2Indeterminate = true;
@@ -833,25 +838,24 @@ public sealed class ImageConvertViewModel : ViewModelBase
if(!_cancel) if(!_cancel)
if(!outputFormat.SetMetadata(metadata)) if(!outputFormat.SetMetadata(metadata))
{ {
AaruConsole.ErrorWrite("Error {0} setting metadata, ", outputFormat.ErrorMessage);
if(ForceChecked != true) if(ForceChecked != true)
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat. string.
ErrorMessage Format(UI.Error_0_setting_metadata_not_continuing,
} setting metadata, not continuing...", outputFormat.
ErrorMessage),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
AaruConsole.ErrorWriteLine("not continuing..."); AaruConsole.ErrorWriteLine(UI.Error_0_setting_metadata_not_continuing, outputFormat.ErrorMessage);
return; return;
} }
warning = true; warning = true;
AaruConsole.ErrorWriteLine("continuing..."); AaruConsole.ErrorWriteLine(UI.Error_0_setting_metadata, outputFormat.ErrorMessage);
} }
if(tracks != null && if(tracks != null &&
@@ -860,7 +864,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = "Setting tracks list"; ProgressText = UI.Setting_tracks_list;
ProgressValue++; ProgressValue++;
Progress2Text = ""; Progress2Text = "";
Progress2Indeterminate = true; Progress2Indeterminate = true;
@@ -869,14 +873,15 @@ public sealed class ImageConvertViewModel : ViewModelBase
if(!outputOptical.SetTracks(tracks)) if(!outputOptical.SetTracks(tracks))
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat. string.
ErrorMessage Format(UI.Error_0_sending_tracks_list_to_output_image,
} sending tracks list to output image.", outputFormat.
ErrorMessage),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} sending tracks list to output image.", outputFormat.ErrorMessage); AaruConsole.ErrorWriteLine(UI.Error_0_sending_tracks_list_to_output_image, outputFormat.ErrorMessage);
return; return;
} }
@@ -888,7 +893,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = $"Converting media tag {mediaTag}"; ProgressText = string.Format(UI.Converting_media_tag_0, mediaTag);
ProgressValue++; ProgressValue++;
Progress2Text = ""; Progress2Text = "";
Progress2Indeterminate = true; Progress2Indeterminate = true;
@@ -908,9 +913,9 @@ public sealed class ImageConvertViewModel : ViewModelBase
warning = true; warning = true;
if(errno == ErrorNumber.NoError) if(errno == ErrorNumber.NoError)
AaruConsole.ErrorWriteLine("Error {0} writing media tag, continuing...", outputFormat.ErrorMessage); AaruConsole.ErrorWriteLine(UI.Error_0_writing_media_tag, outputFormat.ErrorMessage);
else else
AaruConsole.ErrorWriteLine("Error {0} reading media tag, continuing...", errno); AaruConsole.ErrorWriteLine(UI.Error_0_reading_media_tag, errno);
} }
else else
{ {
@@ -918,24 +923,25 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await Dispatcher.UIThread.InvokeAsync(action: async () =>
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat.ErrorMessage string.
} writing media tag, not continuing...", Format(UI.Error_0_writing_media_tag_not_continuing,
outputFormat.ErrorMessage),
icon: Icon.Error).ShowDialog(_view)); icon: Icon.Error).ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} writing media tag, not continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_writing_media_tag_not_continuing, outputFormat.ErrorMessage);
outputFormat.ErrorMessage);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await Dispatcher.UIThread.InvokeAsync(action: async () =>
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno string.
} reading media tag, not continuing...", Format(UI.Error_0_reading_media_tag_not_continuing,
icon: Icon.Error).ShowDialog(_view)); errno), icon: Icon.Error).
ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} reading media tag, not continuing...", errno); AaruConsole.ErrorWriteLine(UI.Error_0_reading_media_tag_not_continuing, errno);
} }
return; return;
@@ -949,8 +955,9 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = $"Setting geometry to {_inputFormat.Info.Cylinders} cylinders, {_inputFormat.Info.Heads ProgressText = string.Format(UI.Setting_geometry_to_0_cylinders_1_heads_and_2_sectors_per_track,
} heads and {_inputFormat.Info.SectorsPerTrack} sectors per track"; _inputFormat.Info.Cylinders, _inputFormat.Info.Heads,
_inputFormat.Info.SectorsPerTrack);
ProgressValue++; ProgressValue++;
Progress2Text = ""; Progress2Text = "";
@@ -962,13 +969,13 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} setting geometry, image may be incorrect, continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_setting_geometry_image_may_be_incorrect_continuing,
outputFormat.ErrorMessage); outputFormat.ErrorMessage);
} }
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = "Converting sectors"; ProgressText = UI.Converting_sectors;
ProgressValue++; ProgressValue++;
Progress2Text = ""; Progress2Text = "";
Progress2Indeterminate = false; Progress2Indeterminate = false;
@@ -993,8 +1000,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
Progress2Text = $"Converting sectors {sectors} to {sectors + sectorsToDo} ({ Progress2Text = string.Format(UI.Converting_sectors_0_to_1_2_done, sectors, sectors + sectorsToDo,
sectors / (double)_inputFormat.Info.Sectors:P2} done)"; sectors / (double)_inputFormat.Info.Sectors);
Progress2Value = (int)(sectors / SectorsValue); Progress2Value = (int)(sectors / SectorsValue);
}); });
@@ -1017,19 +1024,18 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_continuing, errno, doneSectors);
doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno} reading sector { string.
doneSectors}, not continuing...", Format(UI.Error_0_reading_sector_1_not_continuing,
errno, doneSectors),
icon: Icon.Error).ShowDialog(_view)); icon: Icon.Error).ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, not continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_not_continuing, errno, doneSectors);
doneSectors);
return; return;
} }
@@ -1051,19 +1057,18 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_continuing, errno, doneSectors);
doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno} reading sector { string.
doneSectors}, not continuing...", Format(UI.Error_0_reading_sector_1_not_continuing,
errno, doneSectors),
icon: Icon.Error).ShowDialog(_view)); icon: Icon.Error).ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, not continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_not_continuing, errno, doneSectors);
doneSectors);
return; return;
} }
@@ -1075,19 +1080,20 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} writing sector {1}, continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_writing_sector_1_continuing, outputFormat.ErrorMessage,
outputFormat.ErrorMessage, doneSectors); doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat.ErrorMessage string.
} writing sector {doneSectors Format(UI.Error_0_writing_sector_1_not_continuing,
}, not continuing...", icon: Icon.Error). outputFormat.ErrorMessage,
ShowDialog(_view)); doneSectors),
icon: Icon.Error).ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} writing sector {1}, not continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_writing_sector_1_not_continuing,
outputFormat.ErrorMessage, doneSectors); outputFormat.ErrorMessage, doneSectors);
return; return;
@@ -1098,8 +1104,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
Progress2Text = $"Converting sectors {_inputFormat.Info.Sectors} to {_inputFormat.Info.Sectors} ({1.0 Progress2Text = string.Format(UI.Converting_sectors_0_to_1_2_done, _inputFormat.Info.Sectors,
:P2} done)"; _inputFormat.Info.Sectors, 1.0);
Progress2Value = Progress2MaxValue; Progress2Value = Progress2MaxValue;
}); });
@@ -1167,7 +1173,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = $"Converting tag {tag}"; ProgressText = string.Format(UI.Converting_tag_0, tag);
ProgressValue++; ProgressValue++;
Progress2Text = ""; Progress2Text = "";
Progress2Indeterminate = false; Progress2Indeterminate = false;
@@ -1194,9 +1200,10 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
Progress2Text = $"Converting tag {sectors / (double)_inputFormat.Info.Sectors} for sectors { Progress2Text = string.Format(UI.Converting_tag_0_for_sectors_1_to_2_3_done,
sectors} to {sectors + sectorsToDo} ({sectors / (double)_inputFormat.Info.Sectors sectors / (double)_inputFormat.Info.Sectors, sectors,
:P2} done)"; sectors + sectorsToDo,
sectors / (double)_inputFormat.Info.Sectors);
Progress2Value = (int)(sectors / SectorsValue); Progress2Value = (int)(sectors / SectorsValue);
}); });
@@ -1236,20 +1243,19 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_continuing, errno, doneSectors);
doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno} reading sector { string.
doneSectors Format(UI.Error_0_reading_sector_1_not_continuing,
}, not continuing...", errno, doneSectors),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, not continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_not_continuing, errno,
doneSectors); doneSectors);
return; return;
@@ -1290,20 +1296,19 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_continuing, errno, doneSectors);
doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno} reading sector { string.
doneSectors Format(UI.Error_0_reading_sector_1_not_continuing,
}, not continuing...", errno, doneSectors),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, not continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_not_continuing, errno,
doneSectors); doneSectors);
return; return;
@@ -1316,19 +1321,21 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} writing sector {1}, continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_writing_sector_1_continuing,
outputFormat.ErrorMessage, doneSectors); outputFormat.ErrorMessage, doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat.ErrorMessage string.
} writing sector {doneSectors Format(UI.Error_0_writing_sector_1_not_continuing,
}, not continuing...", outputFormat.
ErrorMessage,
doneSectors),
icon: Icon.Error).ShowDialog(_view)); icon: Icon.Error).ShowDialog(_view));
AaruConsole.ErrorWriteLine("Error {0} writing sector {1}, not continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_writing_sector_1_not_continuing,
outputFormat.ErrorMessage, doneSectors); outputFormat.ErrorMessage, doneSectors);
return; return;
@@ -1339,8 +1346,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
Progress2Text = $"Converting tag {tag} for sectors {_inputFormat.Info.Sectors} to { Progress2Text = string.Format(UI.Converting_tag_0_for_sectors_1_to_2_3_done, tag,
_inputFormat.Info.Sectors} ({1.0:P2} done)"; _inputFormat.Info.Sectors, _inputFormat.Info.Sectors, 1.0);
Progress2Value = Progress2MaxValue; Progress2Value = Progress2MaxValue;
}); });
@@ -1370,7 +1377,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = $"Converting sectors in track {track.Sequence}"; ProgressText = string.Format(UI.Converting_sectors_in_track_0, track.Sequence);
ProgressValue++; ProgressValue++;
Progress2Text = ""; Progress2Text = "";
Progress2Indeterminate = false; Progress2Indeterminate = false;
@@ -1395,9 +1402,11 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
Progress2Text = $"Converting sectors {sectors + track.StartSector} to { Progress2Text = string.Format(UI.Converting_sectors_0_to_1_in_track_2_3_done,
sectors + sectorsToDo + track.StartSector} in track {track.Sequence} ({ sectors + track.StartSector,
(sectors + track.StartSector) / (double)_inputFormat.Info.Sectors:P2} done)"; sectors + sectorsToDo + track.StartSector, track.Sequence,
(sectors + track.StartSector) /
(double)_inputFormat.Info.Sectors);
Progress2Value = (int)(sectors / SectorsValue); Progress2Value = (int)(sectors / SectorsValue);
}); });
@@ -1424,16 +1433,15 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_continuing, errno, doneSectors);
doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno} reading sector { string.
doneSectors Format(UI.Error_0_reading_sector_1_not_continuing,
}, not continuing...", errno, doneSectors),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -1460,16 +1468,15 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} reading sector {1}, continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_sector_1_continuing, errno, doneSectors);
doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno} reading sector { string.
doneSectors Format(UI.Error_0_reading_sector_1_not_continuing,
}, not continuing...", errno, doneSectors),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -1483,16 +1490,18 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} writing sector {1}, continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_writing_sector_1_continuing,
outputFormat.ErrorMessage, doneSectors); outputFormat.ErrorMessage, doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat.ErrorMessage string.
} writing sector {doneSectors Format(UI.Error_0_writing_sector_1_not_continuing,
}, not continuing...", outputFormat.
ErrorMessage,
doneSectors),
icon: Icon.Error).ShowDialog(_view)); icon: Icon.Error).ShowDialog(_view));
return; return;
@@ -1504,8 +1513,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
Progress2Text = $"Converting sectors {_inputFormat.Info.Sectors} to {_inputFormat.Info.Sectors Progress2Text = string.Format(UI.Converting_sectors_0_to_1_in_track_2_3_done, _inputFormat.Info.Sectors,
} in track {tracks.Count} ({1.0:P2} done)"; _inputFormat.Info.Sectors, tracks.Count, 1.0);
Progress2Value = Progress2MaxValue; Progress2Value = Progress2MaxValue;
}); });
@@ -1561,15 +1570,16 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} reading tag, continuing...", errno); AaruConsole.ErrorWriteLine(UI.Error_0_reading_media_tag, errno);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await Dispatcher.UIThread.InvokeAsync(action: async () =>
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno string.
} reading tag, not continuing...", Format(UI.Error_0_reading_media_tag_not_continuing,
errno),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -1584,17 +1594,18 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} writing tag, continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_writing_tag_continuing,
outputFormat.ErrorMessage); outputFormat.ErrorMessage);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await Dispatcher.UIThread.InvokeAsync(action: async () =>
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat. string.
ErrorMessage Format(UI.Error_0_writing_tag_not_continuing,
} writing tag, not continuing...", outputFormat.
ErrorMessage),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -1620,9 +1631,11 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
Progress2Text = $"Converting tag {tag} for sectors {sectors + track.StartSector} to { Progress2Text = string.Format(UI.Converting_tag_0_for_sectors_1_to_2_in_track_3_4_done, tag,
sectors + sectorsToDo + track.StartSector} in track {track.Sequence} ({ sectors + track.StartSector,
(sectors + track.StartSector) / (double)_inputFormat.Info.Sectors:P2} done)"; sectors + sectorsToDo + track.StartSector, track.Sequence,
(sectors + track.StartSector) /
(double)_inputFormat.Info.Sectors);
Progress2Value = (int)(sectors / SectorsValue); Progress2Value = (int)(sectors / SectorsValue);
}); });
@@ -1645,17 +1658,16 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} reading tag for sector {1}, continuing...", errno, AaruConsole.ErrorWriteLine(UI.Error_0_reading_tag_for_sector_1_continuing, errno,
doneSectors); doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {errno string.
} reading tag for sector { Format(UI.Error_0_reading_tag_for_sector_1_not_continuing,
doneSectors errno, doneSectors),
}, not continuing...",
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -1668,18 +1680,18 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
warning = true; warning = true;
AaruConsole.ErrorWriteLine("Error {0} writing tag for sector {1}, continuing...", AaruConsole.ErrorWriteLine(UI.Error_0_writing_tag_for_sector_1_continuing,
outputFormat.ErrorMessage, doneSectors); outputFormat.ErrorMessage, doneSectors);
} }
else else
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat. string.
ErrorMessage Format(UI.Error_0_writing_tag_for_sector_1_not_continuing,
} writing tag for sector { outputFormat.
doneSectors ErrorMessage,
}, not continuing...", doneSectors),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -1705,15 +1717,14 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = "Writing dump hardware list to output image."; ProgressText = UI.Writing_dump_hardware_list;
ProgressValue++; ProgressValue++;
}); });
ret = outputFormat.SetDumpHardware(_dumpHardware); ret = outputFormat.SetDumpHardware(_dumpHardware);
if(!ret) if(!ret)
AaruConsole.WriteLine("Error {0} writing dump hardware list to output image.", AaruConsole.WriteLine(UI.Error_0_writing_dump_hardware_list_to_output_image, outputFormat.ErrorMessage);
outputFormat.ErrorMessage);
} }
ret = false; ret = false;
@@ -1723,20 +1734,19 @@ public sealed class ImageConvertViewModel : ViewModelBase
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = "Writing CICM XML metadata to output image."; ProgressText = UI.Writing_CICM_XML_metadata_to_output_image;
ProgressValue++; ProgressValue++;
}); });
outputFormat.SetCicmMetadata(_cicmMetadata); outputFormat.SetCicmMetadata(_cicmMetadata);
if(!ret) if(!ret)
AaruConsole.WriteLine("Error {0} writing CICM XML metadata to output image.", AaruConsole.WriteLine(UI.Error_0_writing_CICM_XML_metadata_to_output_image, outputFormat.ErrorMessage);
outputFormat.ErrorMessage);
} }
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = "Closing output image."; ProgressText = UI.Closing_output_image;
ProgressIndeterminate = true; ProgressIndeterminate = true;
}); });
@@ -1745,7 +1755,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(action: async () => await Dispatcher.UIThread.InvokeAsync(action: async () =>
{ {
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", "Operation canceled, the output file is not correct.", GetMessageBoxStandardWindow(UI.Title_Error, UI.Operation_canceled_the_output_file_is_not_correct,
icon: Icon.Error).ShowDialog(_view); icon: Icon.Error).ShowDialog(_view);
CloseVisible = true; CloseVisible = true;
@@ -1759,9 +1769,11 @@ public sealed class ImageConvertViewModel : ViewModelBase
if(!outputFormat.Close()) if(!outputFormat.Close())
{ {
await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager. await Dispatcher.UIThread.InvokeAsync(action: async () => await MessageBoxManager.
GetMessageBoxStandardWindow("Error", GetMessageBoxStandardWindow(UI.Title_Error,
$"Error {outputFormat.ErrorMessage string.
} closing output image... Contents are not correct.", Format(UI.Error_0_closing_output_image_Contents_are_not_correct,
outputFormat.
ErrorMessage),
icon: Icon.Error). icon: Icon.Error).
ShowDialog(_view)); ShowDialog(_view));
@@ -1770,12 +1782,11 @@ public sealed class ImageConvertViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(action: async () => await Dispatcher.UIThread.InvokeAsync(action: async () =>
{ {
await MessageBoxManager.GetMessageBoxStandardWindow(warning ? "Warning" : "Conversion success", await MessageBoxManager.
warning GetMessageBoxStandardWindow(warning ? UI.Title_Warning : UI.Title_Conversion_success,
? "Some warnings happened. Check console for more information. Image should be correct." warning ? UI.Some_warnings_happened_Check_console
: "Image converted successfully.", : UI.Image_converted_successfully,
icon: warning ? Icon.Warning : Icon.Info). icon: warning ? Icon.Warning : Icon.Info).ShowDialog(_view);
ShowDialog(_view);
CloseVisible = true; CloseVisible = true;
StopVisible = false; StopVisible = false;
@@ -1934,7 +1945,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
var dlgDestination = new SaveFileDialog var dlgDestination = new SaveFileDialog
{ {
Title = "Choose destination file" Title = UI.Dialog_Choose_destination_file
}; };
dlgDestination.Filters?.Add(new FileDialogFilter dlgDestination.Filters?.Add(new FileDialogFilter
@@ -1989,7 +2000,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
void ExecuteCicmXmlFromImageCommand() void ExecuteCicmXmlFromImageCommand()
{ {
CicmXmlText = "<From image>"; CicmXmlText = UI._From_image_;
_cicmMetadata = _inputFormat.CicmMetadata; _cicmMetadata = _inputFormat.CicmMetadata;
} }
@@ -2000,12 +2011,12 @@ public sealed class ImageConvertViewModel : ViewModelBase
var dlgMetadata = new OpenFileDialog var dlgMetadata = new OpenFileDialog
{ {
Title = "Choose existing metadata sidecar" Title = UI.Dialog_Choose_existing_metadata_sidecar
}; };
dlgMetadata.Filters?.Add(new FileDialogFilter dlgMetadata.Filters?.Add(new FileDialogFilter
{ {
Name = "CICM XML metadata", Name = UI.Dialog_CICM_XML_metadata,
Extensions = new List<string>(new[] Extensions = new List<string>(new[]
{ {
".xml" ".xml"
@@ -2029,14 +2040,14 @@ public sealed class ImageConvertViewModel : ViewModelBase
} }
catch catch
{ {
await MessageBoxManager.GetMessageBoxStandardWindow("Error", "Incorrect metadata sidecar file...", await MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, UI.Incorrect_metadata_sidecar_file,
icon: Icon.Error).ShowDialog(_view); icon: Icon.Error).ShowDialog(_view);
} }
} }
void ExecuteResumeFileFromImageCommand() void ExecuteResumeFileFromImageCommand()
{ {
ResumeFileText = "<From image>"; ResumeFileText = UI._From_image_;
_dumpHardware = _inputFormat.DumpHardware; _dumpHardware = _inputFormat.DumpHardware;
} }
@@ -2047,12 +2058,12 @@ public sealed class ImageConvertViewModel : ViewModelBase
var dlgMetadata = new OpenFileDialog var dlgMetadata = new OpenFileDialog
{ {
Title = "Choose existing resume file" Title = UI.Dialog_Choose_existing_resume_file
}; };
dlgMetadata.Filters?.Add(new FileDialogFilter dlgMetadata.Filters?.Add(new FileDialogFilter
{ {
Name = "CICM XML metadata", Name = UI.Dialog_CICM_XML_metadata,
Extensions = new List<string>(new[] Extensions = new List<string>(new[]
{ {
".xml" ".xml"
@@ -2079,14 +2090,16 @@ public sealed class ImageConvertViewModel : ViewModelBase
} }
else else
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", "Resume file does not contain dump hardware information...", GetMessageBoxStandardWindow(UI.Title_Error,
UI.Resume_file_does_not_contain_dump_hardware_information,
icon: Icon.Error).ShowDialog(_view); icon: Icon.Error).ShowDialog(_view);
sr.Close(); sr.Close();
} }
catch catch
{ {
await MessageBoxManager.GetMessageBoxStandardWindow("Error", "Incorrect resume file...", icon: Icon.Error). await MessageBoxManager.
GetMessageBoxStandardWindow(UI.Title_Error, UI.Incorrect_resume_file, icon: Icon.Error).
ShowDialog(_view); ShowDialog(_view);
} }
} }

View File

@@ -40,6 +40,7 @@ using Aaru.CommonTypes.Interfaces;
using Aaru.Console; using Aaru.Console;
using Aaru.Core; using Aaru.Core;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Threading; using Avalonia.Threading;
using ReactiveUI; using ReactiveUI;
@@ -109,17 +110,16 @@ public sealed class ImageEntropyViewModel : ViewModelBase
} }
} }
public string DuplicatedSectorsLabel => public string DuplicatedSectorsLabel => UI.Calculates_how_many_sectors_are_duplicated;
"Calculates how many sectors are duplicated (have same exact data in user area)."; public string SeparatedTracksLabel => UI.Calculates_entropy_for_each_track_separately;
public string SeparatedTracksLabel => "Calculates entropy for each track separately."; public string WholeDiscLabel => UI.Calculates_entropy_for_the_whole_disc;
public string WholeDiscLabel => "Calculates entropy for the whole disc."; public string TrackEntropyLabel => UI.Title_Track_entropy;
public string TrackEntropyLabel => "Track entropy"; public string TrackLabel => Localization.Core.Title_Track;
public string TrackLabel => "Track"; public string EntropyLabel => UI.Title_Entropy;
public string EntropyLabel => "Entropy"; public string UniqueSectorsLabel => UI.Title_Unique_sectors;
public string UniqueSectorsLabel => "Unique sectors"; public string StartLabel => UI.ButtonLabel_Start;
public string StartLabel => "Start"; public string CloseLabel => UI.ButtonLabel_Close;
public string CloseLabel => "Close"; public string StopLabel => UI.ButtonLabel_Stop;
public string StopLabel => "Stop";
public bool SeparatedTracksVisible public bool SeparatedTracksVisible
{ {
@@ -290,7 +290,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
} }
[JetBrains.Annotations.NotNull] [JetBrains.Annotations.NotNull]
public string Title => "Calculating entropy"; public string Title => UI.Title_Calculating_entropy;
public ObservableCollection<TrackEntropyModel> TrackEntropy { get; } public ObservableCollection<TrackEntropyModel> TrackEntropy { get; }
public ReactiveCommand<Unit, Unit> StartCommand { get; } public ReactiveCommand<Unit, Unit> StartCommand { get; }
public ReactiveCommand<Unit, Unit> CloseCommand { get; } public ReactiveCommand<Unit, Unit> CloseCommand { get; }
@@ -315,7 +315,7 @@ public sealed class ImageEntropyViewModel : ViewModelBase
if(WholeDiscChecked && _inputFormat is IOpticalMediaImage { Sessions.Count: > 1 }) if(WholeDiscChecked && _inputFormat is IOpticalMediaImage { Sessions.Count: > 1 })
{ {
AaruConsole.ErrorWriteLine("Calculating disc entropy of multisession images is not yet implemented."); AaruConsole.ErrorWriteLine(UI.Calculating_disc_entropy_of_multisession_images_is_not_yet_implemented);
WholeDiscChecked = false; WholeDiscChecked = false;
} }
@@ -328,10 +328,10 @@ public sealed class ImageEntropyViewModel : ViewModelBase
foreach(EntropyResults trackEntropy in _tracksEntropy) foreach(EntropyResults trackEntropy in _tracksEntropy)
{ {
AaruConsole.WriteLine("Entropy for track {0} is {1:F4}.", trackEntropy.Track, trackEntropy.Entropy); AaruConsole.WriteLine(UI.Entropy_for_track_0_is_1, trackEntropy.Track, trackEntropy.Entropy);
if(trackEntropy.UniqueSectors != null) if(trackEntropy.UniqueSectors != null)
AaruConsole.WriteLine("Track {0} has {1} unique sectors ({2:P3})", trackEntropy.Track, AaruConsole.WriteLine(UI.Track_0_has_1_unique_sectors_2, trackEntropy.Track,
trackEntropy.UniqueSectors, trackEntropy.UniqueSectors,
(double)trackEntropy.UniqueSectors / trackEntropy.Sectors); (double)trackEntropy.UniqueSectors / trackEntropy.Sectors);
} }
@@ -370,14 +370,14 @@ public sealed class ImageEntropyViewModel : ViewModelBase
if(WholeDiscChecked != true) if(WholeDiscChecked != true)
return; return;
MediaEntropyText = $"Entropy for disk is {_entropy.Entropy:F4}."; MediaEntropyText = string.Format(UI.Entropy_for_disk_is_0, _entropy.Entropy);
MediaEntropyVisible = true; MediaEntropyVisible = true;
if(_entropy.UniqueSectors == null) if(_entropy.UniqueSectors == null)
return; return;
MediaUniqueSectorsText = $"Disk has {_entropy.UniqueSectors} unique sectors ({ MediaUniqueSectorsText = string.Format(UI.Disk_has_0_unique_sectors_1, _entropy.UniqueSectors,
(double)_entropy.UniqueSectors / _entropy.Sectors:P3})"; (double)_entropy.UniqueSectors / _entropy.Sectors);
MediaUniqueSectorsVisible = true; MediaUniqueSectorsVisible = true;
} }

View File

@@ -42,6 +42,7 @@ using System.Xml.Serialization;
using Aaru.CommonTypes.Interfaces; using Aaru.CommonTypes.Interfaces;
using Aaru.Console; using Aaru.Console;
using Aaru.Core; using Aaru.Core;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Threading; using Avalonia.Threading;
using ReactiveUI; using ReactiveUI;
@@ -98,11 +99,11 @@ public sealed class ImageSidecarViewModel : ViewModelBase
StopCommand = ReactiveCommand.Create(ExecuteStopCommand); StopCommand = ReactiveCommand.Create(ExecuteStopCommand);
} }
public string DestinationFileLabel => "Destination file"; public string DestinationFileLabel => UI.Title_Destination_file;
public string ChooseLabel => "Choose..."; public string ChooseLabel => UI.ButtonLabel_Choose;
public string StartLabel => "Start"; public string StartLabel => UI.ButtonLabel_Start;
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string StopLabel => "Stop"; public string StopLabel => UI.ButtonLabel_Stop;
public string Title { get; } public string Title { get; }
public ReactiveCommand<Unit, Task> DestinationCommand { get; } public ReactiveCommand<Unit, Task> DestinationCommand { get; }
@@ -251,7 +252,7 @@ public sealed class ImageSidecarViewModel : ViewModelBase
_sidecarClass.EndProgressEvent2 += EndProgress2; _sidecarClass.EndProgressEvent2 += EndProgress2;
CICMMetadataType sidecar = _sidecarClass.Create(); CICMMetadataType sidecar = _sidecarClass.Create();
AaruConsole.WriteLine("Writing metadata sidecar"); AaruConsole.WriteLine(Localization.Core.Writing_metadata_sidecar);
var xmlFs = new FileStream(DestinationText, FileMode.Create); var xmlFs = new FileStream(DestinationText, FileMode.Create);
@@ -324,7 +325,7 @@ public sealed class ImageSidecarViewModel : ViewModelBase
void ExecuteStopCommand() void ExecuteStopCommand()
{ {
ProgressText = "Aborting..."; ProgressText = Localization.Core.Aborting;
StopEnabled = false; StopEnabled = false;
_sidecarClass.Abort(); _sidecarClass.Abort();
} }
@@ -333,12 +334,12 @@ public sealed class ImageSidecarViewModel : ViewModelBase
{ {
var dlgDestination = new SaveFileDialog var dlgDestination = new SaveFileDialog
{ {
Title = "Choose destination file" Title = UI.Dialog_Choose_destination_file
}; };
dlgDestination.Filters?.Add(new FileDialogFilter dlgDestination.Filters?.Add(new FileDialogFilter
{ {
Name = "CICM XML metadata", Name = UI.Dialog_CICM_XML_metadata,
Extensions = new List<string>(new[] Extensions = new List<string>(new[]
{ {
"*.xml" "*.xml"

View File

@@ -41,6 +41,7 @@ using Aaru.CommonTypes.Structs;
using Aaru.Console; using Aaru.Console;
using Aaru.Core; using Aaru.Core;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Threading; using Avalonia.Threading;
using ReactiveUI; using ReactiveUI;
@@ -106,12 +107,12 @@ public sealed class ImageVerifyViewModel : ViewModelBase
OptionsVisible = true; OptionsVisible = true;
} }
public string VerifyImageLabel => "Verify disc image if supported."; public string VerifyImageLabel => UI.Verify_disc_image_if_supported;
public string VerifySectorsLabel => "Verify all sectors if supported."; public string VerifySectorsLabel => UI.Verify_all_sectors_if_supported;
public string LBALabel => "LBA"; public string LBALabel => UI.Title_LBA;
public string StartLabel => "Start"; public string StartLabel => UI.ButtonLabel_Start;
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string StopLabel => "Stop"; public string StopLabel => UI.ButtonLabel_Stop;
public ObservableCollection<LbaModel> ErrorList { get; } public ObservableCollection<LbaModel> ErrorList { get; }
public ObservableCollection<LbaModel> UnknownList { get; } public ObservableCollection<LbaModel> UnknownList { get; }
@@ -402,13 +403,13 @@ public sealed class ImageVerifyViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ImageResultVisible = true; ImageResultVisible = true;
ImageResultText = "Disc image does not support verification."; ImageResultText = UI.Disc_image_does_not_support_verification;
}); });
else else
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = "Checking media image..."; ProgressText = UI.Checking_media_image;
if(VerifySectorsChecked) if(VerifySectorsChecked)
ProgressValue = 1; ProgressValue = 1;
@@ -430,13 +431,13 @@ public sealed class ImageVerifyViewModel : ViewModelBase
ImageResultText = discCheckStatus switch ImageResultText = discCheckStatus switch
{ {
true => "Disc image checksums are correct", true => UI.Disc_image_checksums_are_correct,
false => "Disc image checksums are incorrect", false => UI.Disc_image_checksums_are_incorrect,
null => "Disc image does not contain checksums" null => UI.Disc_image_does_not_contain_checksums
}; };
}); });
AaruConsole.VerboseWriteLine("Checking disc image checksums took {0} seconds", checkTime.TotalSeconds); AaruConsole.VerboseWriteLine(UI.Checking_disc_image_checksums_took_0_seconds, checkTime.TotalSeconds);
} }
} }
@@ -465,7 +466,8 @@ public sealed class ImageVerifyViewModel : ViewModelBase
{ {
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
ProgressText = $"Verifying track {currentTrack.Sequence} of {inputOptical.Tracks.Count}"; ProgressText = string.Format(UI.Verifying_track_0_of_1, currentTrack.Sequence,
inputOptical.Tracks.Count);
ProgressValue++; ProgressValue++;
}); });
@@ -493,8 +495,8 @@ public sealed class ImageVerifyViewModel : ViewModelBase
{ {
Progress2Value = all / 512d; Progress2Value = all / 512d;
Progress2Text = $"Checking sector {all} of {_inputFormat.Info.Sectors}, on track { Progress2Text = string.Format(UI.Checking_sector_0_of_1_on_track_2, all,
currentTrack.Sequence}"; _inputFormat.Info.Sectors, currentTrack.Sequence);
}); });
List<ulong> tempFailingLbas; List<ulong> tempFailingLbas;
@@ -554,7 +556,7 @@ public sealed class ImageVerifyViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
Progress2Value = (int)(sector / 512); Progress2Value = (int)(sector / 512);
Progress2Text = $"Checking sector {sector} of {_inputFormat.Info.Sectors}"; Progress2Text = string.Format(UI.Checking_sector_0_of_1, sector, _inputFormat.Info.Sectors);
}); });
List<ulong> tempFailingLbas; List<ulong> tempFailingLbas;
@@ -587,7 +589,7 @@ public sealed class ImageVerifyViewModel : ViewModelBase
} }
TimeSpan checkTime = endCheck - startCheck; TimeSpan checkTime = endCheck - startCheck;
AaruConsole.VerboseWriteLine("Checking sector checksums took {0} seconds", checkTime.TotalSeconds); AaruConsole.VerboseWriteLine(UI.Checking_sector_checksums_took_0_seconds, checkTime.TotalSeconds);
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
@@ -596,11 +598,11 @@ public sealed class ImageVerifyViewModel : ViewModelBase
if(failingLbas.Count == (int)_inputFormat.Info.Sectors) if(failingLbas.Count == (int)_inputFormat.Info.Sectors)
{ {
SectorsErrorsAllVisible = true; SectorsErrorsAllVisible = true;
SectorsErrorsAllText = "All sectors contain errors"; SectorsErrorsAllText = UI.All_sectors_contain_errors;
} }
else else
{ {
SectorErrorsText = "LBAs with error:"; SectorErrorsText = UI.LBAs_with_error;
SectorErrorsVisible = true; SectorErrorsVisible = true;
foreach(ulong t in failingLbas) foreach(ulong t in failingLbas)
@@ -616,11 +618,11 @@ public sealed class ImageVerifyViewModel : ViewModelBase
if(unknownLbas.Count == (int)_inputFormat.Info.Sectors) if(unknownLbas.Count == (int)_inputFormat.Info.Sectors)
{ {
SectorsUnknownAllVisible = true; SectorsUnknownAllVisible = true;
SectorsUnknownAllText = "All sectors are unknown"; SectorsUnknownAllText = UI.All_sectors_are_unknown;
} }
else else
{ {
SectorsUnknownsText = "Unknown LBAs:"; SectorsUnknownsText = UI.Unknown_LBAs;
SectorsUnknownsVisible = true; SectorsUnknownsVisible = true;
foreach(ulong t in unknownLbas) foreach(ulong t in unknownLbas)
@@ -632,11 +634,12 @@ public sealed class ImageVerifyViewModel : ViewModelBase
} }
SectorSummaryVisible = true; SectorSummaryVisible = true;
TotalSectorsText = $"Total sectors........... {_inputFormat.Info.Sectors}"; TotalSectorsText = string.Format(UI.Total_sectors, _inputFormat.Info.Sectors);
TotalSectorErrorsText = $"Total errors............ {failingLbas.Count}"; TotalSectorErrorsText = string.Format(UI.Total_errors, failingLbas.Count);
TotalSectorUnknownsText = $"Total unknowns.......... {unknownLbas.Count}"; TotalSectorUnknownsText = string.Format(UI.Total_unknowns, unknownLbas.Count);
TotalSectorErrorsUnknownsText = $"Total errors+unknowns... {failingLbas.Count + unknownLbas.Count}"; TotalSectorErrorsUnknownsText =
string.Format(UI.Total_errors_plus_unknowns, failingLbas.Count + unknownLbas.Count);
}); });
} }

View File

@@ -53,6 +53,7 @@ using Aaru.Gui.ViewModels.Panels;
using Aaru.Gui.Views.Dialogs; using Aaru.Gui.Views.Dialogs;
using Aaru.Gui.Views.Panels; using Aaru.Gui.Views.Panels;
using Aaru.Gui.Views.Windows; using Aaru.Gui.Views.Windows;
using Aaru.Localization;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Controls.ApplicationLifetimes;
@@ -113,7 +114,7 @@ public sealed class MainWindowViewModel : ViewModelBase
_imagesRoot = new ImagesRootModel _imagesRoot = new ImagesRootModel
{ {
Name = "Images" Name = UI.Title_Images
}; };
TreeRoot.Add(_imagesRoot); TreeRoot.Add(_imagesRoot);
@@ -125,7 +126,7 @@ public sealed class MainWindowViewModel : ViewModelBase
case PlatformID.FreeBSD: case PlatformID.FreeBSD:
_devicesRoot = new DevicesRootModel _devicesRoot = new DevicesRootModel
{ {
Name = "Devices" Name = UI.Title_Devices
}; };
TreeRoot.Add(_devicesRoot); TreeRoot.Add(_devicesRoot);
@@ -162,27 +163,27 @@ public sealed class MainWindowViewModel : ViewModelBase
_ejectIcon = new Bitmap(_assets.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/media-eject.png"))); _ejectIcon = new Bitmap(_assets.Open(new Uri("avares://Aaru.Gui/Assets/Icons/oxygen/32x32/media-eject.png")));
} }
public string FileLabel => "_File"; public string FileLabel => UI.Menu_File;
public string OpenLabel => "_Open"; public string OpenLabel => UI.Menu_Open;
public string SettingsLabel => "_Settings"; public string SettingsLabel => UI.Menu_Settings;
public string ExitLabel => "E_xit"; public string ExitLabel => UI.Menu_Exit;
public string DevicesLabel => "_Devices"; public string DevicesLabel => UI.Menu_Devices;
public string RefreshDevicesLabel => "_Refresh"; public string RefreshDevicesLabel => UI.Menu_Refresh;
public string WindowLabel => "_Window"; public string WindowLabel => UI.Menu_Window;
public string ConsoleLabel => "_Console"; public string ConsoleLabel => UI.Menu_Console;
public string HelpLabel => "_Help"; public string HelpLabel => UI.Menu_Help;
public string EncodingsLabel => "_Encodings"; public string EncodingsLabel => UI.Menu_Encodings;
public string PluginsLabel => "_Plugins"; public string PluginsLabel => UI.Menu_Plugins;
public string StatisticsLabel => "_Statistics"; public string StatisticsLabel => UI.Menu_Statistics;
public string AboutLabel => "_About"; public string AboutLabel => UI.Menu_About;
public string RefreshDevicesFullLabel => "_Refresh devices"; public string RefreshDevicesFullLabel => UI.Menu_Refresh_devices;
public string CloseAllImagesLabel => "_Close all images"; public string CloseAllImagesLabel => UI.Menu_Close_all_images;
public string CalculateEntropyLabel => "Calculate entropy"; public string CalculateEntropyLabel => UI.ButtonLabel_Calculate_entropy;
public string VerifyImageLabel => "Verify"; public string VerifyImageLabel => UI.ButtonLabel_Verify;
public string ChecksumImageLabel => "Checksum"; public string ChecksumImageLabel => UI.ButtonLabel_Checksum;
public string CreateSidecarLabel => "Create CICM XML sidecar..."; public string CreateSidecarLabel => UI.ButtonLabel_Create_CICM_XML_sidecar;
public string ViewImageSectorsLabel => "View sectors"; public string ViewImageSectorsLabel => UI.ButtonLabel_View_sectors;
public string DecodeImageMediaTagsLabel => "Decode media tags"; public string DecodeImageMediaTagsLabel => UI.ButtonLabel_Decode_media_tags;
public bool DevicesSupported public bool DevicesSupported
{ {
@@ -195,7 +196,7 @@ public sealed class MainWindowViewModel : ViewModelBase
IClassicDesktopStyleApplicationLifetime)?.MainWindow); IClassicDesktopStyleApplicationLifetime)?.MainWindow);
[NotNull] [NotNull]
public string Greeting => "Welcome to Aaru!"; public string Greeting => UI.Welcome_to_Aaru;
public ObservableCollection<RootModel> TreeRoot { get; } public ObservableCollection<RootModel> TreeRoot { get; }
public ReactiveCommand<Unit, Unit> AboutCommand { get; } public ReactiveCommand<Unit, Unit> AboutCommand { get; }
public ReactiveCommand<Unit, Unit> ConsoleCommand { get; } public ReactiveCommand<Unit, Unit> ConsoleCommand { get; }
@@ -271,7 +272,7 @@ public sealed class MainWindowViewModel : ViewModelBase
switch(dev) switch(dev)
{ {
case null: case null:
ContentPanel = $"Error {devErrno} opening device"; ContentPanel = string.Format(UI.Error_0_opening_device, devErrno);
return; return;
case Devices.Remote.Device remoteDev: case Devices.Remote.Device remoteDev:
@@ -285,7 +286,7 @@ public sealed class MainWindowViewModel : ViewModelBase
if(dev.Error) if(dev.Error)
{ {
ContentPanel = $"Error {dev.LastError} opening device"; ContentPanel = string.Format(UI.Error_0_opening_device, dev.LastError);
return; return;
} }
@@ -298,7 +299,7 @@ public sealed class MainWindowViewModel : ViewModelBase
deviceModel.Media.Add(new MediaModel deviceModel.Media.Add(new MediaModel
{ {
NonRemovable = true, NonRemovable = true,
Name = "Non-removable device commands not yet implemented" Name = UI.Non_removable_device_commands_not_yet_implemented
}); });
else else
{ {
@@ -310,7 +311,7 @@ public sealed class MainWindowViewModel : ViewModelBase
{ {
NoMediaInserted = true, NoMediaInserted = true,
Icon = _ejectIcon, Icon = _ejectIcon,
Name = "No media inserted" Name = UI.No_media_inserted
}); });
else else
{ {
@@ -339,11 +340,11 @@ public sealed class MainWindowViewModel : ViewModelBase
break; break;
} }
case MediaModel { NonRemovable: true }: case MediaModel { NonRemovable: true }:
ContentPanel = "Non-removable device commands not yet implemented"; ContentPanel = UI.Non_removable_device_commands_not_yet_implemented;
break; break;
case MediaModel { NoMediaInserted: true }: case MediaModel { NoMediaInserted: true }:
ContentPanel = "No media inserted"; ContentPanel = UI.No_media_inserted;
break; break;
case MediaModel mediaModel: case MediaModel mediaModel:
@@ -484,7 +485,8 @@ public sealed class MainWindowViewModel : ViewModelBase
!ctx.Partitions.Any() && !ctx.Partitions.Any() &&
!ctx.SeenDevices.Any()) !ctx.SeenDevices.Any())
{ {
MessageBoxManager.GetMessageBoxStandardWindow("Warning", "There are no statistics.").ShowDialog(_view); MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Warning, UI.There_are_no_statistics).
ShowDialog(_view);
return; return;
} }
@@ -520,7 +522,7 @@ public sealed class MainWindowViewModel : ViewModelBase
// TODO: Extensions // TODO: Extensions
var dlgOpenImage = new OpenFileDialog var dlgOpenImage = new OpenFileDialog
{ {
Title = "Choose image to open", Title = UI.Dialog_Choose_image_to_open,
AllowMultiple = false AllowMultiple = false
}; };
@@ -534,7 +536,7 @@ public sealed class MainWindowViewModel : ViewModelBase
if(inputFilter == null) if(inputFilter == null)
{ {
MessageBoxManager.GetMessageBoxStandardWindow("Error", "Cannot open specified file.", ButtonEnum.Ok, MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, UI.Cannot_open_specified_file, ButtonEnum.Ok,
Icon.Error); Icon.Error);
return; return;
@@ -544,13 +546,13 @@ public sealed class MainWindowViewModel : ViewModelBase
{ {
if(ImageFormat.Detect(inputFilter) is not IMediaImage imageFormat) if(ImageFormat.Detect(inputFilter) is not IMediaImage imageFormat)
{ {
MessageBoxManager.GetMessageBoxStandardWindow("Error", "Image format not identified.", ButtonEnum.Ok, MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, UI.Image_format_not_identified,
Icon.Error); ButtonEnum.Ok, Icon.Error);
return; return;
} }
AaruConsole.WriteLine("Image format identified by {0} ({1}).", imageFormat.Name, imageFormat.Id); AaruConsole.WriteLine(UI.Image_format_identified_by_0_1, imageFormat.Name, imageFormat.Id);
try try
{ {
@@ -558,11 +560,12 @@ public sealed class MainWindowViewModel : ViewModelBase
if(opened != ErrorNumber.NoError) if(opened != ErrorNumber.NoError)
{ {
MessageBoxManager.GetMessageBoxStandardWindow("Error", $"Error {opened} opening image format.", MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error,
ButtonEnum.Ok, Icon.Error); string.Format(UI.Error_0_opening_image_format,
opened), ButtonEnum.Ok, Icon.Error);
AaruConsole.ErrorWriteLine("Unable to open image format"); AaruConsole.ErrorWriteLine(UI.Unable_to_open_image_format);
AaruConsole.ErrorWriteLine("No error given"); AaruConsole.ErrorWriteLine(UI.No_error_given);
return; return;
} }
@@ -595,13 +598,13 @@ public sealed class MainWindowViewModel : ViewModelBase
if(partitions.Count == 0) if(partitions.Count == 0)
{ {
AaruConsole.DebugWriteLine("Fs-info command", "No partitions found"); AaruConsole.DebugWriteLine("Fs-info command", UI.No_partitions_found);
checkRaw = true; checkRaw = true;
} }
else else
{ {
AaruConsole.WriteLine("{0} partitions found.", partitions.Count); AaruConsole.WriteLine(UI._0_partitions_found, partitions.Count);
foreach(string scheme in partitions.Select(p => p.Scheme).Distinct().OrderBy(s => s)) foreach(string scheme in partitions.Select(p => p.Scheme).Distinct().OrderBy(s => s))
{ {
@@ -622,15 +625,15 @@ public sealed class MainWindowViewModel : ViewModelBase
ViewModel = new PartitionViewModel(partition) ViewModel = new PartitionViewModel(partition)
}; };
AaruConsole.WriteLine("Identifying filesystem on partition"); AaruConsole.WriteLine(UI.Identifying_filesystems_on_partition);
Core.Filesystems.Identify(imageFormat, out idPlugins, partition); Core.Filesystems.Identify(imageFormat, out idPlugins, partition);
if(idPlugins.Count == 0) if(idPlugins.Count == 0)
AaruConsole.WriteLine("Filesystem not identified"); AaruConsole.WriteLine(UI.Filesystem_not_identified);
else else
{ {
AaruConsole.WriteLine($"Identified by {idPlugins.Count} plugins"); AaruConsole.WriteLine(string.Format(UI.Identified_by_0_plugins, idPlugins.Count));
foreach(string pluginName in idPlugins) foreach(string pluginName in idPlugins)
if(plugins.PluginsList.TryGetValue(pluginName, out plugin)) if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
@@ -688,7 +691,7 @@ public sealed class MainWindowViewModel : ViewModelBase
{ {
var wholePart = new CommonTypes.Partition var wholePart = new CommonTypes.Partition
{ {
Name = "Whole device", Name = Localization.Core.Whole_device,
Length = imageFormat.Info.Sectors, Length = imageFormat.Info.Sectors,
Size = imageFormat.Info.Sectors * imageFormat.Info.SectorSize Size = imageFormat.Info.Sectors * imageFormat.Info.SectorSize
}; };
@@ -696,10 +699,10 @@ public sealed class MainWindowViewModel : ViewModelBase
Core.Filesystems.Identify(imageFormat, out idPlugins, wholePart); Core.Filesystems.Identify(imageFormat, out idPlugins, wholePart);
if(idPlugins.Count == 0) if(idPlugins.Count == 0)
AaruConsole.WriteLine("Filesystem not identified"); AaruConsole.WriteLine(UI.Filesystem_not_identified);
else else
{ {
AaruConsole.WriteLine($"Identified by {idPlugins.Count} plugins"); AaruConsole.WriteLine(string.Format(UI.Identified_by_0_plugins, idPlugins.Count));
foreach(string pluginName in idPlugins) foreach(string pluginName in idPlugins)
if(plugins.PluginsList.TryGetValue(pluginName, out plugin)) if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
@@ -753,20 +756,20 @@ public sealed class MainWindowViewModel : ViewModelBase
} }
catch(Exception ex) catch(Exception ex)
{ {
MessageBoxManager.GetMessageBoxStandardWindow("Error", "Unable to open image format.", ButtonEnum.Ok, MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, UI.Unable_to_open_image_format,
Icon.Error); ButtonEnum.Ok, Icon.Error);
AaruConsole.ErrorWriteLine("Unable to open image format"); AaruConsole.ErrorWriteLine(UI.Unable_to_open_image_format);
AaruConsole.ErrorWriteLine("Error: {0}", ex.Message); AaruConsole.ErrorWriteLine(UI.Error_0, ex.Message);
AaruConsole.DebugWriteLine("Image-info command", "Stack trace: {0}", ex.StackTrace); AaruConsole.DebugWriteLine("Image-info command", Localization.Core.Stack_trace_0, ex.StackTrace);
} }
} }
catch(Exception ex) catch(Exception ex)
{ {
MessageBoxManager.GetMessageBoxStandardWindow("Error", "Exception reading file.", ButtonEnum.Ok, MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, UI.Exception_reading_file, ButtonEnum.Ok,
Icon.Error); Icon.Error);
AaruConsole.ErrorWriteLine($"Error reading file: {ex.Message}"); AaruConsole.ErrorWriteLine(string.Format(UI.Error_reading_file_0, ex.Message));
AaruConsole.DebugWriteLine("Image-info command", ex.StackTrace); AaruConsole.DebugWriteLine("Image-info command", ex.StackTrace);
} }
@@ -784,14 +787,14 @@ public sealed class MainWindowViewModel : ViewModelBase
try try
{ {
AaruConsole.WriteLine("Refreshing devices"); AaruConsole.WriteLine(UI.Refreshing_devices);
_devicesRoot.Devices.Clear(); _devicesRoot.Devices.Clear();
foreach(Devices.DeviceInfo device in Device.ListDevices().Where(d => d.Supported).OrderBy(d => d.Vendor). foreach(Devices.DeviceInfo device in Device.ListDevices().Where(d => d.Supported).OrderBy(d => d.Vendor).
ThenBy(d => d.Model)) ThenBy(d => d.Model))
{ {
AaruConsole.DebugWriteLine("Main window", AaruConsole.DebugWriteLine("Main window",
"Found supported device model {0} by manufacturer {1} on bus {2} and path {3}", UI.Found_supported_device_model_0_by_manufacturer_1_on_bus_2_and_path_3,
device.Model, device.Vendor, device.Bus, device.Path); device.Model, device.Vendor, device.Bus, device.Path);
var deviceModel = new DeviceModel var deviceModel = new DeviceModel

View File

@@ -51,6 +51,7 @@ using Aaru.Core.Logging;
using Aaru.Core.Media.Info; using Aaru.Core.Media.Info;
using Aaru.Devices; using Aaru.Devices;
using Aaru.Gui.Models; using Aaru.Gui.Models;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Threading; using Avalonia.Threading;
using DynamicData; using DynamicData;
@@ -240,24 +241,24 @@ public sealed class MediaDumpViewModel : ViewModelBase
_devicePath = devicePath; _devicePath = devicePath;
} }
public string OutputFormatLabel => "Output format"; public string OutputFormatLabel => UI.Output_format;
public string ChooseLabel => "Choose..."; public string ChooseLabel => UI.ButtonLabel_Choose;
public string StopOnErrorLabel => "Stop media dump on first error"; public string StopOnErrorLabel => UI.Stop_media_dump_on_first_error;
public string ForceLabel => "Continue dumping whatever happens"; public string ForceLabel => UI.Continue_dumping_whatever_happens;
public string RetriesLabel => "Retry passes"; public string RetriesLabel => UI.Retry_passes;
public string PersistentLabel => "Try to recover partial or incorrect data"; public string PersistentLabel => UI.Try_to_recover_partial_or_incorrect_data;
public string ResumeLabel => "Create/use resume mapfile"; public string ResumeLabel => UI.Create_use_resume_mapfile;
public string Track1PregapLabel => "Try to read track 1 pregap"; public string Track1PregapLabel => UI.Try_to_read_track_1_pregap;
public string SkippedLabel => "Skipped sectors on error"; public string SkippedLabel => UI.Skipped_sectors_on_error;
public string SidecarLabel => "Create CICM XML metadata sidecar"; public string SidecarLabel => UI.Create_CICM_XML_metadata_sidecar;
public string TrimLabel => "Trim errors from skipped sectors"; public string TrimLabel => UI.Trim_errors_from_skipped_sectors;
public string ExistingMetadataLabel => "Take metadata from existing CICM XML sidecar"; public string ExistingMetadataLabel => UI.Take_metadata_from_existing_CICM_XML_sidecar;
public string EncodingLabel => "Encoding to use on metadata sidecar creation"; public string EncodingLabel => UI.Encoding_to_use_on_metadata_sidecar_creation;
public string DestinationLabel => "Writing image to:"; public string DestinationLabel => UI.Writing_image_to;
public string LogLabel => "Log"; public string LogLabel => UI.Title_Log;
public string StartLabel => "Start"; public string StartLabel => UI.ButtonLabel_Start;
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string StopLabel => "Stop"; public string StopLabel => UI.ButtonLabel_Stop;
public ReactiveCommand<Unit, Unit> StartCommand { get; } public ReactiveCommand<Unit, Unit> StartCommand { get; }
public ReactiveCommand<Unit, Unit> CloseCommand { get; } public ReactiveCommand<Unit, Unit> CloseCommand { get; }
@@ -501,12 +502,12 @@ public sealed class MediaDumpViewModel : ViewModelBase
var dlgMetadata = new OpenFileDialog var dlgMetadata = new OpenFileDialog
{ {
Title = "Choose existing metadata sidecar" Title = UI.Dialog_Choose_existing_metadata_sidecar
}; };
dlgMetadata.Filters?.Add(new FileDialogFilter dlgMetadata.Filters?.Add(new FileDialogFilter
{ {
Name = "CICM XML metadata", Name = UI.Dialog_CICM_XML_metadata,
Extensions = new List<string>(new[] Extensions = new List<string>(new[]
{ {
".xml" ".xml"
@@ -536,7 +537,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
_ = MessageBoxManager. _ = MessageBoxManager.
// ReSharper restore AssignmentIsFullyDiscarded // ReSharper restore AssignmentIsFullyDiscarded
GetMessageBoxStandardWindow("Error", "Incorrect metadata sidecar file...", ButtonEnum.Ok, GetMessageBoxStandardWindow(UI.Title_Error, UI.Incorrect_metadata_sidecar_file, ButtonEnum.Ok,
Icon.Error).ShowDialog(_view).Result; Icon.Error).ShowDialog(_view).Result;
ExistingMetadata = false; ExistingMetadata = false;
@@ -659,7 +660,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
var dlgDestination = new SaveFileDialog var dlgDestination = new SaveFileDialog
{ {
Title = "Choose destination file" Title = UI.Dialog_Choose_destination_file
}; };
dlgDestination.Filters?.Add(new FileDialogFilter dlgDestination.Filters?.Add(new FileDialogFilter
@@ -702,7 +703,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
catch catch
{ {
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", "Incorrect resume file, cannot use it...", ButtonEnum.Ok, GetMessageBoxStandardWindow(UI.Title_Error, UI.Incorrect_resume_file_cannot_use_it, ButtonEnum.Ok,
Icon.Error).ShowDialog(_view); Icon.Error).ShowDialog(_view);
Resume = false; Resume = false;
@@ -716,8 +717,8 @@ public sealed class MediaDumpViewModel : ViewModelBase
return; return;
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Warning", GetMessageBoxStandardWindow(UI.Title_Warning,
"Media already dumped correctly, please choose another destination...", UI.Media_already_dumped_correctly_please_choose_another_destination,
ButtonEnum.Ok, Icon.Warning).ShowDialog(_view); ButtonEnum.Ok, Icon.Warning).ShowDialog(_view);
Resume = false; Resume = false;
@@ -742,14 +743,14 @@ public sealed class MediaDumpViewModel : ViewModelBase
DestinationEnabled = false; DestinationEnabled = false;
OptionsVisible = false; OptionsVisible = false;
UpdateStatus("Opening device..."); UpdateStatus(UI.Opening_device);
_dev = Device.Create(_devicePath, out ErrorNumber devErrno); _dev = Device.Create(_devicePath, out ErrorNumber devErrno);
switch(_dev) switch(_dev)
{ {
case null: case null:
StoppingErrorMessage($"Error {devErrno} opening device."); StoppingErrorMessage(string.Format(UI.Error_0_opening_device, devErrno));
return; return;
case Devices.Remote.Device remoteDev: case Devices.Remote.Device remoteDev:
@@ -762,7 +763,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
if(_dev.Error) if(_dev.Error)
{ {
StoppingErrorMessage($"Error {_dev.LastError} opening device."); StoppingErrorMessage(string.Format(UI.Error_0_opening_device, _dev.LastError));
return; return;
} }
@@ -772,7 +773,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
if(SelectedPlugin is null) if(SelectedPlugin is null)
{ {
StoppingErrorMessage("Cannot open output plugin."); StoppingErrorMessage(UI.Cannot_open_output_plugin);
return; return;
} }
@@ -786,7 +787,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
} }
catch(ArgumentException) catch(ArgumentException)
{ {
StoppingErrorMessage("Specified encoding is not supported."); StoppingErrorMessage(UI.Specified_encoding_is_not_supported);
return; return;
} }
@@ -824,7 +825,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
var dumpLog = new DumpLog(_outputPrefix + ".log", _dev, false); var dumpLog = new DumpLog(_outputPrefix + ".log", _dev, false);
dumpLog.WriteLine("Output image format: {0}.", SelectedPlugin.Name); dumpLog.WriteLine(UI.Output_image_format_0, SelectedPlugin.Name);
var errorLog = new ErrorLog(_outputPrefix + ".error.log"); var errorLog = new ErrorLog(_outputPrefix + ".error.log");
@@ -922,7 +923,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
{ {
ErrorMessage(text); ErrorMessage(text);
await MessageBoxManager.GetMessageBoxStandardWindow("Error", $"{text}", ButtonEnum.Ok, Icon.Error). await MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, $"{text}", ButtonEnum.Ok, Icon.Error).
ShowDialog(_view); ShowDialog(_view);
await WorkFinished(); await WorkFinished();

View File

@@ -39,6 +39,7 @@ using Aaru.CommonTypes.Enums;
using Aaru.Core; using Aaru.Core;
using Aaru.Core.Devices.Scanning; using Aaru.Core.Devices.Scanning;
using Aaru.Devices; using Aaru.Devices;
using Aaru.Localization;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Threading; using Avalonia.Threading;
@@ -111,12 +112,12 @@ public sealed class MediaScanViewModel : ViewModelBase
LineColor = Colors.Yellow; LineColor = Colors.Yellow;
} }
public string SpeedLabel => "Stop"; public string SpeedLabel => UI.ButtonLabel_Stop;
public string KbsLabel => "Kb/s"; public string KbsLabel => UI.Kb_s;
public string BlockLabel => "Block"; public string BlockLabel => UI.Title_Block;
public string StartLabel => "Start"; public string StartLabel => UI.ButtonLabel_Start;
public string CloseLabel => "Close"; public string CloseLabel => UI.ButtonLabel_Close;
public string StopLabel => "Stop"; public string StopLabel => UI.ButtonLabel_Stop;
public Color AxesColor public Color AxesColor
{ {
@@ -344,8 +345,8 @@ public sealed class MediaScanViewModel : ViewModelBase
{ {
case null: case null:
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", $"Error {devErrno} opening device.", ButtonEnum.Ok, GetMessageBoxStandardWindow(UI.Title_Error, string.Format(UI.Error_0_opening_device, devErrno),
Icon.Error).ShowDialog(_view); ButtonEnum.Ok, Icon.Error).ShowDialog(_view);
StopVisible = false; StopVisible = false;
StartVisible = true; StartVisible = true;
@@ -364,8 +365,8 @@ public sealed class MediaScanViewModel : ViewModelBase
if(dev.Error) if(dev.Error)
{ {
await MessageBoxManager. await MessageBoxManager.
GetMessageBoxStandardWindow("Error", $"Error {dev.LastError} opening device.", ButtonEnum.Ok, GetMessageBoxStandardWindow(UI.Title_Error, string.Format(UI.Error_0_opening_device, dev.LastError),
Icon.Error).ShowDialog(_view); ButtonEnum.Ok, Icon.Error).ShowDialog(_view);
StopVisible = false; StopVisible = false;
StartVisible = true; StartVisible = true;
@@ -394,18 +395,21 @@ public sealed class MediaScanViewModel : ViewModelBase
await Dispatcher.UIThread.InvokeAsync(() => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
TotalTime = $"Took a total of {results.TotalTime} seconds ({results.ProcessingTime} processing commands)."; TotalTime = string.Format(Localization.Core.Took_a_total_of_0_seconds_1_processing_commands,
results.TotalTime, results.ProcessingTime);
AvgSpeed = $"Average speed: {results.AvgSpeed:F3} MiB/sec."; AvgSpeed = string.Format(Localization.Core.Average_speed_0_MiB_sec, results.AvgSpeed);
MaxSpeed = $"Fastest speed burst: {results.MaxSpeed:F3} MiB/sec."; MaxSpeed = string.Format(Localization.Core.Fastest_speed_burst_0_MiB_sec, results.MaxSpeed);
MinSpeed = $"Slowest speed burst: {results.MinSpeed:F3} MiB/sec."; MinSpeed = string.Format(Localization.Core.Slowest_speed_burst_0_MiB_sec, results.MinSpeed);
A = $"{results.A} sectors took less than 3 ms."; A = string.Format(Localization.Core._0_sectors_took_less_than_3_ms, results.A);
B = $"{results.B} sectors took less than 10 ms but more than 3 ms."; B = string.Format(Localization.Core._0_sectors_took_less_than_10_ms_but_more_than_3_ms, results.B);
C = $"{results.C} sectors took less than 50 ms but more than 10 ms."; C = string.Format(Localization.Core._0_sectors_took_less_than_50_ms_but_more_than_10_ms, results.C);
D = $"{results.D} sectors took less than 150 ms but more than 50 ms."; D = string.Format(Localization.Core._0_sectors_took_less_than_150_ms_but_more_than_50_ms, results.D);
E = $"{results.E} sectors took less than 500 ms but more than 150 ms."; E = string.Format(Localization.Core._0_sectors_took_less_than_500_ms_but_more_than_150_ms, results.E);
F = $"{results.F} sectors took more than 500 ms."; F = string.Format(Localization.Core._0_sectors_took_more_than_500_ms, results.F);
UnreadableSectors = $"{results.UnreadableSectors.Count} sectors could not be read.";
UnreadableSectors = string.Format(Localization.Core._0_sectors_could_not_be_read,
results.UnreadableSectors.Count);
}); });
// TODO: Show list of unreadable sectors // TODO: Show list of unreadable sectors
@@ -589,7 +593,7 @@ public sealed class MediaScanViewModel : ViewModelBase
{ {
ProgressText = text; ProgressText = text;
await MessageBoxManager.GetMessageBoxStandardWindow("Error", $"{text}", ButtonEnum.Ok, Icon.Error). await MessageBoxManager.GetMessageBoxStandardWindow(UI.Title_Error, $"{text}", ButtonEnum.Ok, Icon.Error).
ShowDialog(_view); ShowDialog(_view);
await WorkFinished(); await WorkFinished();
@@ -605,7 +609,7 @@ public sealed class MediaScanViewModel : ViewModelBase
async void OnScanUnreadable(ulong sector) => await Dispatcher.UIThread.InvokeAsync(() => async void OnScanUnreadable(ulong sector) => await Dispatcher.UIThread.InvokeAsync(() =>
{ {
_localResults.Errored += _blocksToRead; _localResults.Errored += _blocksToRead;
UnreadableSectors = $"{_localResults.Errored} sectors could not be read."; UnreadableSectors = string.Format(Localization.Core._0_sectors_could_not_be_read, _localResults.Errored);
BlockMapList.Add((sector / _blocksToRead, double.NaN)); BlockMapList.Add((sector / _blocksToRead, double.NaN));
}); });
@@ -642,11 +646,11 @@ public sealed class MediaScanViewModel : ViewModelBase
break; break;
} }
A = $"{_localResults.A} sectors took less than 3 ms."; A = string.Format(Localization.Core._0_sectors_took_less_than_3_ms, _localResults.A);
B = $"{_localResults.B} sectors took less than 10 ms but more than 3 ms."; B = string.Format(Localization.Core._0_sectors_took_less_than_10_ms_but_more_than_3_ms, _localResults.B);
C = $"{_localResults.C} sectors took less than 50 ms but more than 10 ms."; C = string.Format(Localization.Core._0_sectors_took_less_than_50_ms_but_more_than_10_ms, _localResults.C);
D = $"{_localResults.D} sectors took less than 150 ms but more than 50 ms."; D = string.Format(Localization.Core._0_sectors_took_less_than_150_ms_but_more_than_50_ms, _localResults.D);
E = $"{_localResults.E} sectors took less than 500 ms but more than 150 ms."; E = string.Format(Localization.Core._0_sectors_took_less_than_500_ms_but_more_than_150_ms, _localResults.E);
F = $"{_localResults.F} sectors took more than 500 ms."; F = string.Format(Localization.Core._0_sectors_took_more_than_500_ms, _localResults.F);
}); });
} }

View File

@@ -42,6 +42,7 @@ using Aaru.Database;
using Aaru.Gui.ViewModels.Dialogs; using Aaru.Gui.ViewModels.Dialogs;
using Aaru.Gui.Views.Dialogs; using Aaru.Gui.Views.Dialogs;
using Aaru.Gui.Views.Windows; using Aaru.Gui.Views.Windows;
using Aaru.Localization;
using Aaru.Settings; using Aaru.Settings;
using Avalonia.Threading; using Avalonia.Threading;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
@@ -78,7 +79,7 @@ public sealed class SplashWindowViewModel : ViewModelBase
internal void OnOpened() internal void OnOpened()
{ {
Message = "Welcome to Aaru!"; Message = UI.Welcome_to_Aaru;
MaxProgress = 9; MaxProgress = 9;
CurrentProgress = 0; CurrentProgress = 0;
@@ -88,12 +89,12 @@ public sealed class SplashWindowViewModel : ViewModelBase
void InitializeConsole() void InitializeConsole()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Initializing console..."; Message = UI.Initializing_console;
Task.Run(() => Task.Run(() =>
{ {
ConsoleHandler.Init(); ConsoleHandler.Init();
AaruConsole.WriteLine("Aaru started!"); AaruConsole.WriteLine(UI.Aaru_started);
Dispatcher.UIThread.Post(LoadSettings); Dispatcher.UIThread.Post(LoadSettings);
}); });
@@ -102,8 +103,8 @@ public sealed class SplashWindowViewModel : ViewModelBase
void LoadSettings() void LoadSettings()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Loading settings..."; Message = UI.Loading_settings;
AaruConsole.WriteLine("Loading settings..."); AaruConsole.WriteLine(UI.Loading_settings);
Task.Run(() => Task.Run(() =>
{ {
@@ -117,8 +118,8 @@ public sealed class SplashWindowViewModel : ViewModelBase
void MigrateLocalDatabase() void MigrateLocalDatabase()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Migrating local database..."; Message = UI.Migrating_local_database;
AaruConsole.WriteLine("Migrating local database..."); AaruConsole.WriteLine(UI.Migrating_local_database);
Task.Run(() => Task.Run(() =>
{ {
@@ -181,8 +182,8 @@ public sealed class SplashWindowViewModel : ViewModelBase
void UpdateMainDatabase() void UpdateMainDatabase()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Updating main database..."; Message = UI.Updating_main_database;
AaruConsole.WriteLine("Updating main database..."); AaruConsole.WriteLine(UI.Updating_main_database);
Task.Run(() => Task.Run(() =>
{ {
@@ -194,7 +195,7 @@ public sealed class SplashWindowViewModel : ViewModelBase
if(mainContext.Database.GetPendingMigrations().Any()) if(mainContext.Database.GetPendingMigrations().Any())
{ {
AaruConsole.WriteLine("New database version, updating..."); AaruConsole.WriteLine(UI.New_database_version_updating);
try try
{ {
@@ -202,9 +203,9 @@ public sealed class SplashWindowViewModel : ViewModelBase
} }
catch(Exception) catch(Exception)
{ {
AaruConsole.ErrorWriteLine("Exception trying to remove old database version, cannot continue..."); AaruConsole.ErrorWriteLine(UI.Exception_trying_to_remove_old_database_version);
AaruConsole.ErrorWriteLine("Please manually remove file at {0}", Settings.Settings.MainDbPath); AaruConsole.ErrorWriteLine(UI.Please_manually_remove_file_at_0, Settings.Settings.MainDbPath);
return; return;
} }
@@ -220,8 +221,8 @@ public sealed class SplashWindowViewModel : ViewModelBase
async void CheckGdprCompliance() async void CheckGdprCompliance()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Checking GDPR compliance..."; Message = UI.Checking_GDPR_compliance;
AaruConsole.WriteLine("Checking GDPR compliance..."); AaruConsole.WriteLine(UI.Checking_GDPR_compliance);
if(Settings.Settings.Current.GdprCompliance < DicSettings.GDPR_LEVEL) if(Settings.Settings.Current.GdprCompliance < DicSettings.GDPR_LEVEL)
{ {
@@ -237,8 +238,8 @@ public sealed class SplashWindowViewModel : ViewModelBase
void LoadStatistics() void LoadStatistics()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Loading statistics..."; Message = UI.Loading_statistics;
AaruConsole.WriteLine("Loading statistics..."); AaruConsole.WriteLine(UI.Loading_statistics);
Task.Run(() => Task.Run(() =>
{ {
@@ -251,8 +252,8 @@ public sealed class SplashWindowViewModel : ViewModelBase
void RegisterEncodings() void RegisterEncodings()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Registering encodings..."; Message = UI.Registering_encodings;
AaruConsole.WriteLine("Registering encodings..."); AaruConsole.WriteLine(UI.Registering_encodings);
Task.Run(() => Task.Run(() =>
{ {
@@ -265,8 +266,8 @@ public sealed class SplashWindowViewModel : ViewModelBase
void SaveStatistics() void SaveStatistics()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Saving statistics..."; Message = UI.Saving_statistics;
AaruConsole.WriteLine("Saving statistics..."); AaruConsole.WriteLine(UI.Saving_statistics);
Task.Run(() => Task.Run(() =>
{ {
@@ -279,8 +280,8 @@ public sealed class SplashWindowViewModel : ViewModelBase
void LoadMainWindow() void LoadMainWindow()
{ {
CurrentProgress++; CurrentProgress++;
Message = "Loading main window..."; Message = UI.Loading_main_window;
AaruConsole.WriteLine("Loading main window..."); AaruConsole.WriteLine(UI.Loading_main_window);
WorkFinished?.Invoke(this, EventArgs.Empty); WorkFinished?.Invoke(this, EventArgs.Empty);
} }

View File

@@ -33,6 +33,7 @@
using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces; using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers; using Aaru.Helpers;
using Aaru.Localization;
using JetBrains.Annotations; using JetBrains.Annotations;
using ReactiveUI; using ReactiveUI;
@@ -64,8 +65,8 @@ public sealed class ViewSectorViewModel : ViewModelBase
SectorNumber = 0; SectorNumber = 0;
} }
public string SectorLabel => "Sector"; public string SectorLabel => UI.Title_Sector;
public string LongSectorLabel => "Show long sector"; public string LongSectorLabel => UI.Show_long_sector;
public string Title public string Title
{ {

View File

@@ -129,22 +129,26 @@
<TextBlock Grid.Row="0" Text="{Binding ReadableLabel}" FontWeight="Bold" /> <TextBlock Grid.Row="0" Text="{Binding ReadableLabel}" FontWeight="Bold" />
<DataGrid Grid.Row="1" Items="{Binding Images}" HorizontalScrollBarVisibility="Visible"> <DataGrid Grid.Row="1" Items="{Binding Images}" HorizontalScrollBarVisibility="Visible">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="Auto" IsReadOnly="True" /> <DataGridTextColumn Header="{Binding NameLabel}" Binding="{Binding Name}" Width="Auto"
<DataGridTextColumn Header="UUID" Binding="{Binding Uuid}" Width="Auto" IsReadOnly="True" />
<DataGridTextColumn Header="Version" Binding="{Binding Version}" Width="Auto"
IsReadOnly="True" /> IsReadOnly="True" />
<DataGridTextColumn Header="Author" Binding="{Binding Author}" Width="Auto" <DataGridTextColumn Header="{Binding UUIDLabel}" Binding="{Binding Uuid}" Width="Auto"
IsReadOnly="True" />
<DataGridTextColumn Header="{Binding VersionLabel}" Binding="{Binding Version}"
Width="Auto" IsReadOnly="True" />
<DataGridTextColumn Header="{Binding AuthorLabel}" Binding="{Binding Author}" Width="Auto"
IsReadOnly="True" /> IsReadOnly="True" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<TextBlock Grid.Row="2" Text="{Binding WritableLabel}" FontWeight="Bold" /> <TextBlock Grid.Row="2" Text="{Binding WritableLabel}" FontWeight="Bold" />
<DataGrid Grid.Row="3" Items="{Binding WritableImages}" HorizontalScrollBarVisibility="Visible"> <DataGrid Grid.Row="3" Items="{Binding WritableImages}" HorizontalScrollBarVisibility="Visible">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="Auto" IsReadOnly="True" /> <DataGridTextColumn Header="{Binding NameLabel}" Binding="{Binding Name}" Width="Auto"
<DataGridTextColumn Header="UUID" Binding="{Binding Uuid}" Width="Auto" IsReadOnly="True" />
<DataGridTextColumn Header="Version" Binding="{Binding Version}" Width="Auto"
IsReadOnly="True" /> IsReadOnly="True" />
<DataGridTextColumn Header="Author" Binding="{Binding Author}" Width="Auto" <DataGridTextColumn Header="{Binding UUIDLabel}" Binding="{Binding Uuid}" Width="Auto"
IsReadOnly="True" />
<DataGridTextColumn Header="{Binding VersionLabel}" Binding="{Binding Version}"
Width="Auto" IsReadOnly="True" />
<DataGridTextColumn Header="{Binding AuthorLabel}" Binding="{Binding Author}" Width="Auto"
IsReadOnly="True" /> IsReadOnly="True" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
@@ -162,11 +166,13 @@
<TextBlock Grid.Row="0" Text="{Binding ReadableLabel}" FontWeight="Bold" /> <TextBlock Grid.Row="0" Text="{Binding ReadableLabel}" FontWeight="Bold" />
<DataGrid Grid.Row="1" Items="{Binding FloppyImages}" HorizontalScrollBarVisibility="Visible"> <DataGrid Grid.Row="1" Items="{Binding FloppyImages}" HorizontalScrollBarVisibility="Visible">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="Auto" IsReadOnly="True" /> <DataGridTextColumn Header="{Binding NameLabel}" Binding="{Binding Name}" Width="Auto"
<DataGridTextColumn Header="UUID" Binding="{Binding Uuid}" Width="Auto" IsReadOnly="True" />
<DataGridTextColumn Header="Version" Binding="{Binding Version}" Width="Auto"
IsReadOnly="True" /> IsReadOnly="True" />
<DataGridTextColumn Header="Author" Binding="{Binding Author}" Width="Auto" <DataGridTextColumn Header="{Binding UUIDLabel}" Binding="{Binding Uuid}" Width="Auto"
IsReadOnly="True" />
<DataGridTextColumn Header="{Binding VersionLabel}" Binding="{Binding Version}"
Width="Auto" IsReadOnly="True" />
<DataGridTextColumn Header="{Binding AuthorLabel}" Binding="{Binding Author}" Width="Auto"
IsReadOnly="True" /> IsReadOnly="True" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
@@ -174,11 +180,13 @@
<DataGrid Grid.Row="3" Items="{Binding WritableFloppyImages}" <DataGrid Grid.Row="3" Items="{Binding WritableFloppyImages}"
HorizontalScrollBarVisibility="Visible"> HorizontalScrollBarVisibility="Visible">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="Auto" IsReadOnly="True" /> <DataGridTextColumn Header="{Binding NameLabel}" Binding="{Binding Name}" Width="Auto"
<DataGridTextColumn Header="UUID" Binding="{Binding Uuid}" Width="Auto" IsReadOnly="True" />
<DataGridTextColumn Header="Version" Binding="{Binding Version}" Width="Auto"
IsReadOnly="True" /> IsReadOnly="True" />
<DataGridTextColumn Header="Author" Binding="{Binding Author}" Width="Auto" <DataGridTextColumn Header="{Binding UUIDLabel}" Binding="{Binding Uuid}" Width="Auto"
IsReadOnly="True" />
<DataGridTextColumn Header="{Binding VersionLabel}" Binding="{Binding Version}"
Width="Auto" IsReadOnly="True" />
<DataGridTextColumn Header="{Binding AuthorLabel}" Binding="{Binding Author}" Width="Auto"
IsReadOnly="True" /> IsReadOnly="True" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>

View File

@@ -365,7 +365,7 @@ sealed class DeviceInfoCommand : Command
if(dev.Type != DeviceType.ATAPI) if(dev.Type != DeviceType.ATAPI)
AaruConsole.WriteLine($"[bold]{UI.Title_SCSI_device}[/]"); AaruConsole.WriteLine($"[bold]{UI.Title_SCSI_device}[/]");
DataFile.WriteTo("Device-Info command", outputPrefix, "_scsi_inquiry.bin", "SCSI INQUIRY", DataFile.WriteTo("Device-Info command", outputPrefix, "_scsi_inquiry.bin", UI.Title_SCSI_INQUIRY,
devInfo.ScsiInquiryData); devInfo.ScsiInquiryData);
AaruConsole.WriteLine(Inquiry.Prettify(devInfo.ScsiInquiry)); AaruConsole.WriteLine(Inquiry.Prettify(devInfo.ScsiInquiry));
@@ -1026,7 +1026,7 @@ sealed class DeviceInfoCommand : Command
if(devInfo.DensitySupportHeader.HasValue) if(devInfo.DensitySupportHeader.HasValue)
{ {
AaruConsole.WriteLine("Densities supported by device:"); AaruConsole.WriteLine(UI.Densities_supported_by_device);
AaruConsole.WriteLine(DensitySupport.PrettifyDensity(devInfo.DensitySupportHeader)); AaruConsole.WriteLine(DensitySupport.PrettifyDensity(devInfo.DensitySupportHeader));
} }
} }
@@ -1038,7 +1038,7 @@ sealed class DeviceInfoCommand : Command
if(devInfo.MediaTypeSupportHeader.HasValue) if(devInfo.MediaTypeSupportHeader.HasValue)
{ {
AaruConsole.WriteLine("Medium types supported by device:"); AaruConsole.WriteLine(UI.Medium_types_supported_by_device);
AaruConsole.WriteLine(DensitySupport.PrettifyMediumType(devInfo.MediaTypeSupportHeader)); AaruConsole.WriteLine(DensitySupport.PrettifyMediumType(devInfo.MediaTypeSupportHeader));
} }

View File

@@ -267,7 +267,7 @@ sealed class FilesystemInfoCommand : Command
table.AddRow(UI.Title_Name, Markup.Escape(partitionsList[i].Name ?? "")); table.AddRow(UI.Title_Name, Markup.Escape(partitionsList[i].Name ?? ""));
table.AddRow(UI.Title_Type, Markup.Escape(partitionsList[i].Type ?? "")); table.AddRow(UI.Title_Type, Markup.Escape(partitionsList[i].Type ?? ""));
table.AddRow(UI.Title_Start, table.AddRow(Localization.Core.Title_Start,
string.Format(UI.sector_0_byte_1, partitionsList[i].Start, string.Format(UI.sector_0_byte_1, partitionsList[i].Start,
partitionsList[i].Offset)); partitionsList[i].Offset));

View File

@@ -302,7 +302,7 @@ sealed class ConvertImageCommand : Command
} }
catch(Exception ex) catch(Exception ex)
{ {
AaruConsole.ErrorWriteLine(UI.Incorrect_metadata_sidecar_file); AaruConsole.ErrorWriteLine(UI.Incorrect_metadata_sidecar_file_not_continuing);
AaruConsole.DebugWriteLine("Image conversion", $"{ex}"); AaruConsole.DebugWriteLine("Image conversion", $"{ex}");
return (int)ErrorNumber.InvalidSidecar; return (int)ErrorNumber.InvalidSidecar;
@@ -326,7 +326,7 @@ sealed class ConvertImageCommand : Command
} }
catch(Exception ex) catch(Exception ex)
{ {
AaruConsole.ErrorWriteLine(UI.Incorrect_resume_file); AaruConsole.ErrorWriteLine(UI.Incorrect_resume_file_not_continuing);
AaruConsole.DebugWriteLine("Image conversion", $"{ex}"); AaruConsole.DebugWriteLine("Image conversion", $"{ex}");
return (int)ErrorNumber.InvalidResume; return (int)ErrorNumber.InvalidResume;

View File

@@ -498,7 +498,7 @@ sealed class DumpMediaCommand : Command
} }
catch catch
{ {
AaruConsole.ErrorWriteLine(UI.Incorrect_metadata_sidecar_file); AaruConsole.ErrorWriteLine(UI.Incorrect_metadata_sidecar_file_not_continuing);
if(isResponse) if(isResponse)
continue; continue;

View File

@@ -364,7 +364,7 @@ sealed class MediaInfoCommand : Command
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_dds.bin", DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_dds.bin",
"SCSI READ DISC STRUCTURE", scsiInfo.DvdRamDds); "SCSI READ DISC STRUCTURE", scsiInfo.DvdRamDds);
AaruConsole.WriteLine($"[bold]{Localization.Core.Disc_Definition_Structure}:[/]", AaruConsole.WriteLine($"[bold]{UI.Disc_Definition_Structure}:[/]",
$"\n{Markup.Escape(DDS.Prettify(scsiInfo.DvdRamDds))}"); $"\n{Markup.Escape(DDS.Prettify(scsiInfo.DvdRamDds))}");
} }
@@ -382,7 +382,7 @@ sealed class MediaInfoCommand : Command
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_spare.bin", DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_spare.bin",
"SCSI READ DISC STRUCTURE", scsiInfo.DvdRamSpareArea); "SCSI READ DISC STRUCTURE", scsiInfo.DvdRamSpareArea);
AaruConsole.WriteLine($"[bold]{Localization.Core.Spare_Area_Information}:[/]", AaruConsole.WriteLine($"[bold]{UI.Spare_Area_Information}:[/]",
$"\n{Markup.Escape(Spare.Prettify(scsiInfo.DvdRamSpareArea))}"); $"\n{Markup.Escape(Spare.Prettify(scsiInfo.DvdRamSpareArea))}");
} }
@@ -533,7 +533,7 @@ sealed class MediaInfoCommand : Command
scsiInfo.Toc); scsiInfo.Toc);
if(scsiInfo.DecodedToc.HasValue) if(scsiInfo.DecodedToc.HasValue)
AaruConsole.WriteLine($"[bold]{Localization.Core.TOC}:[/]", AaruConsole.WriteLine($"[bold]{UI.Title_TOC}:[/]",
$"\n{Markup.Escape(TOC.Prettify(scsiInfo.DecodedToc))}"); $"\n{Markup.Escape(TOC.Prettify(scsiInfo.DecodedToc))}");
} }
@@ -543,7 +543,7 @@ sealed class MediaInfoCommand : Command
scsiInfo.Atip); scsiInfo.Atip);
if(scsiInfo.DecodedAtip != null) if(scsiInfo.DecodedAtip != null)
AaruConsole.WriteLine($"[bold]{Localization.Core.ATIP}:[/]", AaruConsole.WriteLine($"[bold]{UI.Title_ATIP}:[/]",
$"\n{Markup.Escape(ATIP.Prettify(scsiInfo.DecodedAtip))}"); $"\n{Markup.Escape(ATIP.Prettify(scsiInfo.DecodedAtip))}");
} }