@@ -11,6 +11,8 @@ namespace BizHawk.Client.DiscoHawk
11
11
{
12
12
public class MainDiscoForm : Form
13
13
{
14
+ private readonly MultiMessageContext _i18n ;
15
+
14
16
private readonly RadioButton ccdOutputButton ;
15
17
16
18
private readonly RadioButton chdOutputButton ;
@@ -26,16 +28,18 @@ public class MainDiscoForm : Form
26
28
// An outputted list showing new file name
27
29
// Progress bar should show file being converted
28
30
// Add disc button, which puts it on the progress cue (converts it)
29
- public MainDiscoForm ( )
31
+ public MainDiscoForm ( MultiMessageContext i18n )
30
32
{
33
+ _i18n = i18n ;
34
+
31
35
SuspendLayout ( ) ;
32
36
33
37
Button ExitButton = new ( ) ;
34
38
ExitButton . Location = new ( 434 , 414 ) ;
35
39
ExitButton . Name = "ExitButton" ;
36
40
ExitButton . Size = new ( 75 , 23 ) ;
37
41
ExitButton . TabIndex = 0 ;
38
- ExitButton . Text = "E&xit" ;
42
+ ExitButton . Text = i18n [ "maindiscoform-4723-btn-exit-textstr" ] ;
39
43
ExitButton . UseVisualStyleBackColor = true ;
40
44
ExitButton . Click += ( _ , _ ) => Close ( ) ;
41
45
@@ -56,7 +60,7 @@ public MainDiscoForm()
56
60
label1 . Name = "label1" ;
57
61
label1 . Size = new ( 166 , 47 ) ;
58
62
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" ] ;
60
64
61
65
lblMp3ExtractMagicArea = new ( ) ;
62
66
lblMp3ExtractMagicArea . SuspendLayout ( ) ;
@@ -75,16 +79,16 @@ public MainDiscoForm()
75
79
label2 . Name = "label2" ;
76
80
label2 . Size = new ( 163 , 39 ) ;
77
81
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" ] ;
79
83
80
84
Button btnAbout = new ( ) ;
81
85
btnAbout . Location = new ( 353 , 414 ) ;
82
86
btnAbout . Name = "btnAbout" ;
83
87
btnAbout . Size = new ( 75 , 23 ) ;
84
88
btnAbout . TabIndex = 3 ;
85
- btnAbout . Text = "&About" ;
89
+ btnAbout . Text = i18n [ "maindiscoform-5766-btn-about-textstr" ] ;
86
90
btnAbout . UseVisualStyleBackColor = true ;
87
- btnAbout . Click += ( _ , _ ) => new About ( ) . ShowDialog ( ) ;
91
+ btnAbout . Click += ( _ , _ ) => new About ( _i18n ) . ShowDialog ( ) ;
88
92
89
93
RadioButton radioButton1 = new ( ) ;
90
94
radioButton1 . AutoSize = true ;
@@ -94,7 +98,7 @@ public MainDiscoForm()
94
98
radioButton1 . Size = new ( 67 , 17 ) ;
95
99
radioButton1 . TabIndex = 4 ;
96
100
radioButton1 . TabStop = true ;
97
- radioButton1 . Text = "BizHawk" ;
101
+ radioButton1 . Text = i18n [ "maindiscoform-4559-radio-engine-hawk-textstr" ] ;
98
102
radioButton1 . UseVisualStyleBackColor = true ;
99
103
100
104
GroupBox groupBox1 = new ( ) ;
@@ -112,27 +116,27 @@ public MainDiscoForm()
112
116
groupBox1 . Size = new ( 276 , 234 ) ;
113
117
groupBox1 . TabIndex = 5 ;
114
118
groupBox1 . TabStop = false ;
115
- groupBox1 . Text = "Disc Reading Engine" ;
119
+ groupBox1 . Text = i18n [ "maindiscoform-7187-group-engine-label" ] ;
116
120
117
121
label4 . Location = new ( 20 , 95 ) ;
118
122
label4 . Name = "label4" ;
119
123
label4 . Size = new ( 216 , 43 ) ;
120
124
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" ] ;
122
126
123
127
label3 . Location = new ( 20 , 39 ) ;
124
128
label3 . Name = "label3" ;
125
129
label3 . Size = new ( 253 , 33 ) ;
126
130
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" ] ;
128
132
129
133
radioButton2 . AutoSize = true ;
130
134
radioButton2 . Enabled = false ;
131
135
radioButton2 . Location = new ( 6 , 75 ) ;
132
136
radioButton2 . Name = "radioButton2" ;
133
137
radioButton2 . Size = new ( 73 , 17 ) ;
134
138
radioButton2 . TabIndex = 5 ;
135
- radioButton2 . Text = "Mednafen" ;
139
+ radioButton2 . Text = i18n [ "maindiscoform-7205-radio-engine-mednafen-textstr" ] ;
136
140
radioButton2 . UseVisualStyleBackColor = true ;
137
141
138
142
GroupBox groupBox2 = new ( ) ;
@@ -147,7 +151,7 @@ public MainDiscoForm()
147
151
groupBox2 . Size = new ( 271 , 69 ) ;
148
152
groupBox2 . TabIndex = 6 ;
149
153
groupBox2 . TabStop = false ;
150
- groupBox2 . Text = "Output Format" ;
154
+ groupBox2 . Text = i18n [ "maindiscoform-5561-group-hawkoutput-label" ] ;
151
155
152
156
ccdOutputButton . AutoSize = true ;
153
157
ccdOutputButton . Checked = true ;
@@ -156,7 +160,7 @@ public MainDiscoForm()
156
160
ccdOutputButton . Size = new ( 47 , 17 ) ;
157
161
ccdOutputButton . TabIndex = 5 ;
158
162
ccdOutputButton . TabStop = true ;
159
- ccdOutputButton . Text = "CCD" ;
163
+ ccdOutputButton . Text = i18n [ "maindiscoform-7576-radio-hawkoutput-ccd-textstr" ] ;
160
164
ccdOutputButton . UseVisualStyleBackColor = true ;
161
165
162
166
chdOutputButton . AutoSize = true ;
@@ -166,7 +170,7 @@ public MainDiscoForm()
166
170
chdOutputButton . Size = new ( 47 , 17 ) ;
167
171
chdOutputButton . TabIndex = 6 ;
168
172
chdOutputButton . TabStop = true ;
169
- chdOutputButton . Text = "CHD" ;
173
+ chdOutputButton . Text = i18n [ "maindiscoform-2884-radio-hawkoutput-chd-textstr" ] ;
170
174
chdOutputButton . UseVisualStyleBackColor = true ;
171
175
172
176
Label label6 = new ( ) ;
@@ -176,15 +180,15 @@ public MainDiscoForm()
176
180
label6 . Name = "label6" ;
177
181
label6 . Size = new ( 111 , 13 ) ;
178
182
label6 . TabIndex = 2 ;
179
- label6 . Text = "Compare Reading To:" ;
183
+ label6 . Text = i18n [ "maindiscoform-4639-group-compare-list-label" ] ;
180
184
181
185
Label label7 = new ( ) ;
182
186
label7 . AutoSize = true ;
183
187
label7 . Location = new ( 358 , 12 ) ;
184
188
label7 . Name = "label7" ;
185
189
label7 . Size = new ( 70 , 13 ) ;
186
190
label7 . TabIndex = 10 ;
187
- label7 . Text = "- Operations -" ;
191
+ label7 . Text = i18n [ "maindiscoform-7426-pane-operations-label" ] ;
188
192
189
193
lvCompareTargets = new ( ) ;
190
194
lvCompareTargets . Columns . Add ( new ColumnHeader ( ) ) ;
@@ -193,8 +197,8 @@ public MainDiscoForm()
193
197
lvCompareTargets . GridLines = true ;
194
198
lvCompareTargets . HeaderStyle = ColumnHeaderStyle . None ;
195
199
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" ] ) ;
198
202
lvCompareTargets . Location = new ( 9 , 340 ) ;
199
203
lvCompareTargets . Name = "lvCompareTargets" ;
200
204
lvCompareTargets . Size = new ( 121 , 97 ) ;
@@ -221,7 +225,7 @@ public MainDiscoForm()
221
225
MaximizeBox = false ;
222
226
MinimizeBox = false ;
223
227
Name = "MainDiscoForm" ;
224
- Text = "DiscoHawk" ;
228
+ Text = i18n [ "maindiscoform-3997-windowtitlestatic" ] ;
225
229
Load += ( _ , _ ) => lvCompareTargets . Columns [ 0 ] . Width = lvCompareTargets . ClientSize . Width ;
226
230
lblMagicDragArea . ResumeLayout ( performLayout : false ) ;
227
231
lblMp3ExtractMagicArea . ResumeLayout ( performLayout : false ) ;
@@ -246,14 +250,14 @@ private void lblMagicDragArea_DragDrop(object sender, DragEventArgs e)
246
250
{
247
251
var success = DiscoHawkLogic . HawkAndWriteFile (
248
252
inputPath : file ,
249
- errorCallback : err => MessageBox . Show ( err , "Error loading disc" ) ,
253
+ errorCallback : err => MessageBox . Show ( err , _i18n [ "discodischawking-6945-errbox-hawk-windowtitlestatic" ] ) ,
250
254
hawkedFormat : outputFormat ) ;
251
255
if ( ! success ) break ;
252
256
}
253
257
}
254
258
catch ( Exception ex )
255
259
{
256
- MessageBox . Show ( ex . ToString ( ) , "Error loading disc" ) ;
260
+ MessageBox . Show ( ex . ToString ( ) , _i18n [ "discodischawking-3654-errbox-misc-windowtitlestatic" ] ) ;
257
261
throw ;
258
262
}
259
263
finally
@@ -323,9 +327,8 @@ private void LblMp3ExtractMagicArea_DragDrop(object sender, DragEventArgs e)
323
327
{
324
328
#if true
325
329
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" ] ) ;
329
332
return ;
330
333
#else
331
334
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)
343
346
{
344
347
using var disc = Disc . LoadAutomagic ( file ) ;
345
348
var ( path , filename , _) = file . SplitPathToDirFileAndExt ( ) ;
346
- static bool ? PromptForOverwrite ( string mp3Path )
349
+ bool ? PromptForOverwrite ( string mp3Path )
347
350
=> 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" ] ,
350
353
MessageBoxButtons . YesNoCancel ) switch
351
354
{
352
355
DialogResult . Yes => true ,
@@ -358,7 +361,7 @@ private void LblMp3ExtractMagicArea_DragDrop(object sender, DragEventArgs e)
358
361
}
359
362
catch ( Exception ex )
360
363
{
361
- MessageBox . Show ( ex . ToString ( ) , "Error loading disc" ) ;
364
+ MessageBox . Show ( ex . ToString ( ) , _i18n [ "discomp3extract-7691-errbox-misc-windowtitlestatic" ] ) ;
362
365
throw ;
363
366
}
364
367
finally
0 commit comments