Move new strings to resources.

This commit is contained in:
2025-10-18 13:36:08 +01:00
parent f326dcd700
commit 50e10c0a52
18 changed files with 11231 additions and 6792 deletions

View File

@@ -42,4 +42,18 @@
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Localization\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Update="Localization\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,593 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Aaru.Tui.Localization {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Aaru.Tui.Localization.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to {0} sectors.
/// </summary>
public static string _0_sectors {
get {
return ResourceManager.GetString("_0_sectors", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ASCII .
/// </summary>
public static string ASCII_Text {
get {
return ResourceManager.GetString("ASCII.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to ESC Back.
/// </summary>
public static string Back_Header {
get {
return ResourceManager.GetString("Back.Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
public static string CancelButton_Content {
get {
return ResourceManager.GetString("CancelButton.Content", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Current sector: .
/// </summary>
public static string CurrentSector_Text {
get {
return ResourceManager.GetString("CurrentSector.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enter destination path:.
/// </summary>
public static string DestinationPath_Text {
get {
return ResourceManager.GetString("DestinationPath.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Destination path.
/// </summary>
public static string DestinationPath_Watermark {
get {
return ResourceManager.GetString("DestinationPath.Watermark", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Done..
/// </summary>
public static string Done {
get {
return ResourceManager.GetString("Done", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to F10 Exit.
/// </summary>
public static string Exit_Header {
get {
return ResourceManager.GetString("Exit.Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Exits the application.
/// </summary>
public static string ExitApplication_Text {
get {
return ResourceManager.GetString("ExitApplication.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Attributes:.
/// </summary>
public static string FileAttributes_Text {
get {
return ResourceManager.GetString("FileAttributes.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Creation time:.
/// </summary>
public static string FileCreationTime_Text {
get {
return ResourceManager.GetString("FileCreationTime.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File information.
/// </summary>
public static string FileInformation_Text {
get {
return ResourceManager.GetString("FileInformation.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Last write time:.
/// </summary>
public static string FileLastWriteTime_Text {
get {
return ResourceManager.GetString("FileLastWriteTime.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Length:.
/// </summary>
public static string FileLength_Text {
get {
return ResourceManager.GetString("FileLength.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Mode:.
/// </summary>
public static string FileMode_Text {
get {
return ResourceManager.GetString("FileMode.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Filesystem information.
/// </summary>
public static string FilesystemInformation_Text {
get {
return ResourceManager.GetString("FilesystemInformation.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Go back to previous window.
/// </summary>
public static string GoBack_Text {
get {
return ResourceManager.GetString("GoBack.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Go to next sector.
/// </summary>
public static string GoNextSector_Text {
get {
return ResourceManager.GetString("GoNextSector.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Go to previous sector.
/// </summary>
public static string GoPreviousSector_Text {
get {
return ResourceManager.GetString("GoPreviousSector.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Go to the specified sector.
/// </summary>
public static string GoSpecifiedSector_Text {
get {
return ResourceManager.GetString("GoSpecifiedSector.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to F4 GoTo.
/// </summary>
public static string GoTo_Header {
get {
return ResourceManager.GetString("GoTo.Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Go to path.
/// </summary>
public static string GoToPath_Title {
get {
return ResourceManager.GetString("GoToPath.Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Go to Sector.
/// </summary>
public static string GoToSector_Title {
get {
return ResourceManager.GetString("GoToSector.Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Go to the specified path.
/// </summary>
public static string GoToSpecifiedPath_Text {
get {
return ResourceManager.GetString("GoToSpecifiedPath.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to F1 Help.
/// </summary>
public static string Help_Header {
get {
return ResourceManager.GetString("Help.Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Help.
/// </summary>
public static string Help_Title {
get {
return ResourceManager.GetString("Help.Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Image information.
/// </summary>
public static string ImageInformation_Text {
get {
return ResourceManager.GetString("ImageInformation.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Loading....
/// </summary>
public static string Loading {
get {
return ResourceManager.GetString("Loading", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Loading file information....
/// </summary>
public static string Loading_file_information {
get {
return ResourceManager.GetString("Loading_file_information", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Loading filesystems....
/// </summary>
public static string Loading_filesystems {
get {
return ResourceManager.GetString("Loading_filesystems", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Loading partitions....
/// </summary>
public static string Loading_partitions {
get {
return ResourceManager.GetString("Loading_partitions", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to F5 Long.
/// </summary>
public static string Long_Header {
get {
return ResourceManager.GetString("Long.Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to (Long Mode).
/// </summary>
public static string Long_Mode {
get {
return ResourceManager.GetString("Long_Mode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to F2 Next.
/// </summary>
public static string Next_Header {
get {
return ResourceManager.GetString("Next.Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Offset.
/// </summary>
public static string Offset_Text {
get {
return ResourceManager.GetString("Offset.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to OK.
/// </summary>
public static string OkButton_Content {
get {
return ResourceManager.GetString("OkButton.Content", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Partition {0}.
/// </summary>
public static string Partition_0 {
get {
return ResourceManager.GetString("Partition_0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Description:.
/// </summary>
public static string PartitionDescription_Text {
get {
return ResourceManager.GetString("PartitionDescription.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Partition information.
/// </summary>
public static string PartitionInformation_Text {
get {
return ResourceManager.GetString("PartitionInformation.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Length:.
/// </summary>
public static string PartitionLength_Text {
get {
return ResourceManager.GetString("PartitionLength.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name:.
/// </summary>
public static string PartitionName_Text {
get {
return ResourceManager.GetString("PartitionName.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Offset:.
/// </summary>
public static string PartitionOffset_Text {
get {
return ResourceManager.GetString("PartitionOffset.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Scheme:.
/// </summary>
public static string PartitionScheme_Text {
get {
return ResourceManager.GetString("PartitionScheme.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sequence: .
/// </summary>
public static string PartitionSequence_Text {
get {
return ResourceManager.GetString("PartitionSequence.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Size:.
/// </summary>
public static string PartitionSize_Text {
get {
return ResourceManager.GetString("PartitionSize.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Starting sector:.
/// </summary>
public static string PartitionStartingSector_Text {
get {
return ResourceManager.GetString("PartitionStartingSector.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Type:.
/// </summary>
public static string PartitionType_Text {
get {
return ResourceManager.GetString("PartitionType.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Path cannot be empty.
/// </summary>
public static string Path_cannot_be_empty {
get {
return ResourceManager.GetString("Path_cannot_be_empty", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Path does not exist.
/// </summary>
public static string Path_does_not_exist {
get {
return ResourceManager.GetString("Path_does_not_exist", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Please enter a valid number..
/// </summary>
public static string Please_enter_a_valid_number {
get {
return ResourceManager.GetString("Please_enter_a_valid_number", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to F3 Prev.
/// </summary>
public static string Prev_Header {
get {
return ResourceManager.GetString("Prev.Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sector number must be less than or equal to {0}..
/// </summary>
public static string Sector_number_must_be_less_than_or_equal_to_0 {
get {
return ResourceManager.GetString("Sector_number_must_be_less_than_or_equal_to_0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enter sector number:.
/// </summary>
public static string SectorNumber_Text {
get {
return ResourceManager.GetString("SectorNumber.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sector number.
/// </summary>
public static string SectorNumber_Watermark {
get {
return ResourceManager.GetString("SectorNumber.Watermark", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to F2 ScVw.
/// </summary>
public static string SectorViewer_Header {
get {
return ResourceManager.GetString("SectorViewer.Header", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Sector viewer.
/// </summary>
public static string SectorViewer_Text {
get {
return ResourceManager.GetString("SectorViewer.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Shows this help.
/// </summary>
public static string ShowHelp_Text {
get {
return ResourceManager.GetString("ShowHelp.Text", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Toggle long sector mode.
/// </summary>
public static string ToggleLongMode_Text {
get {
return ResourceManager.GetString("ToggleLongMode.Text", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
id="root"
xmlns="">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<data name="Path_cannot_be_empty" xml:space="preserve">
<value>Path cannot be empty</value>
</data>
<data name="Path_does_not_exist" xml:space="preserve">
<value>Path does not exist</value>
</data>
<data name="Please_enter_a_valid_number" xml:space="preserve">
<value>Please enter a valid number.</value>
</data>
<data name="Sector_number_must_be_less_than_or_equal_to_0" xml:space="preserve">
<value>Sector number must be less than or equal to {0}.</value>
</data>
<data name="Long_Mode" xml:space="preserve">
<value> (Long Mode)</value>
</data>
<data name="_0_sectors" xml:space="preserve">
<value>{0} sectors</value>
</data>
<data name="Loading_partitions" xml:space="preserve">
<value>Loading partitions...</value>
</data>
<data name="Loading_filesystems" xml:space="preserve">
<value>Loading filesystems...</value>
</data>
<data name="Partition_0" xml:space="preserve">
<value>Partition {0}</value>
</data>
<data name="Done" xml:space="preserve">
<value>Done.</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Loading...</value>
</data>
<data name="Loading_file_information" xml:space="preserve">
<value>Loading file information...</value>
</data>
<data name="DestinationPath.Text" xml:space="preserve">
<value>Enter destination path:</value>
</data>
<data name="DestinationPath.Watermark" xml:space="preserve">
<value>Destination path</value>
</data>
<data name="OkButton.Content" xml:space="preserve">
<value>OK</value>
</data>
<data name="CancelButton.Content" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="SectorNumber.Text" xml:space="preserve">
<value>Enter sector number:</value>
</data>
<data name="SectorNumber.Watermark" xml:space="preserve">
<value>Sector number</value>
</data>
<data name="GoToPath.Title" xml:space="preserve">
<value>Go to path</value>
</data>
<data name="GoToSector.Title" xml:space="preserve">
<value>Go to Sector</value>
</data>
<data name="GoBack.Text" xml:space="preserve">
<value>Go back to previous window</value>
</data>
<data name="ShowHelp.Text" xml:space="preserve">
<value>Shows this help</value>
</data>
<data name="GoNextSector.Text" xml:space="preserve">
<value>Go to next sector</value>
</data>
<data name="GoPreviousSector.Text" xml:space="preserve">
<value>Go to previous sector</value>
</data>
<data name="GoSpecifiedSector.Text" xml:space="preserve">
<value>Go to the specified sector</value>
</data>
<data name="ToggleLongMode.Text" xml:space="preserve">
<value>Toggle long sector mode</value>
</data>
<data name="ExitApplication.Text" xml:space="preserve">
<value>Exits the application</value>
</data>
<data name="Help.Title" xml:space="preserve">
<value>Help</value>
</data>
<data name="SectorViewer.Text" xml:space="preserve">
<value>Sector viewer</value>
</data>
<data name="GoToSpecifiedPath.Text" xml:space="preserve">
<value>Go to the specified path</value>
</data>
<data name="Back.Header" xml:space="preserve">
<value>ESC Back</value>
</data>
<data name="Help.Header" xml:space="preserve">
<value>F1 Help</value>
</data>
<data name="Next.Header" xml:space="preserve">
<value>F2 Next</value>
</data>
<data name="Prev.Header" xml:space="preserve">
<value>F3 Prev</value>
</data>
<data name="GoTo.Header" xml:space="preserve">
<value>F4 GoTo</value>
</data>
<data name="Long.Header" xml:space="preserve">
<value>F5 Long</value>
</data>
<data name="Exit.Header" xml:space="preserve">
<value>F10 Exit</value>
</data>
<data name="Offset.Text" xml:space="preserve">
<value>Offset</value>
</data>
<data name="ASCII.Text" xml:space="preserve">
<value>ASCII </value>
</data>
<data name="CurrentSector.Text" xml:space="preserve">
<value>Current sector: </value>
</data>
<data name="PartitionInformation.Text" xml:space="preserve">
<value>Partition information</value>
</data>
<data name="PartitionSequence.Text" xml:space="preserve">
<value>Sequence: </value>
</data>
<data name="PartitionName.Text" xml:space="preserve">
<value>Name:</value>
</data>
<data name="PartitionType.Text" xml:space="preserve">
<value>Type:</value>
</data>
<data name="PartitionStartingSector.Text" xml:space="preserve">
<value>Starting sector:</value>
</data>
<data name="PartitionOffset.Text" xml:space="preserve">
<value>Offset:</value>
</data>
<data name="PartitionLength.Text" xml:space="preserve">
<value>Length:</value>
</data>
<data name="PartitionSize.Text" xml:space="preserve">
<value>Size:</value>
</data>
<data name="PartitionScheme.Text" xml:space="preserve">
<value>Scheme:</value>
</data>
<data name="PartitionDescription.Text" xml:space="preserve">
<value>Description:</value>
</data>
<data name="FilesystemInformation.Text" xml:space="preserve">
<value>Filesystem information</value>
</data>
<data name="SectorViewer.Header" xml:space="preserve">
<value>F2 ScVw</value>
</data>
<data name="FileInformation.Text" xml:space="preserve">
<value>File information</value>
</data>
<data name="FileLength.Text" xml:space="preserve">
<value>Length:</value>
</data>
<data name="FileCreationTime.Text" xml:space="preserve">
<value>Creation time:</value>
</data>
<data name="FileLastWriteTime.Text" xml:space="preserve">
<value>Last write time:</value>
</data>
<data name="FileAttributes.Text" xml:space="preserve">
<value>Attributes:</value>
</data>
<data name="FileMode.Text" xml:space="preserve">
<value>Mode:</value>
</data>
<data name="ImageInformation.Text" xml:space="preserve">
<value>Image information</value>
</data>
</root>

View File

@@ -57,7 +57,7 @@ public sealed partial class GoToPathDialogViewModel : ViewModelBase
if(string.IsNullOrWhiteSpace(Path))
{
HasError = true;
ErrorMessage = "Path cannot be empty";
ErrorMessage = Localization.Resources.Path_cannot_be_empty;
return;
}
@@ -65,7 +65,7 @@ public sealed partial class GoToPathDialogViewModel : ViewModelBase
if(!Directory.Exists(Path))
{
HasError = true;
ErrorMessage = "Path does not exist";
ErrorMessage = Localization.Resources.Path_does_not_exist;
return;
}

View File

@@ -60,7 +60,7 @@ public sealed partial class GoToSectorDialogViewModel : ViewModelBase
{
if(!ulong.TryParse((string?)SectorNumber, out ulong sector))
{
ErrorMessage = "Please enter a valid number.";
ErrorMessage = Localization.Resources.Please_enter_a_valid_number;
HasError = true;
return;
@@ -68,8 +68,10 @@ public sealed partial class GoToSectorDialogViewModel : ViewModelBase
if(sector > _maxSector)
{
ErrorMessage = $"Sector number must be less than or equal to {_maxSector}.";
HasError = true;
ErrorMessage = string.Format(Localization.Resources.Sector_number_must_be_less_than_or_equal_to_0,
_maxSector);
HasError = true;
return;
}

View File

@@ -86,9 +86,9 @@ public sealed partial class HexViewWindowViewModel : ViewModelBase
_longMode = !_longMode;
if(_longMode)
FilePath += " (Long Mode)";
FilePath += Localization.Resources.Long_Mode;
else
FilePath = FilePath.Replace(" (Long Mode)", string.Empty);
FilePath = FilePath.Replace(Localization.Resources.Long_Mode, string.Empty);
LoadSector();
}

View File

@@ -106,12 +106,15 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
{
IsPartitionInformationVisible = true;
PartitionSequence = _selectedNode.Partition.Value.Sequence.ToString();
PartitionName = _selectedNode.Partition.Value.Name;
PartitionType = _selectedNode.Partition.Value.Type;
PartitionStart = _selectedNode.Partition.Value.Start.ToString();
PartitionOffset = ByteSize.FromBytes(_selectedNode.Partition.Value.Offset).Humanize();
PartitionLength = $"{_selectedNode.Partition.Value.Length} sectors";
PartitionSequence = _selectedNode.Partition.Value.Sequence.ToString();
PartitionName = _selectedNode.Partition.Value.Name;
PartitionType = _selectedNode.Partition.Value.Type;
PartitionStart = _selectedNode.Partition.Value.Start.ToString();
PartitionOffset = ByteSize.FromBytes(_selectedNode.Partition.Value.Offset).Humanize();
PartitionLength =
string.Format(Localization.Resources._0_sectors, _selectedNode.Partition.Value.Length);
PartitionSize = ByteSize.FromBytes(_selectedNode.Partition.Value.Size).Humanize();
PartitionScheme = _selectedNode.Partition.Value.Scheme;
PartitionDescription = _selectedNode.Partition.Value.Description;
@@ -180,7 +183,7 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
void Worker()
{
IsStatusVisible = true;
Status = "Loading partitions...";
Status = Localization.Resources.Loading_partitions;
Nodes = [];
@@ -190,7 +193,7 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
{
partitionsList.Add(new Partition
{
Name = Localization.Core.Whole_device,
Name = Aaru.Localization.Core.Whole_device,
Length = _imageFormat.Info.Sectors,
Size = _imageFormat.Info.Sectors * _imageFormat.Info.SectorSize
});
@@ -198,13 +201,14 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
var sequence = 0;
Status = "Loading filesystems...";
Status = Localization.Resources.Loading_filesystems;
PluginRegister plugins = PluginRegister.Singleton;
foreach(Partition partition in partitionsList)
{
var node = new FileSystemModelNode(partition.Name ?? $"Partition {sequence}")
var node = new FileSystemModelNode(partition.Name ??
string.Format(Localization.Resources.Partition_0, sequence))
{
Partition = partition
};
@@ -247,7 +251,7 @@ public sealed partial class ImageWindowViewModel : ViewModelBase
sequence++;
}
Status = "Done.";
Status = Localization.Resources.Done;
IsStatusVisible = false;
}
}

View File

@@ -46,6 +46,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Humanizer;
using Humanizer.Bytes;
using Spectre.Console;
using Color = Avalonia.Media.Color;
namespace Aaru.Tui.ViewModels.Windows;
@@ -83,7 +84,7 @@ public sealed partial class MainWindowViewModel : ViewModelBase
"?.?.?";
Copyright = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyCopyrightAttribute>()?.Copyright ?? "";
Status = "Loading...";
Status = Localization.Resources.Loading;
}
public FileModel? SelectedFile
@@ -182,7 +183,7 @@ public sealed partial class MainWindowViewModel : ViewModelBase
public void LoadFiles()
{
IsStatusVisible = true;
Status = "Loading...";
Status = Localization.Resources.Loading;
CurrentPath = Directory.GetCurrentDirectory();
Files.Clear();
@@ -236,7 +237,7 @@ public sealed partial class MainWindowViewModel : ViewModelBase
void Worker()
{
IsStatusVisible = true;
Status = "Loading file information...";
Status = Localization.Resources.Loading_file_information;
foreach(FileModel file in Files)
{
@@ -259,110 +260,189 @@ public sealed partial class MainWindowViewModel : ViewModelBase
StringBuilder sb = new();
if(!string.IsNullOrWhiteSpace(imageFormat.Info.Version))
sb.AppendLine($"[bold][#875fff]Format:[/] [italic][#af8787]{imageFormat.Format}[/][/] version [#af8787]{imageFormat.Info.Version}[/][/]");
{
sb.AppendFormat(Aaru.Localization.Core.Format_0_version_1_WithMarkup,
Markup.Escape(imageFormat.Format),
Markup.Escape(imageFormat.Info.Version))
.AppendLine();
}
else
sb.AppendLine($"[bold][#875fff]Format:[/] [italic][#af8787]{imageFormat.Format}[/][/][/]");
sb.AppendFormat(Aaru.Localization.Core.Format_0_WithMarkup, Markup.Escape(imageFormat.Format))
.AppendLine();
switch(string.IsNullOrWhiteSpace(imageFormat.Info.Application))
{
case false when !string.IsNullOrWhiteSpace(imageFormat.Info.ApplicationVersion):
sb.AppendLine($"[#875fff]Was created with [italic][#af8787]{imageFormat.Info.Application}[/][/] version [italic][#af8787]{imageFormat.Info.ApplicationVersion}[/][/][/]");
sb.AppendFormat(Aaru.Localization.Core.Was_created_with_0_version_1_WithMarkup,
Markup.Escape(imageFormat.Info.Application),
Markup.Escape(imageFormat.Info.ApplicationVersion))
.AppendLine();
break;
case false:
sb.AppendLine($"[#875fff]Was created with[/] [italic][#af8787]{imageFormat.Info.Application}[/][/]");
sb.AppendFormat(Aaru.Localization.Core.Was_created_with_0_WithMarkup,
Markup.Escape(imageFormat.Info.Application))
.AppendLine();
break;
}
sb.AppendLine($"[#875fff]Image without headers is [lime]{imageFormat.Info.ImageSize}[/] bytes long[/]");
sb.AppendFormat(Aaru.Localization.Core.Image_without_headers_is_0_bytes_long,
imageFormat.Info.ImageSize)
.AppendLine();
sb.AppendLine($"[#875fff]Contains a media of [lime]{imageFormat.Info.Sectors}[/] sectors[/]");
sb.AppendLine($"[#875fff]Maximum sector size of [teal]{imageFormat.Info.SectorSize}[/] bytes[/]");
sb.AppendLine($"[#875fff]Would be [aqua]{ByteSize.FromBytes(imageFormat.Info.Sectors * imageFormat.Info.SectorSize).Humanize()}[/][/]");
sb.AppendFormat(Aaru.Localization.Core.Contains_a_media_of_0_sectors, imageFormat.Info.Sectors)
.AppendLine();
sb.AppendFormat(Aaru.Localization.Core.Maximum_sector_size_of_0_bytes, imageFormat.Info.SectorSize)
.AppendLine();
sb.AppendFormat(Aaru.Localization.Core.Would_be_0_humanized,
ByteSize.FromBytes(imageFormat.Info.Sectors * imageFormat.Info.SectorSize).Humanize())
.AppendLine();
if(!string.IsNullOrWhiteSpace(imageFormat.Info.Creator))
sb.AppendLine($"[bold][#875fff]Created by:[/][/] [green]{imageFormat.Info.Creator}[/]");
sb.AppendFormat(Aaru.Localization.Core.Created_by_0_WithMarkup,
Markup.Escape(imageFormat.Info.Creator))
.AppendLine();
if(imageFormat.Info.CreationTime != DateTime.MinValue)
sb.AppendLine($"[#875fff]Created on[/] [#afd700]{imageFormat.Info.CreationTime}[/]");
sb.AppendFormat(Aaru.Localization.Core.Created_on_0, imageFormat.Info.CreationTime).AppendLine();
if(imageFormat.Info.LastModificationTime != DateTime.MinValue)
sb.AppendLine($"[#875fff]Last modified on[/] [#afd700]{imageFormat.Info.LastModificationTime}[/]");
sb.AppendFormat(Aaru.Localization.Core.Last_modified_on_0, imageFormat.Info.LastModificationTime)
.AppendLine();
sb.AppendLine($"[#875fff]Contains a media of type[/] [italic][fuchsia]{imageFormat.Info.MediaType.Humanize()}[/][/]");
sb.AppendLine($"[#875fff]XML type:[/] [italic][#af8787]{imageFormat.Info.MetadataMediaType}[/][/]");
sb.AppendFormat(Aaru.Localization.Core.Contains_a_media_of_type_0,
imageFormat.Info.MediaType.Humanize())
.AppendLine();
sb.AppendFormat(Aaru.Localization.Core.XML_type_0, imageFormat.Info.MetadataMediaType).AppendLine();
sb.AppendLine(imageFormat.Info.HasPartitions
? "[green]Has partitions[/]"
: "[red]Doesn\'t have partitions[/]");
? Aaru.Localization.Core.Has_partitions
: Aaru.Localization.Core.Doesnt_have_partitions);
sb.AppendLine(imageFormat.Info.HasSessions
? "[green]Has sessions[/]"
: "[red]Doesn\'t have sessions[/]");
? Aaru.Localization.Core.Has_sessions
: Aaru.Localization.Core.Doesnt_have_sessions);
if(!string.IsNullOrWhiteSpace(imageFormat.Info.Comments))
sb.AppendLine($"[bold][#875fff]Comments:[/][/] {imageFormat.Info.Comments}");
sb.AppendFormat(Aaru.Localization.Core.Comments_0_WithMarkup,
Markup.Escape(imageFormat.Info.Comments))
.AppendLine();
if(imageFormat.Info.MediaSequence != 0 && imageFormat.Info.LastMediaSequence != 0)
{
sb.AppendLine($"[#875fff]Media is number [teal]{imageFormat.Info.MediaSequence}[/]" +
"\n" +
$" on a set of [teal]{imageFormat.Info.LastMediaSequence}[/] medias[/]");
sb.AppendFormat(Aaru.Localization.Core.Media_is_number_0_on_a_set_of_1_medias,
imageFormat.Info.MediaSequence,
imageFormat.Info.LastMediaSequence)
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaTitle))
sb.AppendLine($"[bold][#875fff]Media title:[/][/] [italic]{imageFormat.Info.MediaTitle}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Media_title_0_WithMarkup,
Markup.Escape(imageFormat.Info.MediaTitle))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaManufacturer))
sb.AppendLine($"[bold][#875fff]Media manufacturer:[/][/] [italic]{imageFormat.Info.MediaManufacturer}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Media_manufacturer_0_WithMarkup,
Markup.Escape(imageFormat.Info.MediaManufacturer))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaModel))
sb.AppendLine($"[bold][#875fff]Media model:[/][/] [italic]{imageFormat.Info.MediaModel}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Media_model_0_WithMarkup,
Markup.Escape(imageFormat.Info.MediaModel))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaSerialNumber))
sb.AppendLine($"[bold][#875fff]Media serial number:[/][/] [italic]{imageFormat.Info.MediaSerialNumber}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Media_serial_number_0_WithMarkup,
Markup.Escape(imageFormat.Info.MediaSerialNumber))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaBarcode))
sb.AppendLine($"[bold][#875fff]Media barcode:[/][/] [italic]{imageFormat.Info.MediaBarcode}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Media_barcode_0_WithMarkup,
Markup.Escape(imageFormat.Info.MediaBarcode))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.MediaPartNumber))
sb.AppendLine($"[bold][#875fff]Media part number:[/][/] [italic]{imageFormat.Info.MediaPartNumber}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Media_part_number_0_WithMarkup,
Markup.Escape(imageFormat.Info.MediaPartNumber))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveManufacturer))
sb.AppendLine($"[bold][#875fff]Drive manufacturer:[/][/] [italic]{imageFormat.Info.DriveManufacturer}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Drive_manufacturer_0_WithMarkup,
Markup.Escape(imageFormat.Info.DriveManufacturer))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveModel))
sb.AppendLine($"[bold][#875fff]Drive model:[/][/] [italic]{imageFormat.Info.DriveModel}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Drive_model_0_WithMarkup,
Markup.Escape(imageFormat.Info.DriveModel))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveSerialNumber))
sb.AppendLine($"[bold][#875fff]Drive serial number:[/][/] [italic]{imageFormat.Info.DriveSerialNumber}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Drive_serial_number_0_WithMarkup,
Markup.Escape(imageFormat.Info.DriveSerialNumber))
.AppendLine();
}
if(!string.IsNullOrWhiteSpace(imageFormat.Info.DriveFirmwareRevision))
sb.AppendLine($"[bold][#875fff]Drive firmware info:[/][/] [italic]{imageFormat.Info.DriveFirmwareRevision}[/]");
{
sb.AppendFormat(Aaru.Localization.Core.Drive_firmware_info_0_WithMarkup,
Markup.Escape(imageFormat.Info.DriveFirmwareRevision))
.AppendLine();
}
if(imageFormat.Info.Cylinders > 0 &&
imageFormat.Info is { Heads: > 0, SectorsPerTrack: > 0 } &&
imageFormat.Info.MetadataMediaType != MetadataMediaType.OpticalDisc &&
imageFormat is not ITapeImage { IsTape: true })
sb.AppendLine($"[bold][#875fff]Media geometry:[/] [italic][teal]{imageFormat.Info.Cylinders}[/] cylinders, [teal]{imageFormat.Info.Heads}[/] heads, [teal]{imageFormat.Info.SectorsPerTrack}[/] sectors per track[/][/][/]");
{
sb.AppendFormat(Aaru.Localization.Core
.Media_geometry_0_cylinders_1_heads_2_sectors_per_track_WithMarkup,
imageFormat.Info.Cylinders,
imageFormat.Info.Heads,
imageFormat.Info.SectorsPerTrack)
.AppendLine();
}
if(imageFormat.Info.ReadableMediaTags is { Count: > 0 })
{
sb.AppendLine($"[bold][blue]Contains[/] [teal]{imageFormat.Info.ReadableMediaTags.Count}[/] [blue]readable media tags:[/][/]");
sb.AppendFormat(Aaru.Localization.Core.Contains_0_readable_media_tags_WithMarkup,
imageFormat.Info.ReadableMediaTags.Count)
.AppendLine();
foreach(MediaTagType tag in imageFormat.Info.ReadableMediaTags.Order())
sb.Append($"[italic][#af8787]{tag}[/][/] ");
sb.Append($"[italic][rosybrown]{Markup.Escape(tag.ToString())}[/][/] ");
sb.AppendLine();
}
if(imageFormat.Info.ReadableSectorTags is { Count: > 0 })
{
sb.AppendLine($"[bold][blue]Contains [teal]{imageFormat.Info.ReadableSectorTags.Count}[/] [blue]readable sector tags:[/][/]");
sb.AppendFormat(Aaru.Localization.Core.Contains_0_readable_sector_tags_WithMarkup,
imageFormat.Info.ReadableSectorTags.Count)
.AppendLine();
foreach(SectorTagType tag in imageFormat.Info.ReadableSectorTags.Order())
sb.Append($"[italic][#af8787]{tag}[/][/] ");
sb.Append($"[italic][rosybrown]{Markup.Escape(tag.ToString())}[/][/] ");
sb.AppendLine();
}
@@ -377,7 +457,7 @@ public sealed partial class MainWindowViewModel : ViewModelBase
}
}
Status = "Done.";
Status = Localization.Resources.Done;
IsStatusVisible = false;
}

View File

@@ -5,13 +5,14 @@
xmlns:windowManager="clr-namespace:Iciclecreek.Avalonia.WindowManager;assembly=Iciclecreek.Avalonia.WindowManager"
xmlns:brushes="https://github.com/jinek/consolonia"
xmlns:dialogs="clr-namespace:Aaru.Tui.ViewModels.Dialogs"
xmlns:localization="clr-namespace:Aaru.Tui.Localization"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
Width="40"
WindowStartupLocation="CenterScreen"
x:Class="Aaru.Tui.Views.Dialogs.GoToPathDialog"
Title="Go to path">
Title="{x:Static localization:Resources.GoToPath_Title}">
<Design.DataContext>
<dialogs:GoToPathDialogViewModel />
</Design.DataContext>
@@ -21,18 +22,18 @@
Brush="Blue" />
</Border.BorderBrush>
<StackPanel>
<TextBlock Text="Enter destination path:" />
<TextBlock Text="{x:Static localization:Resources.DestinationPath_Text}" />
<TextBox Text="{Binding Path, Mode=TwoWay}"
Watermark="Destination path" />
Watermark="{x:Static localization:Resources.DestinationPath_Watermark}" />
<TextBlock Text="{Binding ErrorMessage, Mode=OneWay}"
Foreground="Red"
IsVisible="{Binding HasError, Mode=OneWay}" />
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right"
Spacing="1">
<Button Content="OK"
<Button Content="{x:Static localization:Resources.OkButton_Content}"
Command="{Binding OkCommand, Mode=OneWay}" />
<Button Content="Cancel"
<Button Content="{x:Static localization:Resources.CancelButton_Content}"
Command="{Binding CancelCommand, Mode=OneWay}" />
</StackPanel>
</StackPanel>

View File

@@ -3,11 +3,12 @@
xmlns:vm="using:Aaru.Tui.ViewModels.Dialogs"
xmlns:brushes="https://github.com/jinek/consolonia"
xmlns:windowManager="clr-namespace:Iciclecreek.Avalonia.WindowManager;assembly=Iciclecreek.Avalonia.WindowManager"
xmlns:localization="clr-namespace:Aaru.Tui.Localization"
Width="40"
Height="8"
x:Class="Aaru.Tui.Views.Dialogs.GoToSectorDialog"
x:DataType="vm:GoToSectorDialogViewModel"
Title="Go to Sector"
Title="{x:Static localization:Resources.GoToSector_Title}"
WindowStartupLocation="CenterScreen"
CanResize="False">
<Design.DataContext>
@@ -19,18 +20,18 @@
Brush="Blue" />
</Border.BorderBrush>
<StackPanel>
<TextBlock Text="Enter sector number:" />
<TextBlock Text="{x:Static localization:Resources.SectorNumber_Text}" />
<TextBox Text="{Binding SectorNumber, Mode=TwoWay}"
Watermark="Sector number" />
Watermark="{x:Static localization:Resources.SectorNumber_Watermark}" />
<TextBlock Text="{Binding ErrorMessage, Mode=OneWay}"
Foreground="Red"
IsVisible="{Binding HasError, Mode=OneWay}" />
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right"
Spacing="1">
<Button Content="OK"
<Button Content="{x:Static localization:Resources.OkButton_Content}"
Command="{Binding OkCommand, Mode=OneWay}" />
<Button Content="Cancel"
<Button Content="{x:Static localization:Resources.CancelButton_Content}"
Command="{Binding CancelCommand, Mode=OneWay}" />
</StackPanel>
</StackPanel>

View File

@@ -5,6 +5,7 @@
xmlns:windowManager="clr-namespace:Iciclecreek.Avalonia.WindowManager;assembly=Iciclecreek.Avalonia.WindowManager"
xmlns:dialogs="clr-namespace:Aaru.Tui.ViewModels.Dialogs"
xmlns:brushes="https://github.com/jinek/consolonia"
xmlns:localization="clr-namespace:Aaru.Tui.Localization"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
@@ -14,7 +15,7 @@
WindowStartupLocation="CenterScreen"
BorderBrush="Blue"
CanResize="False"
Title="Help">
Title="{x:Static localization:Resources.Help_Title}">
<Design.DataContext>
<dialogs:HexViewHelpDialogViewModel />
</Design.DataContext>
@@ -31,7 +32,7 @@
Text="ESC" />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Go back to previous window" />
Text="{x:Static localization:Resources.GoBack_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -40,7 +41,7 @@
Text="F1 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Shows this help" />
Text="{x:Static localization:Resources.ShowHelp_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -49,7 +50,7 @@
Text="F2 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Go to next sector" />
Text="{x:Static localization:Resources.GoNextSector_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -58,7 +59,7 @@
Text="F3 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Go to previous sector" />
Text="{x:Static localization:Resources.GoPreviousSector_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -67,7 +68,7 @@
Text="F4 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Go to the specified sector" />
Text="{x:Static localization:Resources.GoSpecifiedSector_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -76,7 +77,7 @@
Text="F5 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Toggle long sector mode" />
Text="{x:Static localization:Resources.ToggleLongMode_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -85,12 +86,12 @@
Text="F10" />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Exits the application" />
Text="{x:Static localization:Resources.ExitApplication_Text}" />
</Grid>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right"
Spacing="1">
<Button Content="OK"
<Button Content="{x:Static localization:Resources.OkButton_Content}"
Command="{Binding OkCommand, Mode=OneWay}" />
</StackPanel>
</StackPanel>

View File

@@ -5,6 +5,7 @@
xmlns:windowManager="clr-namespace:Iciclecreek.Avalonia.WindowManager;assembly=Iciclecreek.Avalonia.WindowManager"
xmlns:dialogs="clr-namespace:Aaru.Tui.ViewModels.Dialogs"
xmlns:brushes="https://github.com/jinek/consolonia"
xmlns:localization="clr-namespace:Aaru.Tui.Localization"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
@@ -14,7 +15,7 @@
WindowStartupLocation="CenterScreen"
BorderBrush="Blue"
CanResize="False"
Title="Help">
Title="{x:Static localization:Resources.Help_Title}">
<Design.DataContext>
<dialogs:ImageHelpDialogViewModel />
</Design.DataContext>
@@ -31,7 +32,7 @@
Text="ESC" />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Go back to previous window" />
Text="{x:Static localization:Resources.GoBack_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -40,7 +41,7 @@
Text="F1 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Shows this help" />
Text="{x:Static localization:Resources.ShowHelp_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -49,12 +50,12 @@
Text="F10" />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Exits the application" />
Text="{x:Static localization:Resources.ExitApplication_Text}" />
</Grid>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right"
Spacing="1">
<Button Content="OK"
<Button Content="{x:Static localization:Resources.OkButton_Content}"
Command="{Binding OkCommand, Mode=OneWay}" />
</StackPanel>
</StackPanel>

View File

@@ -5,6 +5,7 @@
xmlns:windowManager="clr-namespace:Iciclecreek.Avalonia.WindowManager;assembly=Iciclecreek.Avalonia.WindowManager"
xmlns:dialogs="clr-namespace:Aaru.Tui.ViewModels.Dialogs"
xmlns:brushes="https://github.com/jinek/consolonia"
xmlns:localization="clr-namespace:Aaru.Tui.Localization"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
@@ -14,7 +15,7 @@
WindowStartupLocation="CenterScreen"
BorderBrush="Blue"
CanResize="False"
Title="Help">
Title="{x:Static localization:Resources.Help_Title}">
<Design.DataContext>
<dialogs:MainHelpDialogViewModel />
</Design.DataContext>
@@ -31,7 +32,7 @@
Text="F1 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Shows this help" />
Text="{x:Static localization:Resources.ShowHelp_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -40,7 +41,7 @@
Text="F2 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Sector viewer" />
Text="{x:Static localization:Resources.SectorViewer_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -49,7 +50,7 @@
Text="F4 " />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Go to the specified path" />
Text="{x:Static localization:Resources.GoToSpecifiedPath_Text}" />
</Grid>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="2">
@@ -58,12 +59,12 @@
Text="F10" />
<TextBlock Grid.Column="1"
Foreground="SlateBlue"
Text="Exits the application" />
Text="{x:Static localization:Resources.ExitApplication_Text}" />
</Grid>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Right"
Spacing="1">
<Button Content="OK"
<Button Content="{x:Static localization:Resources.OkButton_Content}"
Command="{Binding OkCommand, Mode=OneWay}" />
</StackPanel>
</StackPanel>

View File

@@ -3,6 +3,7 @@
xmlns:console="https://github.com/jinek/consolonia"
xmlns:windows="clr-namespace:Aaru.Tui.ViewModels.Windows"
xmlns:windowManager="clr-namespace:Iciclecreek.Avalonia.WindowManager;assembly=Iciclecreek.Avalonia.WindowManager"
xmlns:localization="clr-namespace:Aaru.Tui.Localization"
x:Class="Aaru.Tui.Views.Windows.HexViewWindow"
WindowState="FullScreen"
CanResize="False">
@@ -11,25 +12,25 @@
</Design.DataContext>
<DockPanel>
<Menu DockPanel.Dock="Bottom">
<MenuItem Header="ESC Back"
<MenuItem Header="{x:Static localization:Resources.Back_Header}"
HotKey="Escape"
Command="{Binding BackCommand, Mode=OneWay}" />
<MenuItem Header="F1 Help"
<MenuItem Header="{x:Static localization:Resources.Help_Header}"
Command="{Binding HelpCommand, Mode=OneWay}"
HotKey="F1" />
<MenuItem Header="F2 Next"
<MenuItem Header="{x:Static localization:Resources.Next_Header}"
Command="{Binding NextSectorCommand, Mode=OneWay}"
HotKey="F2" />
<MenuItem Header="F3 Prev"
<MenuItem Header="{x:Static localization:Resources.Prev_Header}"
Command="{Binding PreviousSectorCommand, Mode=OneWay}"
HotKey="F3" />
<MenuItem Header="F4 GoTo"
<MenuItem Header="{x:Static localization:Resources.GoTo_Header}"
Command="{Binding GoToCommand, Mode=OneWay}"
HotKey="F4" />
<MenuItem Header="F5 Long"
<MenuItem Header="{x:Static localization:Resources.Long_Header}"
Command="{Binding ToggleLongCommand, Mode=OneWay}"
HotKey="F5" />
<MenuItem Header="F10 Exit"
<MenuItem Header="{x:Static localization:Resources.Exit_Header}"
HotKey="F10"
Command="{Binding ExitCommand, Mode=OneWay}" />
</Menu>
@@ -46,7 +47,7 @@
<Grid Grid.Row="1"
ColumnDefinitions="Auto,*,Auto">
<TextBlock Grid.Column="0"
Text="Offset"
Text="{x:Static localization:Resources.Offset_Text}"
HorizontalAlignment="Left"
Foreground="Cyan"
FontWeight="Bold" />
@@ -56,7 +57,7 @@
Foreground="Cyan"
FontWeight="Bold" />
<TextBlock Grid.Column="2"
Text="ASCII "
Text="{x:Static localization:Resources.ASCII_Text"
HorizontalAlignment="Left"
Foreground="Cyan"
FontWeight="Bold" />
@@ -93,7 +94,7 @@
<StackPanel Orientation="Horizontal"
Grid.Row="3">
<TextBlock Foreground="SlateBlue"
Text="Current sector: " />
Text="{x:Static localization:Resources.CurrentSector_Text}" />
<TextBlock Foreground="Lime"
Text="{Binding CurrentSector, Mode=OneWay}" />
</StackPanel>

View File

@@ -5,6 +5,7 @@
xmlns:windows="clr-namespace:Aaru.Tui.ViewModels.Windows"
xmlns:brushes="https://github.com/jinek/consolonia"
xmlns:windowManager="clr-namespace:Iciclecreek.Avalonia.WindowManager;assembly=Iciclecreek.Avalonia.WindowManager"
xmlns:localization="clr-namespace:Aaru.Tui.Localization"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
@@ -16,14 +17,14 @@
</Design.DataContext>
<DockPanel>
<Menu DockPanel.Dock="Bottom">
<MenuItem Header="ESC Back"
<MenuItem Header="{x:Static localization:Resources.Back_Header}"
Command="{Binding BackCommand, Mode=OneWay}"
HotKey="Escape" />
<MenuItem Header="F1 Help"
<MenuItem Header="{x:Static localization:Resources.Help_Header}"
Command="{Binding HelpCommand, Mode=OneWay}"
HotKey="F1" />
<MenuItem Header="F2 " />
<MenuItem Header="F10 Exit"
<MenuItem Header="{x:Static localization:Resources.Exit_Header}"
Command="{Binding ExitCommand, Mode=OneWay}"
HotKey="F10" />
</Menu>
@@ -61,77 +62,86 @@
Brush="Blue" />
</Border.BorderBrush>
<StackPanel HorizontalAlignment="Stretch">
<TextBlock Text="Partition information"
<TextBlock Text="{x:Static localization:Resources.PartitionInformation_Text}"
Foreground="SlateBlue"
HorizontalAlignment="Center" />
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Sequence: " />
Text="{x:Static localization:Resources.PartitionSequence_Text}" />
<TextBlock Grid.Column="1"
Foreground="LawnGreen"
Text="{Binding PartitionSequence, Mode=OneWay}" />
</Grid>
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Name: " />
Text="{x:Static localization:Resources.PartitionName_Text}" />
<TextBlock Grid.Column="1"
Foreground="DarkGreen"
Text="{Binding PartitionName, Mode=OneWay}" />
</Grid>
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Type: " />
Text="{x:Static localization:Resources.PartitionType_Text}" />
<TextBlock Grid.Column="1"
Foreground="Olive"
Text="{Binding PartitionType, Mode=OneWay}" />
</Grid>
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Starting sector: " />
Text="{x:Static localization:Resources.PartitionStartingSector_Text}" />
<TextBlock Grid.Column="1"
Foreground="Violet"
Text="{Binding PartitionStart, Mode=OneWay}" />
</Grid>
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Offset: " />
Text="{x:Static localization:Resources.PartitionOffset_Text}" />
<TextBlock Grid.Column="1"
Foreground="Lime"
Text="{Binding PartitionOffset, Mode=OneWay}" />
</Grid>
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Length: " />
Text="{x:Static localization:Resources.PartitionLength_Text}" />
<TextBlock Grid.Column="1"
Foreground="Violet"
Text="{Binding PartitionLength, Mode=OneWay}" />
</Grid>
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Size: " />
Text="{x:Static localization:Resources.PartitionSize_Text}" />
<TextBlock Grid.Column="1"
Foreground="Lime"
Text="{Binding PartitionSize, Mode=OneWay}" />
</Grid>
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Scheme: " />
Text="{x:Static localization:Resources.PartitionScheme_Text}" />
<TextBlock Grid.Column="1"
Foreground="Purple"
Text="{Binding PartitionScheme, Mode=OneWay}" />
</Grid>
<Grid ColumnDefinitions="Auto,*">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Foreground="SlateBlue"
Text="Description: " />
Text="{x:Static localization:Resources.PartitionDescription_Text}" />
<TextBlock Grid.Column="1"
Foreground="Fuchsia"
Text="{Binding PartitionDescription, Mode=OneWay}" />
@@ -148,7 +158,7 @@
<ScrollViewer>
<StackPanel>
<TextBlock Foreground="SlateBlue"
Text="Filesystem information"
Text="{x:Static localization:Resources.FilesystemInformation_Text}"
HorizontalAlignment="Center" />
<TextBox Background="Transparent"
TextWrapping="Wrap"

View File

@@ -4,6 +4,7 @@
xmlns:windows="clr-namespace:Aaru.Tui.ViewModels.Windows"
xmlns:models="clr-namespace:Aaru.Tui.Models"
xmlns:controls="clr-namespace:Aaru.Tui.Controls"
xmlns:localization="clr-namespace:Aaru.Tui.Localization"
x:Class="Aaru.Tui.Views.Windows.MainWindow"
RequestedThemeVariant="Dark"
Title="Aaru">
@@ -13,17 +14,17 @@
<DockPanel>
<Menu DockPanel.Dock="Bottom">
<MenuItem Header="ESC " />
<MenuItem Header="F1 Help"
<MenuItem Header="{x:Static localization:Resources.Help_Header}"
Command="{Binding HelpCommand, Mode=OneWay}"
HotKey="F1" />
<MenuItem Header="F2 ScVw"
<MenuItem Header="{x:Static localization:Resources.SectorViewer_Header}"
Command="{Binding SectorViewCommand, Mode=OneWay}"
HotKey="F2" />
<MenuItem Header="F3 " />
<MenuItem Header="F4 GoTo"
<MenuItem Header="{x:Static localization:Resources.GoTo_Header}"
Command="{Binding GoToPathCommand, Mode=OneWay}"
HotKey="F4" />
<MenuItem Header="F10 Exit"
<MenuItem Header="{x:Static localization:Resources.Exit_Header}"
Command="{Binding ExitCommand, Mode=OneWay}"
HotKey="F10" />
</Menu>
@@ -103,31 +104,34 @@
Brush="Blue" />
</Border.BorderBrush>
<Grid RowDefinitions="Auto, *, *, *, *">
<TextBlock Text="File information"
<TextBlock Text="{x:Static localization:Resources.FileInformation_Text}"
Grid.Row="0"
HorizontalAlignment="Center"
Foreground="SlateBlue" />
<Grid ColumnDefinitions="Auto, *"
Grid.Row="1"
ColumnSpacing="1"
IsVisible="{Binding SelectedFileIsNotDirectory, Mode=OneWay}">
<TextBlock Grid.Column="0"
Text="Length: " />
Text="{x:Static localization:Resources.FileLength_Text}" />
<TextBlock Grid.Column="1"
Text="{Binding SelectedFileLength, Mode=OneWay}"
Foreground="Aqua" />
</Grid>
<Grid ColumnDefinitions="Auto, *"
Grid.Row="2">
Grid.Row="2"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Text="Creation time: " />
Text="{x:Static localization:Resources.FileCreationTime_Text}" />
<TextBlock Grid.Column="1"
Text="{Binding SelectedFileCreationTime, Mode=OneWay}"
Foreground="Yellow" />
</Grid>
<Grid ColumnDefinitions="Auto, *"
Grid.Row="3">
Grid.Row="3"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Text="Last write time: " />
Text="{x:Static localization:Resources.FileLastWriteTime_Text}" />
<TextBlock Grid.Column="1"
Text="{Binding SelectedFileLastWriteTime, Mode=OneWay}"
Foreground="Yellow" />
@@ -135,9 +139,10 @@
<OnPlatform>
<OnPlatform.Windows>
<Grid ColumnDefinitions="Auto, *"
Grid.Row="4">
Grid.Row="4"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Text="Attributes: " />
Text="{x:Static localization:Resources.FileAttributes_Text}" />
<TextBlock Grid.Column="1"
Text="{Binding SelectedFileAttributes, Mode=OneWay}"
Foreground="Green" />
@@ -145,9 +150,10 @@
</OnPlatform.Windows>
<OnPlatform.Default>
<Grid ColumnDefinitions="Auto, *"
Grid.Row="4">
Grid.Row="4"
ColumnSpacing="1">
<TextBlock Grid.Column="0"
Text="Mode: " />
Text="{x:Static localization:Resources.FileMode_Text}" />
<TextBlock Grid.Column="1"
Text="{Binding SelectedFileUnixMode, Mode=OneWay}"
Foreground="Green" />
@@ -166,7 +172,7 @@
<ScrollViewer>
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Stretch">
<TextBlock Text="Image information"
<TextBlock Text="{x:Static localization:Resources.FileInformation_Text}"
Foreground="SlateBlue"
FontWeight="Bold"
HorizontalAlignment="Center" />