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:
@@ -59,6 +59,9 @@ public sealed partial class XboxFatPlugin
|
||||
const ushort FAT16_RESERVED = 0xFFF0;
|
||||
const ushort FAT_RESERVED = 1;
|
||||
|
||||
// Do not translate
|
||||
const string FS_TYPE = "fatx";
|
||||
|
||||
[Flags]
|
||||
enum Attributes : byte
|
||||
{
|
||||
|
||||
@@ -66,11 +66,11 @@ public sealed partial class XboxFatPlugin : IReadOnlyFilesystem
|
||||
/// <inheritdoc />
|
||||
public Encoding Encoding { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public string Name => "FATX Filesystem Plugin";
|
||||
public string Name => Localization.XboxFatPlugin_Name;
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("ED27A721-4A17-4649-89FD-33633B46E228");
|
||||
/// <inheritdoc />
|
||||
public string Author => "Natalia Portillo";
|
||||
public string Author => Authors.NataliaPortillo;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ErrorNumber ListXAttr(string path, out List<string> xattrs)
|
||||
|
||||
@@ -88,28 +88,28 @@ public sealed partial class XboxFatPlugin
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine("FATX filesystem");
|
||||
sb.AppendLine(Localization.FATX_filesystem);
|
||||
|
||||
sb.AppendFormat("{0} logical sectors ({1} bytes) per physical sector", logicalSectorsPerPhysicalSectors,
|
||||
sb.AppendFormat(Localization._0_logical_sectors_1_bytes_per_physical_sector, logicalSectorsPerPhysicalSectors,
|
||||
logicalSectorsPerPhysicalSectors * imagePlugin.Info.SectorSize).AppendLine();
|
||||
|
||||
sb.AppendFormat("{0} sectors ({1} bytes) per cluster", fatxSb.sectorsPerCluster,
|
||||
sb.AppendFormat(Localization._0_sectors_1_bytes_per_cluster, fatxSb.sectorsPerCluster,
|
||||
fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors * imagePlugin.Info.SectorSize).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat("Root directory starts on cluster {0}", fatxSb.rootDirectoryCluster).AppendLine();
|
||||
sb.AppendFormat(Localization.Root_directory_starts_on_cluster_0, fatxSb.rootDirectoryCluster).AppendLine();
|
||||
|
||||
string volumeLabel = StringHandlers.CToString(fatxSb.volumeLabel,
|
||||
bigEndian ? Encoding.BigEndianUnicode : Encoding.Unicode, true);
|
||||
|
||||
sb.AppendFormat("Volume label: {0}", volumeLabel).AppendLine();
|
||||
sb.AppendFormat("Volume serial: {0:X8}", fatxSb.id).AppendLine();
|
||||
sb.AppendFormat(Localization.Volume_label_0, volumeLabel).AppendLine();
|
||||
sb.AppendFormat(Localization.Volume_serial_0_X8, fatxSb.id).AppendLine();
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
XmlFsType = new FileSystemType
|
||||
{
|
||||
Type = "FATX filesystem",
|
||||
Type = FS_TYPE,
|
||||
ClusterSize = (uint)(fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
|
||||
imagePlugin.Info.SectorSize),
|
||||
VolumeName = volumeLabel,
|
||||
|
||||
@@ -63,7 +63,7 @@ public sealed partial class XboxFatPlugin
|
||||
if(imagePlugin.Info.SectorSize < 512)
|
||||
return ErrorNumber.InvalidArgument;
|
||||
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Reading superblock");
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Reading_superblock);
|
||||
|
||||
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector);
|
||||
|
||||
@@ -82,7 +82,8 @@ public sealed partial class XboxFatPlugin
|
||||
return ErrorNumber.InvalidArgument;
|
||||
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin",
|
||||
_littleEndian ? "Filesystem is little endian" : "Filesystem is big endian");
|
||||
_littleEndian ? Localization.Filesystem_is_little_endian
|
||||
: Localization.Filesystem_is_big_endian);
|
||||
|
||||
int logicalSectorsPerPhysicalSectors = partition.Offset == 0 && _littleEndian ? 8 : 1;
|
||||
|
||||
@@ -95,7 +96,7 @@ public sealed partial class XboxFatPlugin
|
||||
|
||||
XmlFsType = new FileSystemType
|
||||
{
|
||||
Type = "FATX filesystem",
|
||||
Type = Localization.FATX_filesystem,
|
||||
ClusterSize = (uint)(_superblock.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
|
||||
imagePlugin.Info.SectorSize),
|
||||
VolumeName = volumeLabel,
|
||||
@@ -137,7 +138,7 @@ public sealed partial class XboxFatPlugin
|
||||
|
||||
if(_statfs.Blocks > MAX_XFAT16_CLUSTERS)
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Reading FAT32");
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Reading_FAT32);
|
||||
|
||||
fatSize = (uint)((_statfs.Blocks + 1) * sizeof(uint) / imagePlugin.Info.SectorSize);
|
||||
|
||||
@@ -151,14 +152,14 @@ public sealed partial class XboxFatPlugin
|
||||
|
||||
fatSize = (uint)(fatClusters * 4096 / imagePlugin.Info.SectorSize);
|
||||
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", "FAT is {0} sectors", fatSize);
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.FAT_is_0_sectors, fatSize);
|
||||
|
||||
errno = imagePlugin.ReadSectors(_fatStartSector, fatSize, out buffer);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return errno;
|
||||
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Casting FAT");
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Casting_FAT);
|
||||
_fat32 = MemoryMarshal.Cast<byte, uint>(buffer).ToArray();
|
||||
|
||||
if(!_littleEndian)
|
||||
@@ -172,7 +173,7 @@ public sealed partial class XboxFatPlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Reading FAT16");
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Reading_FAT16);
|
||||
|
||||
fatSize = (uint)((_statfs.Blocks + 1) * sizeof(ushort) / imagePlugin.Info.SectorSize);
|
||||
|
||||
@@ -186,14 +187,14 @@ public sealed partial class XboxFatPlugin
|
||||
|
||||
fatSize = (uint)(fatClusters * 4096 / imagePlugin.Info.SectorSize);
|
||||
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", "FAT is {0} sectors", fatSize);
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.FAT_is_0_sectors, fatSize);
|
||||
|
||||
errno = imagePlugin.ReadSectors(_fatStartSector, fatSize, out buffer);
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return errno;
|
||||
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Casting FAT");
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Casting_FAT);
|
||||
_fat16 = MemoryMarshal.Cast<byte, ushort>(buffer).ToArray();
|
||||
|
||||
if(!_littleEndian)
|
||||
@@ -222,7 +223,7 @@ public sealed partial class XboxFatPlugin
|
||||
|
||||
byte[] rootDirectoryBuffer = new byte[_bytesPerCluster * rootDirectoryClusters.Length];
|
||||
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", "Reading root directory");
|
||||
AaruConsole.DebugWriteLine("Xbox FAT plugin", Localization.Reading_root_directory);
|
||||
|
||||
for(int i = 0; i < rootDirectoryClusters.Length; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user