diff --git a/Directory.Packages.props b/Directory.Packages.props
index dbc519b8ba4..ca5d2f1f68d 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -3,6 +3,7 @@
+
diff --git a/src/BizHawk.Client.DiscoHawk/About.Designer.cs b/src/BizHawk.Client.DiscoHawk/About.Designer.cs
deleted file mode 100644
index c33456f21e1..00000000000
--- a/src/BizHawk.Client.DiscoHawk/About.Designer.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-namespace BizHawk.Client.DiscoHawk
-{
- partial class About
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About));
- this.richTextBox1 = new System.Windows.Forms.RichTextBox();
- this.button1 = new System.Windows.Forms.Button();
- this.lblVersion = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // richTextBox1
- //
- this.richTextBox1.Location = new System.Drawing.Point(12, 12);
- this.richTextBox1.Name = "richTextBox1";
- this.richTextBox1.ReadOnly = true;
- this.richTextBox1.Size = new System.Drawing.Size(499, 236);
- this.richTextBox1.TabIndex = 1;
- this.richTextBox1.Text = resources.GetString("richTextBox1.Text");
- this.richTextBox1.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBox1_LinkClicked);
- //
- // button1
- //
- this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.button1.Location = new System.Drawing.Point(436, 254);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 2;
- this.button1.Text = "OK";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // lblVersion
- //
- this.lblVersion.AutoSize = true;
- this.lblVersion.Location = new System.Drawing.Point(12, 259);
- this.lblVersion.Name = "lblVersion";
- this.lblVersion.Size = new System.Drawing.Size(79, 13);
- this.lblVersion.TabIndex = 3;
- this.lblVersion.Text = "version number";
- //
- // About
- //
- this.AcceptButton = this.button1;
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.CancelButton = this.button1;
- this.ClientSize = new System.Drawing.Size(525, 282);
- this.ControlBox = false;
- this.Controls.Add(this.lblVersion);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.richTextBox1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
- this.MinimizeBox = false;
- this.Name = "About";
- this.Text = "About DiscoHawk";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.RichTextBox richTextBox1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Label lblVersion;
- }
-}
\ No newline at end of file
diff --git a/src/BizHawk.Client.DiscoHawk/About.cs b/src/BizHawk.Client.DiscoHawk/About.cs
index 16fcf8d3b31..c2a852990ae 100644
--- a/src/BizHawk.Client.DiscoHawk/About.cs
+++ b/src/BizHawk.Client.DiscoHawk/About.cs
@@ -1,25 +1,58 @@
+using System.Reflection;
using System.Windows.Forms;
using BizHawk.Common;
namespace BizHawk.Client.DiscoHawk
{
- public partial class About : Form
+ public class About : Form
{
- public About()
+ public About(MultiMessageContext i18n)
{
- InitializeComponent();
- lblVersion.Text = $"v{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}";
- }
+ SuspendLayout();
- private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)
- {
- Util.OpenUrlExternal(e.LinkText);
- }
+ RichTextBox richTextBox1 = new();
+ richTextBox1.Location = new(12, 12);
+ richTextBox1.Name = "richTextBox1";
+ richTextBox1.ReadOnly = true;
+ richTextBox1.Size = new(499, 236);
+ richTextBox1.TabIndex = 1;
+ richTextBox1.Text = i18n["discohawkabout-4584-lbl-explainer"]!.Replace("\n", Environment.NewLine);
+ richTextBox1.LinkClicked += (_, clickedArgs) => Util.OpenUrlExternal(clickedArgs.LinkText);
- private void button1_Click(object sender, EventArgs e)
- {
- Close();
+ Button button1 = new();
+ button1.DialogResult = DialogResult.Cancel;
+ button1.Location = new(436, 254);
+ button1.Name = "button1";
+ button1.Size = new(75, 23);
+ button1.TabIndex = 2;
+ button1.Text = i18n.GetWithMnemonic("discohawkabout-9804-btn-dismiss");
+ button1.UseVisualStyleBackColor = true;
+ button1.Click += (_, _) => Close();
+
+ Label lblVersion = new();
+ lblVersion.AutoSize = true;
+ lblVersion.Location = new(12, 259);
+ lblVersion.Name = "lblVersion";
+ lblVersion.Size = new(79, 13);
+ lblVersion.TabIndex = 3;
+ lblVersion.Text = $"v{Assembly.GetExecutingAssembly().GetName().Version}";
+
+ AcceptButton = button1;
+ AutoScaleDimensions = new(6.0f, 13.0f);
+ AutoScaleMode = AutoScaleMode.Font;
+ CancelButton = button1;
+ ClientSize = new(525, 282);
+ ControlBox = false;
+ Controls.Add(lblVersion);
+ Controls.Add(button1);
+ Controls.Add(richTextBox1);
+ FormBorderStyle = FormBorderStyle.FixedDialog;
+ MinimizeBox = false;
+ Name = "About";
+ Text = i18n["discohawkabout-2822-windowtitlestatic"];
+ ResumeLayout(performLayout: false);
+ PerformLayout();
}
}
}
diff --git a/src/BizHawk.Client.DiscoHawk/About.resx b/src/BizHawk.Client.DiscoHawk/About.resx
deleted file mode 100644
index df0c33f24c8..00000000000
--- a/src/BizHawk.Client.DiscoHawk/About.resx
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- DiscoHawk converts bolloxed-up crusty disc images to totally tidy CCD.
-
-DiscoHawk is part of the BizHawk project ( https://github.com/TASEmulators/BizHawk ).
-
-BizHawk is a .net-based multi-system emulator brought to you by some of the rerecording emulator principals. We wrote our own cue parsing/generating code to be able to handle any kind of junk we threw at it. Instead of trapping it in the emulator, we liberated it in the form of this tool, to be useful in other environments.
-
-To use, drag a disc (.cue, .iso, .ccd, .cdi, .mds, .nrg) into the top area. DiscoHawk will dump a newly cleaned up CCD file set to the same directory as the original disc image, and call it _hawked.
-
-This is beta software. You are invited to report problems to our bug tracker or IRC. Problems consist of: crusty disc images that crash DiscoHawk or that cause DiscoHawk to produce a _hawked.ccd which fails to serve your particular purposes (which we will need to be informed of, in case we are outputting wrongly.)
-
-
\ No newline at end of file
diff --git a/src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj b/src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj
index a3331e1bde0..961aa30ba14 100755
--- a/src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj
+++ b/src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj
@@ -10,9 +10,11 @@
true
+
+
diff --git a/src/BizHawk.Client.DiscoHawk/ComparisonResults.Designer.cs b/src/BizHawk.Client.DiscoHawk/ComparisonResults.Designer.cs
deleted file mode 100644
index df1b7b78097..00000000000
--- a/src/BizHawk.Client.DiscoHawk/ComparisonResults.Designer.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-namespace BizHawk.Client.DiscoHawk
-{
- partial class ComparisonResults
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.textBox1 = new System.Windows.Forms.RichTextBox();
- this.tabControl1 = new System.Windows.Forms.TabControl();
- this.tabPage1 = new System.Windows.Forms.TabPage();
- this.tabPage2 = new System.Windows.Forms.TabPage();
- this.tabPage3 = new System.Windows.Forms.TabPage();
- this.tabControl1.SuspendLayout();
- this.tabPage1.SuspendLayout();
- this.SuspendLayout();
- //
- // textBox1
- //
- this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.textBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.textBox1.Location = new System.Drawing.Point(3, 3);
- this.textBox1.Name = "textBox1";
- this.textBox1.ReadOnly = true;
- this.textBox1.Size = new System.Drawing.Size(757, 394);
- this.textBox1.TabIndex = 1;
- this.textBox1.Text = "";
- //
- // tabControl1
- //
- this.tabControl1.Controls.Add(this.tabPage1);
- this.tabControl1.Controls.Add(this.tabPage2);
- this.tabControl1.Controls.Add(this.tabPage3);
- this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tabControl1.Location = new System.Drawing.Point(0, 0);
- this.tabControl1.Name = "tabControl1";
- this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(771, 426);
- this.tabControl1.TabIndex = 2;
- //
- // tabPage1
- //
- this.tabPage1.Controls.Add(this.textBox1);
- this.tabPage1.Location = new System.Drawing.Point(4, 22);
- this.tabPage1.Name = "tabPage1";
- this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage1.Size = new System.Drawing.Size(763, 400);
- this.tabPage1.TabIndex = 0;
- this.tabPage1.Text = "Log";
- this.tabPage1.UseVisualStyleBackColor = true;
- //
- // tabPage2
- //
- this.tabPage2.Location = new System.Drawing.Point(4, 22);
- this.tabPage2.Name = "tabPage2";
- this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage2.Size = new System.Drawing.Size(763, 400);
- this.tabPage2.TabIndex = 1;
- this.tabPage2.Text = "SRC Context";
- this.tabPage2.UseVisualStyleBackColor = true;
- //
- // tabPage3
- //
- this.tabPage3.Location = new System.Drawing.Point(4, 22);
- this.tabPage3.Name = "tabPage3";
- this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage3.Size = new System.Drawing.Size(763, 400);
- this.tabPage3.TabIndex = 2;
- this.tabPage3.Text = "DST Context";
- this.tabPage3.UseVisualStyleBackColor = true;
- //
- // ComparisonResults
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(771, 426);
- this.Controls.Add(this.tabControl1);
- this.Name = "ComparisonResults";
- this.Text = "ComparisonResults";
- this.tabControl1.ResumeLayout(false);
- this.tabPage1.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- public System.Windows.Forms.RichTextBox textBox1;
- private System.Windows.Forms.TabControl tabControl1;
- private System.Windows.Forms.TabPage tabPage1;
- private System.Windows.Forms.TabPage tabPage2;
- private System.Windows.Forms.TabPage tabPage3;
-
-
-
- }
-}
\ No newline at end of file
diff --git a/src/BizHawk.Client.DiscoHawk/ComparisonResults.cs b/src/BizHawk.Client.DiscoHawk/ComparisonResults.cs
index 5e64950a669..e88e7a09176 100644
--- a/src/BizHawk.Client.DiscoHawk/ComparisonResults.cs
+++ b/src/BizHawk.Client.DiscoHawk/ComparisonResults.cs
@@ -1,12 +1,76 @@
-using System.Windows.Forms;
+using System.Drawing;
+using System.Windows.Forms;
namespace BizHawk.Client.DiscoHawk
{
- public partial class ComparisonResults : Form
+ public class ComparisonResults : Form
{
- public ComparisonResults()
+ public readonly RichTextBox textBox1;
+
+ public ComparisonResults(MultiMessageContext i18n)
{
- InitializeComponent();
+ SuspendLayout();
+
+ textBox1 = new();
+ textBox1.Dock = DockStyle.Fill;
+ textBox1.Font = new("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0);
+ textBox1.Location = new(3, 3);
+ textBox1.Name = "textBox1";
+ textBox1.ReadOnly = true;
+ textBox1.Size = new(757, 394);
+ textBox1.TabIndex = 1;
+ textBox1.Text = string.Empty; // overwritten by caller as part of object initialisation
+
+ TabControl tabControl1 = new();
+ tabControl1.SuspendLayout();
+ TabPage tabPage1 = new();
+ TabPage tabPage2 = new();
+ TabPage tabPage3 = new();
+ tabControl1.Controls.Add(tabPage1);
+ tabControl1.Controls.Add(tabPage2);
+ tabControl1.Controls.Add(tabPage3);
+ tabControl1.Dock = DockStyle.Fill;
+ tabControl1.Location = new(0, 0);
+ tabControl1.Name = "tabControl1";
+ tabControl1.SelectedIndex = 0;
+ tabControl1.Size = new(771, 426);
+ tabControl1.TabIndex = 2;
+
+ tabPage1.SuspendLayout();
+ tabPage1.Controls.Add(textBox1);
+ tabPage1.Location = new(4, 22);
+ tabPage1.Name = "tabPage1";
+ tabPage1.Padding = new(all: 3);
+ tabPage1.Size = new(763, 400);
+ tabPage1.TabIndex = 0;
+ tabPage1.Text = i18n.GetWithMnemonic("discohawkcomparereadout-6110-tab-log");
+ tabPage1.UseVisualStyleBackColor = true;
+
+ tabPage2.Location = new(4, 22);
+ tabPage2.Name = "tabPage2";
+ tabPage2.Padding = new(all: 3);
+ tabPage2.Size = new(763, 400);
+ tabPage2.TabIndex = 1;
+ tabPage2.Text = i18n.GetWithMnemonic("discohawkcomparereadout-6110-tab-src");
+ tabPage2.UseVisualStyleBackColor = true;
+
+ tabPage3.Location = new(4, 22);
+ tabPage3.Name = "tabPage3";
+ tabPage3.Padding = new(all: 3);
+ tabPage3.Size = new(763, 400);
+ tabPage3.TabIndex = 2;
+ tabPage3.Text = i18n.GetWithMnemonic("discohawkcomparereadout-6110-tab-dest");
+ tabPage3.UseVisualStyleBackColor = true;
+
+ AutoScaleDimensions = new(6.0f, 13.0f);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new(771, 426);
+ Controls.Add(tabControl1);
+ Name = "ComparisonResults";
+ Text = i18n["discohawkcomparereadout-2005-windowtitlestatic"];
+ tabControl1.ResumeLayout(performLayout: false);
+ tabPage1.ResumeLayout(performLayout: false);
+ ResumeLayout(performLayout: false);
}
}
}
diff --git a/src/BizHawk.Client.DiscoHawk/ComparisonResults.resx b/src/BizHawk.Client.DiscoHawk/ComparisonResults.resx
deleted file mode 100644
index 29dcb1b3a35..00000000000
--- a/src/BizHawk.Client.DiscoHawk/ComparisonResults.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.Designer.cs b/src/BizHawk.Client.DiscoHawk/MainDiscoForm.Designer.cs
deleted file mode 100644
index 1bf3a131365..00000000000
--- a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.Designer.cs
+++ /dev/null
@@ -1,292 +0,0 @@
-namespace BizHawk.Client.DiscoHawk
-{
- partial class MainDiscoForm
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("BizHawk");
- System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("Mednafen");
- this.ExitButton = new System.Windows.Forms.Button();
- this.lblMagicDragArea = new System.Windows.Forms.Panel();
- this.label1 = new System.Windows.Forms.Label();
- this.lblMp3ExtractMagicArea = new System.Windows.Forms.Panel();
- this.label2 = new System.Windows.Forms.Label();
- this.btnAbout = new System.Windows.Forms.Button();
- this.radioButton1 = new System.Windows.Forms.RadioButton();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.label4 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.ccdOutputButton = new System.Windows.Forms.RadioButton();
- this.chdOutputButton = new System.Windows.Forms.RadioButton();
- this.label6 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.lvCompareTargets = new System.Windows.Forms.ListView();
- this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
- this.lblMagicDragArea.SuspendLayout();
- this.lblMp3ExtractMagicArea.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.SuspendLayout();
- //
- // ExitButton
- //
- this.ExitButton.Location = new System.Drawing.Point(434, 414);
- this.ExitButton.Name = "ExitButton";
- this.ExitButton.Size = new System.Drawing.Size(75, 23);
- this.ExitButton.TabIndex = 0;
- this.ExitButton.Text = "E&xit";
- this.ExitButton.UseVisualStyleBackColor = true;
- this.ExitButton.Click += new System.EventHandler(this.ExitButton_Click);
- //
- // lblMagicDragArea
- //
- this.lblMagicDragArea.AllowDrop = true;
- this.lblMagicDragArea.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.lblMagicDragArea.Controls.Add(this.label1);
- this.lblMagicDragArea.Location = new System.Drawing.Point(290, 31);
- this.lblMagicDragArea.Name = "lblMagicDragArea";
- this.lblMagicDragArea.Size = new System.Drawing.Size(223, 109);
- this.lblMagicDragArea.TabIndex = 1;
- this.lblMagicDragArea.DragDrop += new System.Windows.Forms.DragEventHandler(this.lblMagicDragArea_DragDrop);
- this.lblMagicDragArea.DragEnter += new System.Windows.Forms.DragEventHandler(this.LblMagicDragArea_DragEnter);
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(17, 25);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(166, 47);
- this.label1.TabIndex = 0;
- this.label1.Text = "Drag here to HAWK your disc - dump it out as a clean CCD/CHD";
- //
- // lblMp3ExtractMagicArea
- //
- this.lblMp3ExtractMagicArea.AllowDrop = true;
- this.lblMp3ExtractMagicArea.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.lblMp3ExtractMagicArea.Controls.Add(this.label2);
- this.lblMp3ExtractMagicArea.Location = new System.Drawing.Point(290, 146);
- this.lblMp3ExtractMagicArea.Name = "lblMp3ExtractMagicArea";
- this.lblMp3ExtractMagicArea.Size = new System.Drawing.Size(223, 100);
- this.lblMp3ExtractMagicArea.TabIndex = 2;
- this.lblMp3ExtractMagicArea.DragDrop += new System.Windows.Forms.DragEventHandler(this.LblMp3ExtractMagicArea_DragDrop);
- this.lblMp3ExtractMagicArea.DragEnter += new System.Windows.Forms.DragEventHandler(this.LblMagicDragArea_DragEnter);
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(20, 25);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(163, 39);
- this.label2.TabIndex = 0;
- this.label2.Text = "Drag a disc here to extract the audio tracks to MP3";
- //
- // btnAbout
- //
- this.btnAbout.Location = new System.Drawing.Point(353, 414);
- this.btnAbout.Name = "btnAbout";
- this.btnAbout.Size = new System.Drawing.Size(75, 23);
- this.btnAbout.TabIndex = 3;
- this.btnAbout.Text = "&About";
- this.btnAbout.UseVisualStyleBackColor = true;
- this.btnAbout.Click += new System.EventHandler(this.BtnAbout_Click);
- //
- // radioButton1
- //
- this.radioButton1.AutoSize = true;
- this.radioButton1.Checked = true;
- this.radioButton1.Location = new System.Drawing.Point(6, 19);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(67, 17);
- this.radioButton1.TabIndex = 4;
- this.radioButton1.TabStop = true;
- this.radioButton1.Text = "BizHawk";
- this.radioButton1.UseVisualStyleBackColor = true;
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.label4);
- this.groupBox1.Controls.Add(this.label3);
- this.groupBox1.Controls.Add(this.radioButton2);
- this.groupBox1.Controls.Add(this.radioButton1);
- this.groupBox1.Enabled = true;
- this.groupBox1.Location = new System.Drawing.Point(9, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(276, 234);
- this.groupBox1.TabIndex = 5;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "Disc Reading Engine";
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(20, 95);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(216, 43);
- this.label4.TabIndex = 8;
- this.label4.Text = "- Doesn\'t support audio decoding yet\r\n(even though Mednafen proper can do it)\r\n- " + "Loads ISO, CUE, and CCD";
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(20, 39);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(253, 33);
- this.label3.TabIndex = 7;
- this.label3.Text = "- Uses FFMPEG for audio decoding\r\n- Loads ISO, CUE, CCD, CDI, CHD, MDS, and NRG";
- //
- // radioButton2
- //
- this.radioButton2.AutoSize = true;
- this.radioButton2.Enabled = false;
- this.radioButton2.Location = new System.Drawing.Point(6, 75);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(73, 17);
- this.radioButton2.TabIndex = 5;
- this.radioButton2.Text = "Mednafen";
- this.radioButton2.UseVisualStyleBackColor = true;
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.ccdOutputButton);
- this.groupBox2.Controls.Add(this.chdOutputButton);
- this.groupBox2.Enabled = true;
- this.groupBox2.Location = new System.Drawing.Point(9, 252);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(271, 69);
- this.groupBox2.TabIndex = 6;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "Output Format";
- //
- // ccdOutputButton
- //
- this.ccdOutputButton.AutoSize = true;
- this.ccdOutputButton.Checked = true;
- this.ccdOutputButton.Location = new System.Drawing.Point(12, 19);
- this.ccdOutputButton.Name = "ccdOutputButton";
- this.ccdOutputButton.Size = new System.Drawing.Size(47, 17);
- this.ccdOutputButton.TabIndex = 5;
- this.ccdOutputButton.TabStop = true;
- this.ccdOutputButton.Text = "CCD";
- this.ccdOutputButton.UseVisualStyleBackColor = true;
- //
- // chdOutputButton
- //
- this.chdOutputButton.AutoSize = true;
- this.chdOutputButton.Checked = false;
- this.chdOutputButton.Location = new System.Drawing.Point(65, 19);
- this.chdOutputButton.Name = "chdOutputButton";
- this.chdOutputButton.Size = new System.Drawing.Size(47, 17);
- this.chdOutputButton.TabIndex = 6;
- this.chdOutputButton.TabStop = true;
- this.chdOutputButton.Text = "CHD";
- this.chdOutputButton.UseVisualStyleBackColor = true;
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Enabled = false;
- this.label6.Location = new System.Drawing.Point(9, 324);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(111, 13);
- this.label6.TabIndex = 2;
- this.label6.Text = "Compare Reading To:";
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(358, 12);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(70, 13);
- this.label7.TabIndex = 10;
- this.label7.Text = "- Operations -";
- //
- // lvCompareTargets
- //
- this.lvCompareTargets.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1 });
- this.lvCompareTargets.Enabled = false;
- this.lvCompareTargets.FullRowSelect = true;
- this.lvCompareTargets.GridLines = true;
- this.lvCompareTargets.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
- this.lvCompareTargets.HideSelection = false;
- this.lvCompareTargets.Items.AddRange(new System.Windows.Forms.ListViewItem[] { listViewItem1, listViewItem2 });
- this.lvCompareTargets.Location = new System.Drawing.Point(9, 340);
- this.lvCompareTargets.Name = "lvCompareTargets";
- this.lvCompareTargets.Size = new System.Drawing.Size(121, 97);
- this.lvCompareTargets.TabIndex = 11;
- this.lvCompareTargets.UseCompatibleStateImageBehavior = false;
- this.lvCompareTargets.View = System.Windows.Forms.View.Details;
- //
- // MainDiscoForm
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(521, 449);
- this.Controls.Add(this.lvCompareTargets);
- this.Controls.Add(this.label6);
- this.Controls.Add(this.label7);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.Controls.Add(this.btnAbout);
- this.Controls.Add(this.lblMp3ExtractMagicArea);
- this.Controls.Add(this.lblMagicDragArea);
- this.Controls.Add(this.ExitButton);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "MainDiscoForm";
- this.Text = "DiscoHawk";
- this.Load += new System.EventHandler(this.MainDiscoForm_Load);
- this.lblMagicDragArea.ResumeLayout(false);
- this.lblMp3ExtractMagicArea.ResumeLayout(false);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
- }
-
- #endregion
-
- private System.Windows.Forms.Button ExitButton;
- private System.Windows.Forms.Panel lblMagicDragArea;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Panel lblMp3ExtractMagicArea;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Button btnAbout;
- private System.Windows.Forms.RadioButton radioButton1;
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.RadioButton radioButton2;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.GroupBox groupBox2;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.RadioButton ccdOutputButton;
- private System.Windows.Forms.RadioButton chdOutputButton;
- private System.Windows.Forms.ListView lvCompareTargets;
- private System.Windows.Forms.ColumnHeader columnHeader1;
- }
-}
\ No newline at end of file
diff --git a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs b/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs
index 1e5e0924dcc..b79323614d0 100644
--- a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs
+++ b/src/BizHawk.Client.DiscoHawk/MainDiscoForm.cs
@@ -9,29 +9,232 @@
namespace BizHawk.Client.DiscoHawk
{
- public partial class MainDiscoForm : Form
+ public class MainDiscoForm : Form
{
+ private readonly MultiMessageContext _i18n;
+
+ private readonly RadioButton ccdOutputButton;
+
+ private readonly RadioButton chdOutputButton;
+
+ private readonly Panel lblMagicDragArea;
+
+ private readonly Panel lblMp3ExtractMagicArea;
+
+ private readonly ListView lvCompareTargets;
+
// Release TODO:
// An input (queue) list
// An outputted list showing new file name
// Progress bar should show file being converted
// Add disc button, which puts it on the progress cue (converts it)
- public MainDiscoForm()
+ public MainDiscoForm(MultiMessageContext i18n)
{
- InitializeComponent();
+ _i18n = i18n;
+
+ SuspendLayout();
+
+ Button ExitButton = new();
+ ExitButton.Location = new(434, 414);
+ ExitButton.Name = "ExitButton";
+ ExitButton.Size = new(75, 23);
+ ExitButton.TabIndex = 0;
+ ExitButton.Text = i18n.GetWithMnemonic("maindiscoform-4723-btn-exit");
+ ExitButton.UseVisualStyleBackColor = true;
+ ExitButton.Click += (_, _) => Close();
+
+ lblMagicDragArea = new();
+ lblMagicDragArea.SuspendLayout();
+ Label label1 = new();
+ lblMagicDragArea.AllowDrop = true;
+ lblMagicDragArea.BorderStyle = BorderStyle.Fixed3D;
+ lblMagicDragArea.Controls.Add(label1);
+ lblMagicDragArea.Location = new(290, 31);
+ lblMagicDragArea.Name = "lblMagicDragArea";
+ lblMagicDragArea.Size = new(223, 109);
+ lblMagicDragArea.TabIndex = 1;
+ lblMagicDragArea.DragDrop += lblMagicDragArea_DragDrop;
+ lblMagicDragArea.DragEnter += LblMagicDragArea_DragEnter;
+
+ label1.Location = new(17, 25);
+ label1.Name = "label1";
+ label1.Size = new(166, 47);
+ label1.TabIndex = 0;
+ label1.Text = i18n["maindiscoform-1872-area-hawkdisc"];
+
+ lblMp3ExtractMagicArea = new();
+ lblMp3ExtractMagicArea.SuspendLayout();
+ Label label2 = new();
+ lblMp3ExtractMagicArea.AllowDrop = true;
+ lblMp3ExtractMagicArea.BorderStyle = BorderStyle.Fixed3D;
+ lblMp3ExtractMagicArea.Controls.Add(label2);
+ lblMp3ExtractMagicArea.Location = new(290, 146);
+ lblMp3ExtractMagicArea.Name = "lblMp3ExtractMagicArea";
+ lblMp3ExtractMagicArea.Size = new(223, 100);
+ lblMp3ExtractMagicArea.TabIndex = 2;
+ lblMp3ExtractMagicArea.DragDrop += LblMp3ExtractMagicArea_DragDrop;
+ lblMp3ExtractMagicArea.DragEnter += LblMagicDragArea_DragEnter;
+
+ label2.Location = new(20, 25);
+ label2.Name = "label2";
+ label2.Size = new(163, 39);
+ label2.TabIndex = 0;
+ label2.Text = i18n["maindiscoform-6011-area-mp3extract"];
+
+ Button btnAbout = new();
+ btnAbout.Location = new(353, 414);
+ btnAbout.Name = "btnAbout";
+ btnAbout.Size = new(75, 23);
+ btnAbout.TabIndex = 3;
+ btnAbout.Text = i18n.GetWithMnemonic("maindiscoform-5766-btn-about");
+ btnAbout.UseVisualStyleBackColor = true;
+ btnAbout.Click += (_, _) => new About(_i18n).ShowDialog();
+
+ RadioButton radioButton1 = new();
+ radioButton1.AutoSize = true;
+ radioButton1.Checked = true;
+ radioButton1.Location = new(6, 19);
+ radioButton1.Name = "radioButton1";
+ radioButton1.Size = new(67, 17);
+ radioButton1.TabIndex = 4;
+ radioButton1.TabStop = true;
+ radioButton1.Text = i18n.GetWithMnemonic("maindiscoform-4559-radio-engine-hawk");
+ radioButton1.UseVisualStyleBackColor = true;
+
+ GroupBox groupBox1 = new();
+ groupBox1.SuspendLayout();
+ Label label4 = new();
+ Label label3 = new();
+ RadioButton radioButton2 = new();
+ groupBox1.Controls.Add(label4);
+ groupBox1.Controls.Add(label3);
+ groupBox1.Controls.Add(radioButton2);
+ groupBox1.Controls.Add(radioButton1);
+ groupBox1.Enabled = true;
+ groupBox1.Location = new(9, 12);
+ groupBox1.Name = "groupBox1";
+ groupBox1.Size = new(276, 234);
+ groupBox1.TabIndex = 5;
+ groupBox1.TabStop = false;
+ groupBox1.Text = i18n["maindiscoform-7187-group-engine"];
+
+ label4.Location = new(20, 95);
+ label4.Name = "label4";
+ label4.Size = new(216, 43);
+ label4.TabIndex = 8;
+ label4.Text = i18n["maindiscoform-7205-radio-engine-mednafen-longdesc"];
+
+ label3.Location = new(20, 39);
+ label3.Name = "label3";
+ label3.Size = new(253, 33);
+ label3.TabIndex = 7;
+ label3.Text = i18n["maindiscoform-4559-radio-engine-hawk-longdesc"];
+
+ radioButton2.AutoSize = true;
+ radioButton2.Enabled = false;
+ radioButton2.Location = new(6, 75);
+ radioButton2.Name = "radioButton2";
+ radioButton2.Size = new(73, 17);
+ radioButton2.TabIndex = 5;
+ radioButton2.Text = i18n.GetWithMnemonic("maindiscoform-7205-radio-engine-mednafen");
+ radioButton2.UseVisualStyleBackColor = true;
+
+ GroupBox groupBox2 = new();
+ groupBox2.SuspendLayout();
+ ccdOutputButton = new();
+ chdOutputButton = new();
+ groupBox2.Controls.Add(ccdOutputButton);
+ groupBox2.Controls.Add(chdOutputButton);
+ groupBox2.Enabled = true;
+ groupBox2.Location = new(9, 252);
+ groupBox2.Name = "groupBox2";
+ groupBox2.Size = new(271, 69);
+ groupBox2.TabIndex = 6;
+ groupBox2.TabStop = false;
+ groupBox2.Text = i18n["maindiscoform-5561-group-hawkoutput"];
+
+ ccdOutputButton.AutoSize = true;
+ ccdOutputButton.Checked = true;
+ ccdOutputButton.Location = new(12, 19);
+ ccdOutputButton.Name = "ccdOutputButton";
+ ccdOutputButton.Size = new(47, 17);
+ ccdOutputButton.TabIndex = 5;
+ ccdOutputButton.TabStop = true;
+ ccdOutputButton.Text = i18n.GetWithMnemonic("maindiscoform-7576-radio-hawkoutput-ccd");
+ ccdOutputButton.UseVisualStyleBackColor = true;
+
+ chdOutputButton.AutoSize = true;
+ chdOutputButton.Checked = false;
+ chdOutputButton.Location = new(65, 19);
+ chdOutputButton.Name = "chdOutputButton";
+ chdOutputButton.Size = new(47, 17);
+ chdOutputButton.TabIndex = 6;
+ chdOutputButton.TabStop = true;
+ chdOutputButton.Text = i18n.GetWithMnemonic("maindiscoform-2884-radio-hawkoutput-chd");
+ chdOutputButton.UseVisualStyleBackColor = true;
+
+ Label label6 = new();
+ label6.AutoSize = true;
+ label6.Enabled = false;
+ label6.Location = new(9, 324);
+ label6.Name = "label6";
+ label6.Size = new(111, 13);
+ label6.TabIndex = 2;
+ label6.Text = i18n["maindiscoform-4639-group-compare-list"];
+
+ Label label7 = new();
+ label7.AutoSize = true;
+ label7.Location = new(358, 12);
+ label7.Name = "label7";
+ label7.Size = new(70, 13);
+ label7.TabIndex = 10;
+ label7.Text = i18n["maindiscoform-7426-pane-operations"];
+
+ lvCompareTargets = new();
+ lvCompareTargets.Columns.Add(new ColumnHeader());
+ lvCompareTargets.Enabled = false;
+ lvCompareTargets.FullRowSelect = true;
+ lvCompareTargets.GridLines = true;
+ lvCompareTargets.HeaderStyle = ColumnHeaderStyle.None;
+ lvCompareTargets.HideSelection = false;
+ lvCompareTargets.Items.Add(i18n["maindiscoform-5267-compare-hawk"]);
+ lvCompareTargets.Items.Add(i18n["maindiscoform-5267-compare-mednafen"]);
+ lvCompareTargets.Location = new(9, 340);
+ lvCompareTargets.Name = "lvCompareTargets";
+ lvCompareTargets.Size = new(121, 97);
+ lvCompareTargets.TabIndex = 11;
+ lvCompareTargets.UseCompatibleStateImageBehavior = false;
+ lvCompareTargets.View = View.Details;
+
+ AutoScaleDimensions = new(6.0f, 13.0f);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new(521, 449);
+ Controls.Add(lvCompareTargets);
+ Controls.Add(label6);
+ Controls.Add(label7);
+ Controls.Add(groupBox2);
+ Controls.Add(groupBox1);
+ Controls.Add(btnAbout);
+ Controls.Add(lblMp3ExtractMagicArea);
+ Controls.Add(lblMagicDragArea);
+ Controls.Add(ExitButton);
+ FormBorderStyle = FormBorderStyle.FixedDialog;
var icoStream = typeof(MainDiscoForm).Assembly.GetManifestResourceStream("BizHawk.Client.DiscoHawk.discohawk.ico");
if (icoStream != null) Icon = new Icon(icoStream);
else Console.WriteLine("couldn't load .ico EmbeddedResource?");
- }
-
- private void MainDiscoForm_Load(object sender, EventArgs e)
- {
- lvCompareTargets.Columns[0].Width = lvCompareTargets.ClientSize.Width;
- }
-
- private void ExitButton_Click(object sender, EventArgs e)
- {
- Close();
+ MaximizeBox = false;
+ MinimizeBox = false;
+ Name = "MainDiscoForm";
+ Text = i18n["maindiscoform-3997-windowtitlestatic"];
+ Load += (_, _) => lvCompareTargets.Columns[0].Width = lvCompareTargets.ClientSize.Width;
+ lblMagicDragArea.ResumeLayout(performLayout: false);
+ lblMp3ExtractMagicArea.ResumeLayout(performLayout: false);
+ groupBox1.ResumeLayout(performLayout: false);
+ groupBox1.PerformLayout();
+ groupBox2.ResumeLayout(performLayout: false);
+ groupBox2.PerformLayout();
+ ResumeLayout(performLayout: false);
+ PerformLayout();
}
private void lblMagicDragArea_DragDrop(object sender, DragEventArgs e)
@@ -47,14 +250,18 @@ private void lblMagicDragArea_DragDrop(object sender, DragEventArgs e)
{
var success = DiscoHawkLogic.HawkAndWriteFile(
inputPath: file,
- errorCallback: err => MessageBox.Show(err, "Error loading disc"),
+ errorCallback: err => MessageBox.Show(
+ caption: _i18n.GetDialogText("discodischawking-6945-errbox-hawk").Caption,
+ text: err),
hawkedFormat: outputFormat);
if (!success) break;
}
}
catch (Exception ex)
{
- MessageBox.Show(ex.ToString(), "Error loading disc");
+ MessageBox.Show(
+ caption: _i18n.GetDialogText("discodischawking-3654-errbox-misc").Caption,
+ text: ex.ToString());
throw;
}
finally
@@ -123,10 +330,8 @@ private void LblMp3ExtractMagicArea_DragDrop(object sender, DragEventArgs e)
if (!FFmpegService.QueryServiceAvailable())
{
#if true
- MessageBox.Show(
- caption: "FFmpeg missing",
- text: "This function requires FFmpeg, but it doesn't appear to have been downloaded.\n"
- + "EmuHawk can automatically download it: you just need to set up A/V recording with the FFmpeg writer.");
+ var (caption, text) = _i18n.GetDialogText("discomp3extract-5715-errbox-noffmpeg");
+ MessageBox.Show(caption: caption, text: text);
return;
#else
using EmuHawk.FFmpegDownloaderForm dialog = new(); // builds fine when 'd, but the .resx won't load even if it's also included
@@ -144,22 +349,26 @@ private void LblMp3ExtractMagicArea_DragDrop(object sender, DragEventArgs e)
{
using var disc = Disc.LoadAutomagic(file);
var (path, filename, _) = file.SplitPathToDirFileAndExt();
- static bool? PromptForOverwrite(string mp3Path)
- => MessageBox.Show(
- $"Do you want to overwrite existing files? Choosing \"No\" will simply skip those. You could also \"Cancel\" the extraction entirely.\n\ncaused by file: {mp3Path}",
- "File to extract already exists",
- MessageBoxButtons.YesNoCancel) switch
+ bool? PromptForOverwrite(string mp3Path)
+ {
+ var (caption, text) = _i18n.GetDialogText(
+ "discomp3extract-3418-prompt-overwrite",
+ new ArgsDict(filePath: mp3Path));
+ return MessageBox.Show(caption: caption, text: text, buttons: MessageBoxButtons.YesNoCancel) switch
{
DialogResult.Yes => true,
DialogResult.No => false,
_ => null,
};
+ }
AudioExtractor.Extract(disc, path, filename, PromptForOverwrite);
}
}
catch (Exception ex)
{
- MessageBox.Show(ex.ToString(), "Error loading disc");
+ MessageBox.Show(
+ caption: _i18n.GetDialogText("discomp3extract-7691-errbox-misc").Caption,
+ text: ex.ToString());
throw;
}
finally
@@ -168,10 +377,5 @@ private void LblMp3ExtractMagicArea_DragDrop(object sender, DragEventArgs e)
Cursor = Cursors.Default;
}
}
-
- private void BtnAbout_Click(object sender, EventArgs e)
- {
- new About().ShowDialog();
- }
}
}
diff --git a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.resx b/src/BizHawk.Client.DiscoHawk/MainDiscoForm.resx
deleted file mode 100644
index 29dcb1b3a35..00000000000
--- a/src/BizHawk.Client.DiscoHawk/MainDiscoForm.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/src/BizHawk.Client.DiscoHawk/MultiMessageContext.cs b/src/BizHawk.Client.DiscoHawk/MultiMessageContext.cs
new file mode 100644
index 00000000000..b0435a500ce
--- /dev/null
+++ b/src/BizHawk.Client.DiscoHawk/MultiMessageContext.cs
@@ -0,0 +1,158 @@
+#nullable enable
+
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+
+using BizHawk.Common.CollectionExtensions;
+using BizHawk.Common.StringExtensions;
+
+using Fluent.Net;
+using Fluent.Net.RuntimeAst;
+
+namespace BizHawk.Client.DiscoHawk
+{
+ public sealed class ArgsDict : Dictionary
+ {
+ public ArgsDict(string? filePath = null)
+ {
+ Add(nameof(filePath), filePath);
+ }
+ }
+
+ public readonly struct MultiMessageContext
+ {
+ public static MultiMessageContext ForCurrentCulture()
+ {
+ MultiMessageContext mmc = new(CultureInfo.CurrentUICulture.IetfLanguageTag, out var streamException);
+ if (streamException is null && mmc.Culture is not null) return mmc;
+ MultiMessageContext mmc1 = new("en", out var streamException1);
+ if (streamException1 is not null) Console.WriteLine(streamException1);
+ return mmc1;
+ }
+
+ private static IReadOnlyList ReadEmbeddedAndConcat(
+ string lang,
+ MessageContext[] overlays,
+ out Exception? streamException)
+ {
+ MessageContext mc = new(lang, new() { UseIsolating = false });
+ Stream embeddedStream;
+ try
+ {
+ embeddedStream = ReflectionCache.EmbeddedResourceStream($"locale.{lang}.ftl");
+ }
+ catch (ArgumentException e)
+ {
+ streamException = e;
+ return overlays;
+ }
+ using StreamReader sr = new(embeddedStream);
+ var errors = mc.AddMessages(sr);
+ foreach (var error in errors) Console.WriteLine(error);
+ streamException = null;
+ return [ ..overlays, mc ];
+ }
+
+ private readonly IReadOnlyList _contexts;
+
+ public readonly CultureInfo? Culture;
+
+ public MultiMessageContext(IReadOnlyList contexts)
+ {
+ _contexts = contexts;
+ var langcode = _contexts.FirstOrDefault()?.Locales?.First();
+ if (langcode is null) return;
+ try
+ {
+ Culture = new(langcode);
+ }
+ catch (Exception)
+ {
+ try
+ {
+ Culture = new(langcode.SubstringBefore('-'));
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ }
+ }
+ }
+
+ public MultiMessageContext(string lang, out Exception? streamException, params MessageContext[] overlays)
+ : this(ReadEmbeddedAndConcat(lang, overlays, out streamException)) {}
+
+ public string? this[string id]
+ => GetString(id);
+
+ public (string? Caption, string Text) GetDialogText(
+ string id,
+ IDictionary? args = null,
+ ICollection? errors = null)
+ => GetNode(id) is (var msg, var fromCtx)
+ ? (msg.Attributes.TryGetValue("windowtitle", out var caption)
+ ? fromCtx.Format(caption, args, errors)
+ : null,
+ fromCtx.Format(msg, args, errors))
+ : (null, string.Empty);
+
+ private (Message Message, MessageContext FromContext)? GetNode(string id)
+ => _contexts.Select(ctx => (Message: ctx.GetMessage(id), FromContext: ctx))
+ .FirstOrNull(static tuple => tuple.Message is not null);
+
+ public string? GetString(
+ string id,
+ IDictionary? args = null,
+ ICollection? errors = null)
+ => GetNode(id) is (var msg, var fromCtx) ? fromCtx.Format(msg, args, errors) : null;
+
+ public string? GetWithMnemonic(
+ string id,
+ IDictionary? args = null,
+ ICollection? errors = null)
+ {
+ const string ATTR_NAME_CHAR = "mnemonic";
+ const string ATTR_NAME_INDEX = "mnemonicindex";
+ const string ERR_PFX = $"[i18n {nameof(GetWithMnemonic)}]";
+ const string ERR_FMT_STR_MNEMONIC_CHAR_ABSENT = $"{ERR_PFX} the char {{0}}.{ATTR_NAME_CHAR} isn't present in the string (wrong case?)";
+ const string ERR_FMT_STR_MNEMONIC_CHAR_ISNT = $"{ERR_PFX} {{0}}.{ATTR_NAME_CHAR} is not a single char";
+ const string ERR_FMT_STR_MNEMONIC_INDEX_ISNT = $"{ERR_PFX} failed to parse {{0}}.{ATTR_NAME_INDEX} as int";
+ const string ERR_FMT_STR_MNEMONIC_INDEX_MISMATCH = $"{ERR_PFX} {{0}}.{ATTR_NAME_INDEX} points to '{{1}}', which doesn't match .{ATTR_NAME_CHAR} (case-sensitive)";
+ const string ERR_FMT_STR_MNEMONIC_INDEX_OOR = $"{ERR_PFX} {{0}}.{ATTR_NAME_INDEX} out of range 0..<{{1}}";
+ if (GetNode(id) is not (var msg, var fromCtx)) return null;
+ string? GetAttr(string attrID)
+ => msg.Attributes?.TryGetValue(attrID, out var mn) is true ? fromCtx.Format(mn, args, errors) : null;
+ var strWithoutMn = fromCtx.Format(msg, args, errors);
+ string? Fail(string msgFmtStr, object? extraArg = null)
+ {
+ Console.WriteLine(string.Format(msgFmtStr, id, extraArg));
+ return strWithoutMn;
+ }
+ //TODO make the char searches case-insensitive?
+ if (GetAttr(ATTR_NAME_INDEX) is string iAmpStr)
+ {
+ // "index" is in `char`s, not graphemes... but I think that's fine, since the mnemonic feature probably only works with Latin/ext anyway --yoshi
+ if (!int.TryParse(iAmpStr, out var iAmp)) return Fail(ERR_FMT_STR_MNEMONIC_INDEX_ISNT);
+ if (iAmp < 0 || strWithoutMn.Length <= iAmp) return Fail(ERR_FMT_STR_MNEMONIC_INDEX_OOR, strWithoutMn.Length);
+ if (GetAttr(ATTR_NAME_CHAR) is string mnChar1)
+ {
+ if (mnChar1.Length is not 1) return Fail(ERR_FMT_STR_MNEMONIC_CHAR_ISNT);
+ var mnChar2 = mnChar1[0];
+ if (strWithoutMn[iAmp] != mnChar2) return Fail(ERR_FMT_STR_MNEMONIC_INDEX_MISMATCH, mnChar2);
+ }
+// if (strWithoutMn.Contains('&')) Fail(); //TODO do this?
+ return strWithoutMn.Insert(iAmp, "&");
+ }
+ if (GetAttr(ATTR_NAME_CHAR) is string mnChar)
+ {
+ if (mnChar.Length is not 1) return Fail(ERR_FMT_STR_MNEMONIC_CHAR_ISNT);
+// if (strWithoutMn.Contains('&')) Fail(); //TODO do this?
+ var strWithMn = strWithoutMn.InsertBefore(mnChar[0], "&", out var found);
+ return found ? strWithMn : Fail(ERR_FMT_STR_MNEMONIC_CHAR_ABSENT);
+ }
+ return strWithoutMn;
+ }
+ }
+}
diff --git a/src/BizHawk.Client.DiscoHawk/Program.cs b/src/BizHawk.Client.DiscoHawk/Program.cs
index f85d66f0a75..6824227a641 100644
--- a/src/BizHawk.Client.DiscoHawk/Program.cs
+++ b/src/BizHawk.Client.DiscoHawk/Program.cs
@@ -120,16 +120,18 @@ private static void Main(string[] args)
if (args.Length == 0)
{
- using var dialog = new MainDiscoForm();
+ var i18n = MultiMessageContext.ForCurrentCulture();
+ using MainDiscoForm dialog = new(i18n);
dialog.ShowDialog();
}
else
{
DiscoHawkLogic.RunWithArgs(
args,
- results =>
+ results => // invoked 0..1 times
{
- using var cr = new ComparisonResults { textBox1 = { Text = results } };
+ var i18n = MultiMessageContext.ForCurrentCulture();
+ using ComparisonResults cr = new(i18n) { textBox1 = { Text = results } };
cr.ShowDialog();
});
}
diff --git a/src/BizHawk.Client.DiscoHawk/locale/en.ftl b/src/BizHawk.Client.DiscoHawk/locale/en.ftl
new file mode 100644
index 00000000000..118e5f5a7bb
--- /dev/null
+++ b/src/BizHawk.Client.DiscoHawk/locale/en.ftl
@@ -0,0 +1,109 @@
+### DiscoHawk strings
+
+### SSoT for some terms
+
+-tm-bizhawk = BizHawk
+-tm-discohawk = DiscoHawk
+-tm-emuhawk = EmuHawk
+-tm-ffmpeg = FFmpeg
+-tm-mednafen = Mednafen
+
+
+
+## CLI COMPARE readout dialog
+
+discohawkcomparereadout-6110-tab-dest = DST Context
+discohawkcomparereadout-6110-tab-log = Log
+discohawkcomparereadout-6110-tab-src = SRC Context
+
+discohawkcomparereadout-2005-windowtitlestatic = ComparisonResults
+
+
+
+## main window
+
+maindiscoform-1872-area-hawkdisc = Drag here to HAWK your disc - dump it out as a clean CCD/CHD
+
+maindiscoform-6011-area-mp3extract = Drag a disc here to extract the audio tracks to MP3
+
+maindiscoform-5766-btn-about = About
+ .mnemonic = A
+
+maindiscoform-4723-btn-exit = Exit
+ .mnemonic = x
+
+maindiscoform-5267-compare-hawk = {-tm-bizhawk}
+
+maindiscoform-5267-compare-mednafen = {-tm-mednafen}
+
+maindiscoform-4639-group-compare-list = Compare Reading To:
+
+maindiscoform-7187-group-engine = Disc Reading Engine
+
+maindiscoform-5561-group-hawkoutput = Output Format
+
+maindiscoform-4559-radio-engine-hawk = {-tm-bizhawk}
+maindiscoform-4559-radio-engine-hawk-longdesc =
+ - Uses FFMPEG for audio decoding
+ - Loads ISO, CUE, CCD, CDI, CHD, MDS, and NRG
+
+maindiscoform-7205-radio-engine-mednafen = {-tm-mednafen}
+maindiscoform-7205-radio-engine-mednafen-longdesc =
+ - Doesn't support audio decoding yet
+ (even though {-tm-mednafen} proper can do it)
+ - Loads ISO, CUE, and CCD
+
+maindiscoform-7576-radio-hawkoutput-ccd = CCD
+
+maindiscoform-2884-radio-hawkoutput-chd = CHD
+
+maindiscoform-7426-pane-operations = - Operations -
+
+maindiscoform-3997-windowtitlestatic = {-tm-discohawk}
+
+
+
+## "Hawk disc" dialogs
+
+discodischawking-6945-errbox-hawk =
+ .windowtitle = Error loading disc
+
+discodischawking-3654-errbox-misc =
+ .windowtitle = Error loading disc
+
+
+
+## mp3 extract dialogs
+
+discomp3extract-7691-errbox-misc =
+ .windowtitle = Error loading disc
+
+discomp3extract-5715-errbox-noffmpeg =
+ This function requires {-tm-ffmpeg}, but it doesn't appear to have been downloaded.
+ {-tm-emuhawk} can automatically download it: you just need to set up A/V recording with the {-tm-ffmpeg} writer.
+ .windowtitle = {-tm-ffmpeg} missing
+
+discomp3extract-3418-prompt-overwrite =
+ Do you want to overwrite existing files? Choosing "No" will simply skip those. You could also "Cancel" the extraction entirely.
+
+ caused by file: {$filePath}
+ .windowtitle = File to extract already exists
+
+
+
+## About window
+
+discohawkabout-9804-btn-dismiss = OK
+
+discohawkabout-4584-lbl-explainer =
+ {-tm-discohawk} converts bolloxed-up crusty disc images to totally tidy CCD.
+
+ {-tm-discohawk} is part of the {-tm-bizhawk} project ( https://github.com/TASEmulators/BizHawk ).
+
+ {-tm-bizhawk} is a .net-based multi-system emulator brought to you by some of the rerecording emulator principals. We wrote our own cue parsing/generating code to be able to handle any kind of junk we threw at it. Instead of trapping it in the emulator, we liberated it in the form of this tool, to be useful in other environments.
+
+ To use, drag a disc (.cue, .iso, .ccd, .cdi, .mds, .nrg) into the top area. {-tm-discohawk} will dump a newly cleaned up CCD file set to the same directory as the original disc image, and call it _hawked.
+
+ This is beta software. You are invited to report problems to our bug tracker or IRC. Problems consist of: crusty disc images that crash {-tm-discohawk} or that cause {-tm-discohawk} to produce a _hawked.ccd which fails to serve your particular purposes (which we will need to be informed of, in case we are outputting wrongly.)
+
+discohawkabout-2822-windowtitlestatic = About {-tm-discohawk}