@@ -11,6 +11,8 @@ namespace BizHawk.Client.DiscoHawk
1111{
1212 public class MainDiscoForm : Form
1313 {
14+ private readonly MultiMessageContext _i18n ;
15+
1416 private readonly RadioButton ccdOutputButton ;
1517
1618 private readonly RadioButton chdOutputButton ;
@@ -26,16 +28,18 @@ public class MainDiscoForm : Form
2628 // An outputted list showing new file name
2729 // Progress bar should show file being converted
2830 // Add disc button, which puts it on the progress cue (converts it)
29- public MainDiscoForm ( )
31+ public MainDiscoForm ( MultiMessageContext i18n )
3032 {
33+ _i18n = i18n ;
34+
3135 SuspendLayout ( ) ;
3236
3337 Button ExitButton = new ( ) ;
3438 ExitButton . Location = new ( 434 , 414 ) ;
3539 ExitButton . Name = "ExitButton" ;
3640 ExitButton . Size = new ( 75 , 23 ) ;
3741 ExitButton . TabIndex = 0 ;
38- ExitButton . Text = "E&xit" ;
42+ ExitButton . Text = i18n [ "maindiscoform-4723-btn-exit-textstr" ] ;
3943 ExitButton . UseVisualStyleBackColor = true ;
4044 ExitButton . Click += ( _ , _ ) => Close ( ) ;
4145
@@ -56,7 +60,7 @@ public MainDiscoForm()
5660 label1 . Name = "label1" ;
5761 label1 . Size = new ( 166 , 47 ) ;
5862 label1 . TabIndex = 0 ;
59- label1 . Text = "Drag here to HAWK your disc - dump it out as a clean CCD/CHD" ;
63+ label1 . Text = i18n [ "maindiscoform-1872-area-hawkdisc-label" ] ;
6064
6165 lblMp3ExtractMagicArea = new ( ) ;
6266 lblMp3ExtractMagicArea . SuspendLayout ( ) ;
@@ -75,16 +79,16 @@ public MainDiscoForm()
7579 label2 . Name = "label2" ;
7680 label2 . Size = new ( 163 , 39 ) ;
7781 label2 . TabIndex = 0 ;
78- label2 . Text = "Drag a disc here to extract the audio tracks to MP3" ;
82+ label2 . Text = i18n [ "maindiscoform-6011-area-mp3extract-label" ] ;
7983
8084 Button btnAbout = new ( ) ;
8185 btnAbout . Location = new ( 353 , 414 ) ;
8286 btnAbout . Name = "btnAbout" ;
8387 btnAbout . Size = new ( 75 , 23 ) ;
8488 btnAbout . TabIndex = 3 ;
85- btnAbout . Text = "&About" ;
89+ btnAbout . Text = i18n [ "maindiscoform-5766-btn-about-textstr" ] ;
8690 btnAbout . UseVisualStyleBackColor = true ;
87- btnAbout . Click += ( _ , _ ) => new About ( ) . ShowDialog ( ) ;
91+ btnAbout . Click += ( _ , _ ) => new About ( _i18n ) . ShowDialog ( ) ;
8892
8993 RadioButton radioButton1 = new ( ) ;
9094 radioButton1 . AutoSize = true ;
@@ -94,7 +98,7 @@ public MainDiscoForm()
9498 radioButton1 . Size = new ( 67 , 17 ) ;
9599 radioButton1 . TabIndex = 4 ;
96100 radioButton1 . TabStop = true ;
97- radioButton1 . Text = "BizHawk" ;
101+ radioButton1 . Text = i18n [ "maindiscoform-4559-radio-engine-hawk-textstr" ] ;
98102 radioButton1 . UseVisualStyleBackColor = true ;
99103
100104 GroupBox groupBox1 = new ( ) ;
@@ -112,27 +116,27 @@ public MainDiscoForm()
112116 groupBox1 . Size = new ( 276 , 234 ) ;
113117 groupBox1 . TabIndex = 5 ;
114118 groupBox1 . TabStop = false ;
115- groupBox1 . Text = "Disc Reading Engine" ;
119+ groupBox1 . Text = i18n [ "maindiscoform-7187-group-engine-label" ] ;
116120
117121 label4 . Location = new ( 20 , 95 ) ;
118122 label4 . Name = "label4" ;
119123 label4 . Size = new ( 216 , 43 ) ;
120124 label4 . TabIndex = 8 ;
121- label4 . Text = "- Doesn \' t support audio decoding yet \r \n (even though Mednafen proper can do it) \r \n - Loads ISO, CUE, and CCD" ;
125+ label4 . Text = i18n [ "maindiscoform-7205-radio-engine-mednafen-longdesc-label" ] ;
122126
123127 label3 . Location = new ( 20 , 39 ) ;
124128 label3 . Name = "label3" ;
125129 label3 . Size = new ( 253 , 33 ) ;
126130 label3 . TabIndex = 7 ;
127- label3 . Text = "- Uses FFMPEG for audio decoding \r \n - Loads ISO, CUE, CCD, CDI, CHD, MDS, and NRG" ;
131+ label3 . Text = i18n [ "maindiscoform-4559-radio-engine-hawk-longdesc-label" ] ;
128132
129133 radioButton2 . AutoSize = true ;
130134 radioButton2 . Enabled = false ;
131135 radioButton2 . Location = new ( 6 , 75 ) ;
132136 radioButton2 . Name = "radioButton2" ;
133137 radioButton2 . Size = new ( 73 , 17 ) ;
134138 radioButton2 . TabIndex = 5 ;
135- radioButton2 . Text = "Mednafen" ;
139+ radioButton2 . Text = i18n [ "maindiscoform-7205-radio-engine-mednafen-textstr" ] ;
136140 radioButton2 . UseVisualStyleBackColor = true ;
137141
138142 GroupBox groupBox2 = new ( ) ;
@@ -147,7 +151,7 @@ public MainDiscoForm()
147151 groupBox2 . Size = new ( 271 , 69 ) ;
148152 groupBox2 . TabIndex = 6 ;
149153 groupBox2 . TabStop = false ;
150- groupBox2 . Text = "Output Format" ;
154+ groupBox2 . Text = i18n [ "maindiscoform-5561-group-hawkoutput-label" ] ;
151155
152156 ccdOutputButton . AutoSize = true ;
153157 ccdOutputButton . Checked = true ;
@@ -156,7 +160,7 @@ public MainDiscoForm()
156160 ccdOutputButton . Size = new ( 47 , 17 ) ;
157161 ccdOutputButton . TabIndex = 5 ;
158162 ccdOutputButton . TabStop = true ;
159- ccdOutputButton . Text = "CCD" ;
163+ ccdOutputButton . Text = i18n [ "maindiscoform-7576-radio-hawkoutput-ccd-textstr" ] ;
160164 ccdOutputButton . UseVisualStyleBackColor = true ;
161165
162166 chdOutputButton . AutoSize = true ;
@@ -166,7 +170,7 @@ public MainDiscoForm()
166170 chdOutputButton . Size = new ( 47 , 17 ) ;
167171 chdOutputButton . TabIndex = 6 ;
168172 chdOutputButton . TabStop = true ;
169- chdOutputButton . Text = "CHD" ;
173+ chdOutputButton . Text = i18n [ "maindiscoform-2884-radio-hawkoutput-chd-textstr" ] ;
170174 chdOutputButton . UseVisualStyleBackColor = true ;
171175
172176 Label label6 = new ( ) ;
@@ -176,15 +180,15 @@ public MainDiscoForm()
176180 label6 . Name = "label6" ;
177181 label6 . Size = new ( 111 , 13 ) ;
178182 label6 . TabIndex = 2 ;
179- label6 . Text = "Compare Reading To:" ;
183+ label6 . Text = i18n [ "maindiscoform-4639-group-compare-list-label" ] ;
180184
181185 Label label7 = new ( ) ;
182186 label7 . AutoSize = true ;
183187 label7 . Location = new ( 358 , 12 ) ;
184188 label7 . Name = "label7" ;
185189 label7 . Size = new ( 70 , 13 ) ;
186190 label7 . TabIndex = 10 ;
187- label7 . Text = "- Operations -" ;
191+ label7 . Text = i18n [ "maindiscoform-7426-pane-operations-label" ] ;
188192
189193 lvCompareTargets = new ( ) ;
190194 lvCompareTargets . Columns . Add ( new ColumnHeader ( ) ) ;
@@ -193,8 +197,8 @@ public MainDiscoForm()
193197 lvCompareTargets . GridLines = true ;
194198 lvCompareTargets . HeaderStyle = ColumnHeaderStyle . None ;
195199 lvCompareTargets . HideSelection = false ;
196- lvCompareTargets . Items . Add ( "BizHawk" ) ;
197- lvCompareTargets . Items . Add ( "Mednafen" ) ;
200+ lvCompareTargets . Items . Add ( i18n [ "maindiscoform-5267-compare-hawk-label" ] ) ;
201+ lvCompareTargets . Items . Add ( i18n [ "maindiscoform-5267-compare-mednafen-label" ] ) ;
198202 lvCompareTargets . Location = new ( 9 , 340 ) ;
199203 lvCompareTargets . Name = "lvCompareTargets" ;
200204 lvCompareTargets . Size = new ( 121 , 97 ) ;
@@ -221,7 +225,7 @@ public MainDiscoForm()
221225 MaximizeBox = false ;
222226 MinimizeBox = false ;
223227 Name = "MainDiscoForm" ;
224- Text = "DiscoHawk" ;
228+ Text = i18n [ "maindiscoform-3997-windowtitlestatic" ] ;
225229 Load += ( _ , _ ) => lvCompareTargets . Columns [ 0 ] . Width = lvCompareTargets . ClientSize . Width ;
226230 lblMagicDragArea . ResumeLayout ( performLayout : false ) ;
227231 lblMp3ExtractMagicArea . ResumeLayout ( performLayout : false ) ;
@@ -246,14 +250,14 @@ private void lblMagicDragArea_DragDrop(object sender, DragEventArgs e)
246250 {
247251 var success = DiscoHawkLogic . HawkAndWriteFile (
248252 inputPath : file ,
249- errorCallback : err => MessageBox . Show ( err , "Error loading disc" ) ,
253+ errorCallback : err => MessageBox . Show ( err , _i18n [ "discodischawking-6945-errbox-hawk-windowtitlestatic" ] ) ,
250254 hawkedFormat : outputFormat ) ;
251255 if ( ! success ) break ;
252256 }
253257 }
254258 catch ( Exception ex )
255259 {
256- MessageBox . Show ( ex . ToString ( ) , "Error loading disc" ) ;
260+ MessageBox . Show ( ex . ToString ( ) , _i18n [ "discodischawking-3654-errbox-misc-windowtitlestatic" ] ) ;
257261 throw ;
258262 }
259263 finally
@@ -323,9 +327,8 @@ private void LblMp3ExtractMagicArea_DragDrop(object sender, DragEventArgs e)
323327 {
324328#if true
325329 MessageBox . Show (
326- caption : "FFmpeg missing" ,
327- text : "This function requires FFmpeg, but it doesn't appear to have been downloaded.\n "
328- + "EmuHawk can automatically download it: you just need to set up A/V recording with the FFmpeg writer." ) ;
330+ caption : _i18n [ "discomp3extract-5715-errbox-noffmpeg-windowtitlestatic" ] ,
331+ text : _i18n [ "discomp3extract-5715-errbox-noffmpeg-label" ] ) ;
329332 return ;
330333#else
331334 using EmuHawk . FFmpegDownloaderForm dialog = new ( ) ; // builds fine when <Compile Include/>'d, but the .resx won't load even if it's also included
@@ -343,10 +346,10 @@ private void LblMp3ExtractMagicArea_DragDrop(object sender, DragEventArgs e)
343346 {
344347 using var disc = Disc . LoadAutomagic ( file ) ;
345348 var ( path , filename , _) = file . SplitPathToDirFileAndExt ( ) ;
346- static bool ? PromptForOverwrite ( string mp3Path )
349+ bool ? PromptForOverwrite ( string mp3Path )
347350 => MessageBox . Show (
348- $ "Do you want to overwrite existing files? Choosing \" No \" will simply skip those. You could also \" Cancel \" the extraction entirely. \n \n caused by file: { mp3Path } " ,
349- "File to extract already exists" ,
351+ string . Format ( _i18n [ "discomp3extract-3418-prompt- overwrite-fmtstr" ] , mp3Path ) ,
352+ _i18n [ "discomp3extract-3418-prompt-overwrite-windowtitlestatic" ] ,
350353 MessageBoxButtons . YesNoCancel ) switch
351354 {
352355 DialogResult . Yes => true ,
@@ -358,7 +361,7 @@ private void LblMp3ExtractMagicArea_DragDrop(object sender, DragEventArgs e)
358361 }
359362 catch ( Exception ex )
360363 {
361- MessageBox . Show ( ex . ToString ( ) , "Error loading disc" ) ;
364+ MessageBox . Show ( ex . ToString ( ) , _i18n [ "discomp3extract-7691-errbox-misc-windowtitlestatic" ] ) ;
362365 throw ;
363366 }
364367 finally
0 commit comments