Pass cart size thru humanizer.

This commit is contained in:
2025-08-20 00:24:20 +01:00
parent c867af6c2b
commit 5c6c362b2b
4 changed files with 14 additions and 38 deletions

View File

@@ -232,32 +232,8 @@ public partial class Dump
uint romSectors = romSize / 512; uint romSectors = romSize / 512;
uint romRemaining = romSize % 512; uint romRemaining = romSize % 512;
// TODO: Humanizer UpdateStatus?.Invoke(string.Format(Localization.Core.Cartridge_has_0_bytes_1, romSize,
switch(romSize) ByteSize.FromBytes(romSize).ToString("0.000")));
{
case > 1073741824:
UpdateStatus?.Invoke(string.Format(Localization.Core.Cartridge_has_0_bytes_1_GiB,
romSize,
romSize / 1073741824d));
break;
case > 1048576:
UpdateStatus?.Invoke(string.Format(Localization.Core.Cartridge_has_0_bytes_1_MiB,
romSize,
romSize / 1048576d));
break;
case > 1024:
UpdateStatus?.Invoke(string.Format(Localization.Core.Cartridge_has_0_bytes_1_KiB,
romSize,
romSize / 1024d));
break;
default:
UpdateStatus?.Invoke(string.Format(Localization.Core.Cartridge_has_0_bytes, romSize));
break;
}
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, mediaType)); UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, mediaType));

View File

@@ -6874,5 +6874,11 @@ namespace Aaru.Localization {
return ResourceManager.GetString("Running_in_0_architecture", resourceCulture); return ResourceManager.GetString("Running_in_0_architecture", resourceCulture);
} }
} }
public static string Cartridge_has_0_bytes_1 {
get {
return ResourceManager.GetString("Cartridge_has_0_bytes_1", resourceCulture);
}
}
} }
} }

View File

@@ -301,18 +301,6 @@
<data name="Card_specific_data_0" xml:space="preserve"> <data name="Card_specific_data_0" xml:space="preserve">
<value>Datos específicos de la tarjeta: 0x{0:X4}</value> <value>Datos específicos de la tarjeta: 0x{0:X4}</value>
</data> </data>
<data name="Cartridge_has_0_bytes" xml:space="preserve">
<value>[slateblue1]El cartucho tiene [lime]{0}[/] bytes[/]</value>
</data>
<data name="Cartridge_has_0_bytes_1_GiB" xml:space="preserve">
<value>[slateblue1]El cartucho tiene [lime]{0}[/] bytes ([lime]{1:F3}[/] GiB)[/]</value>
</data>
<data name="Cartridge_has_0_bytes_1_KiB" xml:space="preserve">
<value>[slateblue1]El cartucho tiene [lime]{0}[/] bytes ([lime]{1:F3}[/] KiB)[/]</value>
</data>
<data name="Cartridge_has_0_bytes_1_MiB" xml:space="preserve">
<value>[slateblue1]El cartucho tiene [lime]{0}[/] bytes ([lime]{1:F3}[/] MiB)[/]</value>
</data>
<data name="CD_read_speed_limited_to_0" xml:space="preserve"> <data name="CD_read_speed_limited_to_0" xml:space="preserve">
<value>[slateblue1]Velocidad de lectura de CD limitada a [teal]{0}x[/][/]</value> <value>[slateblue1]Velocidad de lectura de CD limitada a [teal]{0}x[/][/]</value>
</data> </data>
@@ -3484,4 +3472,7 @@ No tiene sentido hacerlo y supondría demasiado esfuerzo para la cinta.</value>
<data name="Filesystems_Identify_Error" xml:space="preserve"> <data name="Filesystems_Identify_Error" xml:space="preserve">
<value>Error {0} identificando el sistema de ficheros. Por favor abra un reporte con la siguiente línea en Github.</value> <value>Error {0} identificando el sistema de ficheros. Por favor abra un reporte con la siguiente línea en Github.</value>
</data> </data>
<data name="Cartridge_has_0_bytes_1" xml:space="preserve">
<value>[slateblue1]El cartucho tiene [lime]{0} bytes[/] ([lime]{1}[/]).[/]</value>
</data>
</root> </root>

View File

@@ -3508,4 +3508,7 @@ It has no sense to do it, and it will put too much strain on the tape.</value>
<data name="Running_in_0_architecture" xml:space="preserve"> <data name="Running_in_0_architecture" xml:space="preserve">
<value>Running in {0} architecture</value> <value>Running in {0} architecture</value>
</data> </data>
<data name="Cartridge_has_0_bytes_1" xml:space="preserve">
<value>[slateblue1]Cartridge has [lime]{0} bytes[/] ([lime]{1}[/]).[/]</value>
</data>
</root> </root>