3131using System . IO . Compression ;
3232using System . Drawing ;
3333using System . Threading . Tasks ;
34+ using GNU . Gettext . WinForms ;
3435
3536namespace ORTS
3637{
@@ -72,6 +73,8 @@ public ContentForm(UserSettings settings)
7273 this . MaximizeBox = false ; // disable maximize button
7374
7475 Catalog = new GettextResourceManager ( "Menu" ) ;
76+ Localizer . Localize ( this , Catalog ) ;
77+
7578 Settings = settings ;
7679
7780 //
@@ -281,7 +284,7 @@ private void writeAndStartInfoFile()
281284 if ( route . getDownloadType ( ) == ContentRouteSettings . DownloadType . github )
282285 {
283286 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 ) ) ;
285288 if ( route . InstallSize > 0 )
286289 {
287290 outputFile . WriteLine ( "- " + Catalog . GetStringFmt ( "Install size: {0} GB" ,
@@ -290,8 +293,8 @@ private void writeAndStartInfoFile()
290293 }
291294 if ( route . getDownloadType ( ) == ContentRouteSettings . DownloadType . zip )
292295 {
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 ) ) ;
295298 if ( route . InstallSize > 0 )
296299 {
297300 outputFile . WriteLine ( "- " + Catalog . GetStringFmt ( "Install size: {0} GB" ,
@@ -307,10 +310,10 @@ private void writeAndStartInfoFile()
307310 if ( route . Installed )
308311 {
309312 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 ) ) ;
314317 }
315318
316319 outputFile . WriteLine ( "<p>" + Catalog . GetString ( "Start options" ) + ":<br>" ) ;
@@ -353,7 +356,10 @@ private void writeAndStartInfoFile()
353356 }
354357 else
355358 {
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+ }
357363 }
358364 }
359365 try
0 commit comments