31
31
using System . IO . Compression ;
32
32
using System . Drawing ;
33
33
using System . Threading . Tasks ;
34
+ using GNU . Gettext . WinForms ;
34
35
35
36
namespace ORTS
36
37
{
@@ -72,6 +73,8 @@ public ContentForm(UserSettings settings)
72
73
this . MaximizeBox = false ; // disable maximize button
73
74
74
75
Catalog = new GettextResourceManager ( "Menu" ) ;
76
+ Localizer . Localize ( this , Catalog ) ;
77
+
75
78
Settings = settings ;
76
79
77
80
//
@@ -281,7 +284,7 @@ private void writeAndStartInfoFile()
281
284
if ( route . getDownloadType ( ) == ContentRouteSettings . DownloadType . github )
282
285
{
283
286
outputFile . WriteLine ( "<p>" + Catalog . GetString ( "Downloadable: GitHub format" ) + "<br>" ) ;
284
- outputFile . WriteLine ( string . Format ( "- " + Catalog . GetString ( "From:" ) + "{0}<br>" , route . Url ) ) ;
287
+ outputFile . WriteLine ( Catalog . GetStringFmt ( "- " + Catalog . GetString ( "From:" ) + "{0}<br>" , route . Url ) ) ;
285
288
if ( route . InstallSize > 0 )
286
289
{
287
290
outputFile . WriteLine ( "- " + Catalog . GetStringFmt ( "Install size: {0} GB" ,
@@ -290,8 +293,8 @@ private void writeAndStartInfoFile()
290
293
}
291
294
if ( route . getDownloadType ( ) == ContentRouteSettings . DownloadType . zip )
292
295
{
293
- outputFile . WriteLine ( string . Format ( "<p>Downloadable: zip format<br>" ) ) ;
294
- outputFile . WriteLine ( string . Format ( "- From: {0}<br>" , route . Url ) ) ;
296
+ outputFile . WriteLine ( Catalog . GetString ( "<p>Downloadable: zip format<br>" ) ) ; // qqq
297
+ outputFile . WriteLine ( Catalog . GetStringFmt ( "- From: {0}<br>" , route . Url ) ) ;
295
298
if ( route . InstallSize > 0 )
296
299
{
297
300
outputFile . WriteLine ( "- " + Catalog . GetStringFmt ( "Install size: {0} GB" ,
@@ -307,10 +310,10 @@ private void writeAndStartInfoFile()
307
310
if ( route . Installed )
308
311
{
309
312
outputFile . WriteLine ( "<p>" + Catalog . GetString ( "Installed" ) + ":<br>" ) ;
310
- outputFile . WriteLine ( string . Format ( "- " + Catalog . GetString ( "At" ) + ": {0}<br>" , route . DateInstalled . ToString ( CultureInfo . CurrentCulture . DateTimeFormat ) ) ) ;
311
- outputFile . WriteLine ( string . Format ( "- " + Catalog . GetString ( "In" ) + ": \" {0}\" <br>" , route . DirectoryInstalledIn ) ) ;
312
- outputFile . WriteLine ( string . Format ( "- " + Catalog . GetString ( "Content name" ) + ": \" {0}\" <br>" , route . ContentName ) ) ;
313
- outputFile . WriteLine ( string . Format ( "- " + Catalog . GetString ( "Content Directory" ) + ": \" {0}\" <br></p>" , route . ContentDirectory ) ) ;
313
+ outputFile . WriteLine ( Catalog . GetStringFmt ( "- " + Catalog . GetString ( "At" ) + ": {0}<br>" , route . DateInstalled . ToString ( CultureInfo . CurrentCulture . DateTimeFormat ) ) ) ;
314
+ outputFile . WriteLine ( Catalog . GetStringFmt ( "- " + Catalog . GetString ( "In" ) + ": \" {0}\" <br>" , route . DirectoryInstalledIn ) ) ;
315
+ outputFile . WriteLine ( Catalog . GetStringFmt ( "- " + Catalog . GetString ( "Content name" ) + ": \" {0}\" <br>" , route . ContentName ) ) ;
316
+ outputFile . WriteLine ( Catalog . GetStringFmt ( "- " + Catalog . GetString ( "Content Directory" ) + ": \" {0}\" <br></p>" , route . ContentDirectory ) ) ;
314
317
}
315
318
316
319
outputFile . WriteLine ( "<p>" + Catalog . GetString ( "Start options" ) + ":<br>" ) ;
@@ -353,7 +356,10 @@ private void writeAndStartInfoFile()
353
356
}
354
357
else
355
358
{
356
- outputFile . WriteLine ( "<p>" + Catalog . GetStringFmt ( "Directory {0} does not exist" , route . DirectoryInstalledIn ) + "</b><br></p>" ) ;
359
+ if ( ! string . IsNullOrEmpty ( route . DirectoryInstalledIn ) )
360
+ {
361
+ outputFile . WriteLine ( "<p>" + Catalog . GetStringFmt ( "Directory {0} does not exist" , route . DirectoryInstalledIn ) + "</b><br></p>" ) ;
362
+ }
357
363
}
358
364
}
359
365
try
0 commit comments