mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move all localizable strings from Aaru.Filesystems project to resources.
This commit is contained in:
@@ -42,27 +42,29 @@ namespace Aaru.Filesystems;
|
||||
/// <summary>Implements the Apple DOS 3 filesystem</summary>
|
||||
public sealed partial class AppleDOS : IReadOnlyFilesystem
|
||||
{
|
||||
bool _debug;
|
||||
IMediaImage _device;
|
||||
bool _mounted;
|
||||
int _sectorsPerTrack;
|
||||
ulong _start;
|
||||
ulong _totalFileEntries;
|
||||
bool _track1UsedByFiles;
|
||||
bool _track2UsedByFiles;
|
||||
uint _usedSectors;
|
||||
Vtoc _vtoc;
|
||||
// Do not translate
|
||||
const string FS_TYPE = "appledos";
|
||||
bool _debug;
|
||||
IMediaImage _device;
|
||||
bool _mounted;
|
||||
int _sectorsPerTrack;
|
||||
ulong _start;
|
||||
ulong _totalFileEntries;
|
||||
bool _track1UsedByFiles;
|
||||
bool _track2UsedByFiles;
|
||||
uint _usedSectors;
|
||||
Vtoc _vtoc;
|
||||
|
||||
/// <inheritdoc />
|
||||
public FileSystemType XmlFsType { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => "Apple DOS File System";
|
||||
public string Name => Localization.AppleDOS_Name;
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n");
|
||||
/// <inheritdoc />
|
||||
public string Author => "Natalia Portillo";
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<(string name, Type type, string description)> SupportedOptions =>
|
||||
|
||||
@@ -83,20 +83,21 @@ public sealed partial class AppleDOS
|
||||
|
||||
_vtoc = Marshal.ByteArrayToStructureLittleEndian<Vtoc>(vtocB);
|
||||
|
||||
sb.AppendLine("Apple DOS File System");
|
||||
sb.AppendLine(Localization.AppleDOS_Name);
|
||||
sb.AppendLine();
|
||||
|
||||
sb.AppendFormat("Catalog starts at sector {0} of track {1}", _vtoc.catalogSector, _vtoc.catalogTrack).
|
||||
sb.AppendFormat(Localization.Catalog_starts_at_sector_0_of_track_1, _vtoc.catalogSector, _vtoc.catalogTrack).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat("File system initialized by DOS release {0}", _vtoc.dosRelease).AppendLine();
|
||||
sb.AppendFormat("Disk volume number {0}", _vtoc.volumeNumber).AppendLine();
|
||||
sb.AppendFormat("Sectors allocated at most in track {0}", _vtoc.lastAllocatedSector).AppendLine();
|
||||
sb.AppendFormat("{0} tracks in volume", _vtoc.tracks).AppendLine();
|
||||
sb.AppendFormat("{0} sectors per track", _vtoc.sectorsPerTrack).AppendLine();
|
||||
sb.AppendFormat("{0} bytes per sector", _vtoc.bytesPerSector).AppendLine();
|
||||
sb.AppendFormat(Localization.File_system_initialized_by_DOS_release_0, _vtoc.dosRelease).AppendLine();
|
||||
sb.AppendFormat(Localization.Disk_volume_number_0, _vtoc.volumeNumber).AppendLine();
|
||||
sb.AppendFormat(Localization.Sectors_allocated_at_most_in_track_0, _vtoc.lastAllocatedSector).AppendLine();
|
||||
sb.AppendFormat(Localization._0_tracks_in_volume, _vtoc.tracks).AppendLine();
|
||||
sb.AppendFormat(Localization._0_sectors_per_track, _vtoc.sectorsPerTrack).AppendLine();
|
||||
sb.AppendFormat(Localization._0_bytes_per_sector, _vtoc.bytesPerSector).AppendLine();
|
||||
|
||||
sb.AppendFormat("Track allocation is {0}", _vtoc.allocationDirection > 0 ? "forward" : "reverse").AppendLine();
|
||||
sb.AppendLine(_vtoc.allocationDirection > 0 ? Localization.Track_allocation_is_forward
|
||||
: Localization.Track_allocation_is_reverse);
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
@@ -105,7 +106,7 @@ public sealed partial class AppleDOS
|
||||
Bootable = true,
|
||||
Clusters = imagePlugin.Info.Sectors,
|
||||
ClusterSize = imagePlugin.Info.SectorSize,
|
||||
Type = "Apple DOS"
|
||||
Type = FS_TYPE
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -56,21 +56,21 @@ public sealed partial class AppleDOS
|
||||
if(_device.Info.Sectors != 455 &&
|
||||
_device.Info.Sectors != 560)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", "Incorrect device size.");
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Incorrect_device_size);
|
||||
|
||||
return ErrorNumber.InOutError;
|
||||
}
|
||||
|
||||
if(_start > 0)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", "Partitions are not supported.");
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Partitions_are_not_supported);
|
||||
|
||||
return ErrorNumber.InOutError;
|
||||
}
|
||||
|
||||
if(_device.Info.SectorSize != 256)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", "Incorrect sector size.");
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Incorrect_sector_size);
|
||||
|
||||
return ErrorNumber.InOutError;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public sealed partial class AppleDOS
|
||||
|
||||
if(error != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", "Unable to read catalog.");
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Unable_to_read_catalog);
|
||||
|
||||
return error;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public sealed partial class AppleDOS
|
||||
|
||||
if(error != ErrorNumber.NoError)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", "Unable cache all files.");
|
||||
AaruConsole.DebugWriteLine("Apple DOS plugin", Localization.Unable_cache_all_files);
|
||||
|
||||
return error;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public sealed partial class AppleDOS
|
||||
Files = (ulong)_catalogCache.Count,
|
||||
FilesSpecified = true,
|
||||
FreeClustersSpecified = true,
|
||||
Type = "Apple DOS"
|
||||
Type = FS_TYPE
|
||||
};
|
||||
|
||||
XmlFsType.FreeClusters = XmlFsType.Clusters - _usedSectors;
|
||||
@@ -152,7 +152,7 @@ public sealed partial class AppleDOS
|
||||
FilenameLength = 30,
|
||||
Files = (ulong)_catalogCache.Count,
|
||||
PluginId = Id,
|
||||
Type = "Apple DOS"
|
||||
Type = FS_TYPE
|
||||
};
|
||||
|
||||
stat.FreeFiles = _totalFileEntries - stat.Files;
|
||||
|
||||
Reference in New Issue
Block a user