diff --git a/Aaru.Images/Localization/Localization.Designer.cs b/Aaru.Images/Localization/Localization.Designer.cs index 74a9b5e87..8709df02a 100644 --- a/Aaru.Images/Localization/Localization.Designer.cs +++ b/Aaru.Images/Localization/Localization.Designer.cs @@ -504,6 +504,15 @@ internal static string Block_pattern_decoder_Processed_Output_0_bytes { } } + /// + /// Looks up a localized string similar to Block size too small for number of sectors, try with a bigger value.. + /// + internal static string Block_size_too_small_for_number_of_sectors { + get { + return ResourceManager.GetString("Block_size_too_small_for_number_of_sectors", resourceCulture); + } + } + /// /// Looks up a localized string similar to Block type {0} with data type {1} is indexed to be at {2}. /// @@ -1602,6 +1611,15 @@ internal static string CRC2_0 { } } + /// + /// Looks up a localized string similar to Create a dynamic image, empty sectors are ignored. + /// + internal static string Create_a_dynamic_image { + get { + return ResourceManager.GetString("Create_a_dynamic_image", resourceCulture); + } + } + /// /// Looks up a localized string similar to Creator: "{0}". /// @@ -4699,6 +4717,15 @@ internal static string Invalid_adapter_type_0 { } } + /// + /// Looks up a localized string similar to Invalid block size.. + /// + internal static string Invalid_block_size { + get { + return ResourceManager.GetString("Invalid_block_size", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid compression type {0} for block with data type {1}, continuing.... /// @@ -4807,6 +4834,15 @@ internal static string Invalid_value_for_dictionary_option { } } + /// + /// Looks up a localized string similar to Invalid value for dynamic option.. + /// + internal static string Invalid_value_for_dynamic_option { + get { + return ResourceManager.GetString("Invalid_value_for_dynamic_option", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid value for hwversion option. /// @@ -8235,6 +8271,15 @@ internal static string Version_0_1 { } } + /// + /// Looks up a localized string similar to Block size. Must be a power of 2. Only 2MiB and 512KiB are supported by VirtualPC. + /// + internal static string Vhd_Block_size_Must_be_a_power_of_2 { + get { + return ResourceManager.GetString("Vhd_Block_size_Must_be_a_power_of_2", resourceCulture); + } + } + /// /// Looks up a localized string similar to Virtual PC. /// diff --git a/Aaru.Images/Localization/Localization.es.resx b/Aaru.Images/Localization/Localization.es.resx index 7feb7eab5..ac9255866 100644 --- a/Aaru.Images/Localization/Localization.es.resx +++ b/Aaru.Images/Localization/Localization.es.resx @@ -2934,4 +2934,19 @@ 5, 6 ó 7 + + Tamaño del bloque demasiado pequeño para el número de sectores, intenta uno mayor. + + + Tamaño de bloque no válido. + + + Valor no válido para opción dinámica. + + + Tamaño de bloque. Debe ser potencia de 2. VirtualPC sólo soporta 2MiB y 512KiB + + + Crear una imagen dinámica, los sectores vacíos se ignoran + \ No newline at end of file diff --git a/Aaru.Images/Localization/Localization.resx b/Aaru.Images/Localization/Localization.resx index ed45147da..9df8aa6d3 100644 --- a/Aaru.Images/Localization/Localization.resx +++ b/Aaru.Images/Localization/Localization.resx @@ -2944,4 +2944,19 @@ A2R + + Invalid block size. + + + Invalid value for dynamic option. + + + Block size too small for number of sectors, try with a bigger value. + + + Create a dynamic image, empty sectors are ignored + + + Block size. Must be a power of 2. Only 2MiB and 512KiB are supported by VirtualPC + \ No newline at end of file diff --git a/Aaru.Images/VHD/Properties.cs b/Aaru.Images/VHD/Properties.cs index 6c4aae068..5835b9ed7 100644 --- a/Aaru.Images/VHD/Properties.cs +++ b/Aaru.Images/VHD/Properties.cs @@ -88,9 +88,8 @@ public sealed partial class Vhd /// public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions => new[] { - ("dynamic", typeof(bool), "Create a dynamic image, empty sectors are ignored", (object)true), - ("block_size", typeof(uint), - "Block size. Must be a power of 2. Only 2MiB and 512KiB are supported by VirtualPC", 2097152) + ("dynamic", typeof(bool), Localization.Create_a_dynamic_image, (object)true), + ("block_size", typeof(uint), Localization.Vhd_Block_size_Must_be_a_power_of_2, 2097152) }; /// diff --git a/Aaru.Images/VHD/Write.cs b/Aaru.Images/VHD/Write.cs index 1d01abfdc..12915c7d3 100644 --- a/Aaru.Images/VHD/Write.cs +++ b/Aaru.Images/VHD/Write.cs @@ -62,7 +62,7 @@ public bool Create(string path, MediaType mediaType, Dictionary { if(!uint.TryParse(tmpValue, out _blockSize)) { - ErrorMessage = "Invalid block size."; + ErrorMessage = Localization.Invalid_block_size; return false; } @@ -74,7 +74,7 @@ public bool Create(string path, MediaType mediaType, Dictionary { if(!bool.TryParse(tmpValue, out _dynamic)) { - ErrorMessage = "Invalid option for dynamic image."; + ErrorMessage = Localization.Invalid_value_for_dynamic_option; return false; } @@ -155,7 +155,7 @@ public bool Create(string path, MediaType mediaType, Dictionary if(numberOfBlocks > uint.MaxValue) { - ErrorMessage = "Block size too small for number of sectors, try with a bigger value."; + ErrorMessage = Localization.Block_size_too_small_for_number_of_sectors; return false; } @@ -231,7 +231,7 @@ public bool WriteSector(byte[] data, ulong sectorAddress) _writingStream.Seek((long)(0 + sectorAddress * 512), SeekOrigin.Begin); _writingStream.Write(data, 0, data.Length); - ErrorMessage = ""; + ErrorMessage = string.Empty; return true; } @@ -389,7 +389,7 @@ public bool WriteSectors(byte[] data, ulong sectorAddress, uint length) _writingStream.Seek((long)(0 + sectorAddress * 512), SeekOrigin.Begin); _writingStream.Write(data, 0, data.Length); - ErrorMessage = ""; + ErrorMessage = string.Empty; return true; } @@ -426,7 +426,7 @@ public bool Close() _writingStream.Close(); IsWriting = false; - ErrorMessage = ""; + ErrorMessage = string.Empty; return true; }