mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move all localizable strings from Aaru.Images project to resources.
This commit is contained in:
@@ -52,14 +52,14 @@ public sealed partial class Qcow
|
||||
{
|
||||
if(sectorSize != 512)
|
||||
{
|
||||
ErrorMessage = "Unsupported sector size";
|
||||
ErrorMessage = Localization.Unsupported_sector_size;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!SupportedMediaTypes.Contains(mediaType))
|
||||
{
|
||||
ErrorMessage = $"Unsupported media format {mediaType}";
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public sealed partial class Qcow
|
||||
// TODO: Correct this calculation
|
||||
if(sectors * sectorSize / 65536 > uint.MaxValue)
|
||||
{
|
||||
ErrorMessage = "Too many sectors for selected cluster size";
|
||||
ErrorMessage = Localization.Too_many_sectors_for_selected_cluster_size;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public sealed partial class Qcow
|
||||
}
|
||||
catch(IOException e)
|
||||
{
|
||||
ErrorMessage = $"Could not create new image file, exception {e.Message}";
|
||||
ErrorMessage = string.Format(Localization.Could_not_create_new_image_file_exception_0, e.Message);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ public sealed partial class Qcow
|
||||
/// <inheritdoc />
|
||||
public bool WriteMediaTag(byte[] data, MediaTagType tag)
|
||||
{
|
||||
ErrorMessage = "Writing media tags is not supported.";
|
||||
ErrorMessage = Localization.Writing_media_tags_is_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -157,21 +157,21 @@ public sealed partial class Qcow
|
||||
{
|
||||
if(!IsWriting)
|
||||
{
|
||||
ErrorMessage = "Tried to write on a non-writable image";
|
||||
ErrorMessage = Localization.Tried_to_write_on_a_non_writable_image;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(data.Length != _imageInfo.SectorSize)
|
||||
{
|
||||
ErrorMessage = "Incorrect data size";
|
||||
ErrorMessage = Localization.Incorrect_data_size;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectorAddress >= _imageInfo.Sectors)
|
||||
{
|
||||
ErrorMessage = "Tried to write past image size";
|
||||
ErrorMessage = Localization.Tried_to_write_past_image_size;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -186,7 +186,8 @@ public sealed partial class Qcow
|
||||
|
||||
if((long)l1Off >= _l1Table.LongLength)
|
||||
{
|
||||
ErrorMessage = $"Trying to write past L1 table, position {l1Off} of a max {_l1Table.LongLength}";
|
||||
ErrorMessage = string.Format(Localization.Trying_to_write_past_L1_table_position_0_of_a_max_1, l1Off,
|
||||
_l1Table.LongLength);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -235,21 +236,21 @@ public sealed partial class Qcow
|
||||
{
|
||||
if(!IsWriting)
|
||||
{
|
||||
ErrorMessage = "Tried to write on a non-writable image";
|
||||
ErrorMessage = Localization.Tried_to_write_on_a_non_writable_image;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(data.Length % _imageInfo.SectorSize != 0)
|
||||
{
|
||||
ErrorMessage = "Incorrect data size";
|
||||
ErrorMessage = Localization.Incorrect_data_size;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(sectorAddress + length > _imageInfo.Sectors)
|
||||
{
|
||||
ErrorMessage = "Tried to write past image size";
|
||||
ErrorMessage = Localization.Tried_to_write_past_image_size;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -275,7 +276,7 @@ public sealed partial class Qcow
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectorLong(byte[] data, ulong sectorAddress)
|
||||
{
|
||||
ErrorMessage = "Writing sectors with tags is not supported.";
|
||||
ErrorMessage = Localization.Writing_sectors_with_tags_is_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -283,7 +284,7 @@ public sealed partial class Qcow
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length)
|
||||
{
|
||||
ErrorMessage = "Writing sectors with tags is not supported.";
|
||||
ErrorMessage = Localization.Writing_sectors_with_tags_is_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -293,7 +294,7 @@ public sealed partial class Qcow
|
||||
{
|
||||
if(!IsWriting)
|
||||
{
|
||||
ErrorMessage = "Image is not opened for writing";
|
||||
ErrorMessage = Localization.Image_is_not_opened_for_writing;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -339,7 +340,7 @@ public sealed partial class Qcow
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag)
|
||||
{
|
||||
ErrorMessage = "Writing sectors with tags is not supported.";
|
||||
ErrorMessage = Localization.Writing_sectors_with_tags_is_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -347,7 +348,7 @@ public sealed partial class Qcow
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag)
|
||||
{
|
||||
ErrorMessage = "Writing sectors with tags is not supported.";
|
||||
ErrorMessage = Localization.Writing_sectors_with_tags_is_not_supported;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user