From 9411af886b18f7e7ee4d6a1628c205f3b7f8e2d5 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 5 Jul 2026 11:06:45 +0100 Subject: [PATCH] Add coloring and localization. --- Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs | 15 ++-- Aaru.Core/Devices/Dumping/MMC.cs | 4 +- Aaru.Localization/Core.Designer.cs | 74 ++++++++++++------- Aaru.Localization/Core.es.resx | 4 +- Aaru.Localization/Core.resx | 4 +- Aaru.Localization/UI.Designer.cs | 36 +++++++++ Aaru.Localization/UI.es.resx | 18 +++++ Aaru.Localization/UI.resx | 18 +++++ Aaru/Commands/Media/Dump.cs | 6 +- 9 files changed, 137 insertions(+), 42 deletions(-) diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs index ddd522bda..306285fd3 100644 --- a/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs +++ b/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs @@ -50,6 +50,7 @@ using Aaru.Database.Models; using Aaru.Decoders.CD; using Aaru.Devices; using Aaru.Images; +using Aaru.Localization; using Aaru.Logging; using Humanizer; using Spectre.Console; @@ -675,9 +676,8 @@ sealed partial class Dump foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub); if(_resume.NextBlock < blocks) - { - for(ulong i = _resume.NextBlock; i < blocks; i++) subchannelExtents.Add((int)i); - } + for(ulong i = _resume.NextBlock; i < blocks; i++) + subchannelExtents.Add((int)i); } if(_resume.NextBlock > 0) @@ -1168,9 +1168,8 @@ sealed partial class Dump supportsLongSectors); foreach(Tuple leadoutExtent in leadOutExtents.ToArray()) - { - for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) subchannelExtents.Remove((int)e); - } + for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) + subchannelExtents.Remove((int)e); if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel) { @@ -1349,8 +1348,8 @@ sealed partial class Dump if(_omnidrive) { - UpdateStatus?.Invoke($"{_correctSectors} sectors were correct when read."); - UpdateStatus?.Invoke($"{_fixedSectors} sectors had to be fixed."); + UpdateStatus?.Invoke(string.Format(UI._0_sectors_were_correct_when_read, _correctSectors)); + UpdateStatus?.Invoke(string.Format(UI._0_sectors_had_to_be_fixed, _fixedSectors)); } UpdateStatus?.Invoke(string.Format(Localization.Core._0_sectors_could_not_be_read, _resume.BadBlocks.Count)); diff --git a/Aaru.Core/Devices/Dumping/MMC.cs b/Aaru.Core/Devices/Dumping/MMC.cs index 635f59829..8ac054518 100644 --- a/Aaru.Core/Devices/Dumping/MMC.cs +++ b/Aaru.Core/Devices/Dumping/MMC.cs @@ -45,6 +45,7 @@ using Aaru.Decoders.SCSI.MMC; using Aaru.Decryption; using Aaru.Decryption.DVD; using Aaru.Devices; +using Aaru.Localization; using Aaru.Logging; using DDS = Aaru.Decoders.DVD.DDS; using DMI = Aaru.Decoders.Xbox.DMI; @@ -300,8 +301,7 @@ partial class Dump _omnidrive = _dev.IsOmniDriveFirmware(out byte odMajor, out byte odMinor, out byte odRevision); - if(_omnidrive) - AaruLogging.WriteLine($"[slateblue1]Detected [/][#FFFFFF]O[/][#FFAFC8]m[/][#74D7EE]n[/][#E40303]i[/][#FF8C00]D[/][#FFED00]r[/][#008026]i[/][#004DFF]v[/][#750787]e[/][#613915]![/][000000]![/] [slateblue1]version[/] [purple]{odMajor}.{odMinor}.{odRevision}[/]"); + if(_omnidrive) AaruLogging.WriteLine(string.Format(UI.Detected_Omnidrive, odMajor, odMinor, odRevision)); if(compactDisc) { diff --git a/Aaru.Localization/Core.Designer.cs b/Aaru.Localization/Core.Designer.cs index f82327f6f..e52401578 100644 --- a/Aaru.Localization/Core.Designer.cs +++ b/Aaru.Localization/Core.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -1022,7 +1022,7 @@ namespace Aaru.Localization { return ResourceManager.GetString("Contains_a_media_of_0_sectors_with_a_maximum_sector_size_of_1_bytes_etc", resourceCulture); } } - + public static string Image_has_0_leadin_and_1_leadout_sectors_WithMarkup { get { return ResourceManager.GetString("Image_has_0_leadin_and_1_leadout_sectors_WithMarkup", resourceCulture); @@ -2221,6 +2221,12 @@ namespace Aaru.Localization { } } + public static string Cannot_write_retried_sector_0_no_writable_output_image { + get { + return ResourceManager.GetString("Cannot_write_retried_sector_0_no_writable_output_image", resourceCulture); + } + } + public static string Could_not_detect_capacity { get { return ResourceManager.GetString("Could_not_detect_capacity", resourceCulture); @@ -2758,6 +2764,30 @@ namespace Aaru.Localization { } } + public static string Nintendo_OmniDrive_dump_requires_Aaru_format { + get { + return ResourceManager.GetString("Nintendo_OmniDrive_dump_requires_Aaru_format", resourceCulture); + } + } + + public static string Ngcw_dump_parsing_partition_table { + get { + return ResourceManager.GetString("Ngcw_dump_parsing_partition_table", resourceCulture); + } + } + + public static string Ngcw_dump_wrote_partition_key_map { + get { + return ResourceManager.GetString("Ngcw_dump_wrote_partition_key_map", resourceCulture); + } + } + + public static string Ngcw_dump_wrote_junk_map_0_entries { + get { + return ResourceManager.GetString("Ngcw_dump_wrote_junk_map_0_entries", resourceCulture); + } + } + public static string Reading_Disc_Manufacturing_Information { get { return ResourceManager.GetString("Reading_Disc_Manufacturing_Information", resourceCulture); @@ -3113,12 +3143,6 @@ namespace Aaru.Localization { } } - public static string Cannot_write_retried_sector_0_no_writable_output_image { - get { - return ResourceManager.GetString("Cannot_write_retried_sector_0_no_writable_output_image", resourceCulture); - } - } - public static string Cannot_write_SCR_to_output_image { get { return ResourceManager.GetString("Cannot_write_SCR_to_output_image", resourceCulture); @@ -6934,103 +6958,103 @@ namespace Aaru.Localization { return ResourceManager.GetString("Media_tag_0_present_in_primary_image_will_be_lost", resourceCulture); } } - + public static string Reading_lead_in_sectors { get { return ResourceManager.GetString("Reading_lead_in_sectors", resourceCulture); } } - + public static string Reading_lead_out_sectors { get { return ResourceManager.GetString("Reading_lead_out_sectors", resourceCulture); } } - + public static string Reading_data_sectors { get { return ResourceManager.GetString("Reading_data_sectors", resourceCulture); } } - + public static string Output_format_not_initialized { get { return ResourceManager.GetString("Output_format_not_initialized", resourceCulture); } } - + public static string Aacs_missing_volume_unique_key { get { return ResourceManager.GetString("Aacs_missing_volume_unique_key", resourceCulture); } } - + public static string Aacs_missing_unit_keys { get { return ResourceManager.GetString("Aacs_missing_unit_keys", resourceCulture); } } - + public static string Aacs_unit_key_inf_invalid { get { return ResourceManager.GetString("Aacs_unit_key_inf_invalid", resourceCulture); } } - + public static string Aacs_encrypted_unit_key_invalid_length { get { return ResourceManager.GetString("Aacs_encrypted_unit_key_invalid_length", resourceCulture); } } - + public static string Aacs2_unit_keys_not_supported { get { return ResourceManager.GetString("Aacs2_unit_keys_not_supported", resourceCulture); } } - + public static string Aacs_hddvd_not_supported { get { return ResourceManager.GetString("Aacs_hddvd_not_supported", resourceCulture); } } - + public static string Aacs_incomplete_cps_unit_at_track_end { get { return ResourceManager.GetString("Aacs_incomplete_cps_unit_at_track_end", resourceCulture); } } - + public static string Aacs_incomplete_cps_unit_at_track_end_continuing { get { return ResourceManager.GetString("Aacs_incomplete_cps_unit_at_track_end_continuing", resourceCulture); } } - + public static string Aacs_incomplete_cps_unit_pending_before_read_error { get { return ResourceManager.GetString("Aacs_incomplete_cps_unit_pending_before_read_error", resourceCulture); } } - + public static string Aacs_incomplete_cps_unit_after_read_error_continuing { get { return ResourceManager.GetString("Aacs_incomplete_cps_unit_after_read_error_continuing", resourceCulture); } } - + public static string Aacs_could_not_decrypt_cps_unit_starting_at_0 { get { return ResourceManager.GetString("Aacs_could_not_decrypt_cps_unit_starting_at_0", resourceCulture); } } - + public static string Aacs_could_not_decrypt_cps_unit_starting_at_0_continuing { get { return ResourceManager.GetString("Aacs_could_not_decrypt_cps_unit_starting_at_0_continuing", resourceCulture); } } - + public static string Aacs_bd_decrypt_requires_0_byte_sectors { get { return ResourceManager.GetString("Aacs_bd_decrypt_requires_0_byte_sectors", resourceCulture); diff --git a/Aaru.Localization/Core.es.resx b/Aaru.Localization/Core.es.resx index f51bef025..eba75ad0d 100644 --- a/Aaru.Localization/Core.es.resx +++ b/Aaru.Localization/Core.es.resx @@ -2199,7 +2199,7 @@ Leyendo LBA 0... - Leyendo Lead-Outs + [slateblue1]Leyendo Lead-Outs[/] [slateblue1]Leyendo CIS de PCMCIA.[/] @@ -2211,7 +2211,7 @@ [slateblue1]Leyendo directorio raíz en el sector [lime]{0}[/]...[/] - Leyendo sector {0} en el Lead-Out ({1}) + [slateblue1]Leyendo sector [lime]{0}[/] en el Lead-Out ([aqua]{1}[/])[/] [slateblue1]Leyendo sector [lime]{0}[/] de [violet]{1}[/] ([aqua]{2}[/])[/] diff --git a/Aaru.Localization/Core.resx b/Aaru.Localization/Core.resx index 633647b5e..ebb74d0a8 100644 --- a/Aaru.Localization/Core.resx +++ b/Aaru.Localization/Core.resx @@ -972,10 +972,10 @@ [slateblue1]Correctly retried sector [lime]{0}[/] subchannel in pass [teal]{1}[/].[/] - Reading lead-outs + [slateblue1]Reading lead-outs[/] - Reading sector {0} at lead-out ({1}) + [slateblue1]Reading sector [lime]{0}[/] at lead-out ([aqua]{1}[/])[/] [slateblue1]Reading first track pregap[/] diff --git a/Aaru.Localization/UI.Designer.cs b/Aaru.Localization/UI.Designer.cs index 82b9b88ad..6e0d02978 100644 --- a/Aaru.Localization/UI.Designer.cs +++ b/Aaru.Localization/UI.Designer.cs @@ -11351,5 +11351,41 @@ namespace Aaru.Localization { return ResourceManager.GetString("Filesystem_contents_cannot_be_extracted", resourceCulture); } } + + public static string _0_sectors_were_correct_when_read { + get { + return ResourceManager.GetString("_0_sectors_were_correct_when_read", resourceCulture); + } + } + + public static string _0_sectors_had_to_be_fixed { + get { + return ResourceManager.GetString("_0_sectors_had_to_be_fixed", resourceCulture); + } + } + + public static string Help_hyperspeed { + get { + return ResourceManager.GetString("Help_hyperspeed", resourceCulture); + } + } + + public static string Help_absurdspeed { + get { + return ResourceManager.GetString("Help_absurdspeed", resourceCulture); + } + } + + public static string Help_Leadout { + get { + return ResourceManager.GetString("Help_Leadout", resourceCulture); + } + } + + public static string Detected_Omnidrive { + get { + return ResourceManager.GetString("Detected_Omnidrive", resourceCulture); + } + } } } diff --git a/Aaru.Localization/UI.es.resx b/Aaru.Localization/UI.es.resx index f8dae7692..a5aa92d62 100644 --- a/Aaru.Localization/UI.es.resx +++ b/Aaru.Localization/UI.es.resx @@ -5671,4 +5671,22 @@ Probadores: [slateblue1]El contenido del sistema de ficheros no puede ser extraído.[/] + + [maroon][teal]{0}[/] sectores eran correctos al leerlos.[/] + + + [maroon][teal]{0}[/] sectores tuvieron que ser corregidos.[/] + + + (Sólo OmniDrive) Permite mayores velocidades cuando sabemos que la pista es de datos + + + (Sólo OmniDrive) Usar siempre la máxima velocidad + + + Volcar sectores de Lead-Out si la unidad y la imagen los soportan. + + + [slateblue1]Detectada [/][#FFFFFF]O[/][#FFAFC8]m[/][#74D7EE]n[/][#E40303]i[/][#FF8C00]D[/][#FFED00]r[/][#008026]i[/][#004DFF]v[/][#750787]e[/][#613915]![/][000000]![/] [slateblue1]versión[/] [purple]{0}.{1}.{2}[/] + \ No newline at end of file diff --git a/Aaru.Localization/UI.resx b/Aaru.Localization/UI.resx index 030592b3e..0b3573819 100644 --- a/Aaru.Localization/UI.resx +++ b/Aaru.Localization/UI.resx @@ -5755,4 +5755,22 @@ Do you want to continue? [slateblue1]Filesystem contents cannot be extracted.[/] + + [maroon][teal]{0}[/] sectors were correct when read.[/] + + + [maroon][teal]{0}[/] sectors had to be fixed.[/] + + + (OmniDrive only) Allows higher speed when we know the underlying track is data + + + (OmniDrive only) Use maximum speed always + + + Dump Lead-Out sectors if drive and image supports it. + + + [slateblue1]Detected [/][#FFFFFF]O[/][#FFAFC8]m[/][#74D7EE]n[/][#E40303]i[/][#FF8C00]D[/][#FFED00]r[/][#008026]i[/][#004DFF]v[/][#750787]e[/][#613915]![/][000000]![/] [slateblue1]version[/] [purple]{0}.{1}.{2}[/] + \ No newline at end of file diff --git a/Aaru/Commands/Media/Dump.cs b/Aaru/Commands/Media/Dump.cs index 807230048..5cb80a271 100644 --- a/Aaru/Commands/Media/Dump.cs +++ b/Aaru/Commands/Media/Dump.cs @@ -836,15 +836,15 @@ sealed class DumpMediaCommand : Command [DefaultValue(0)] [CommandOption("--error-recovery")] public int ErrorRecovery { get; set; } - [Description("(OmniDrive only) Allows higher speed when we know the underlying track is data")] + [LocalizedDescription(nameof(UI.Help_hyperspeed))] [DefaultValue(false)] [CommandOption("--hyper-speed")] public bool HyperSpeed { get; set; } - [Description("(OmniDrive only) Use maximum speed always")] + [LocalizedDescription(nameof(UI.Help_absurdspeed))] [DefaultValue(false)] [CommandOption("--absurd-speed")] public bool AbsurdSpeed { get; set; } - [Description("Dump Lead-Out sectors if drive and image supports it.")] + [LocalizedDescription(nameof(UI.Help_Leadout))] [DefaultValue(false)] [CommandOption("--lead-out")] public bool LeadOut { get; set; }