@@ -288,8 +288,8 @@ private void fileWatcher_Changed(object sender, FileSystemEventArgs e)
288288 bool ReloadFile = false ;
289289 if ( _NeedsSave )
290290 {
291- var result = MessageBox . Show ( string . Format ( Program . Translations . DFileChanged , _FullFilePath ) + Environment . NewLine + Program . Translations . FileTryReload ,
292- Program . Translations . FileChanged , MessageBoxButton . YesNo , MessageBoxImage . Asterisk ) ;
291+ var result = MessageBox . Show ( string . Format ( Program . Translations . GetLanguage ( " DFileChanged" ) , _FullFilePath ) + Environment . NewLine + Program . Translations . GetLanguage ( " FileTryReload" ) ,
292+ Program . Translations . GetLanguage ( " FileChanged" ) , MessageBoxButton . YesNo , MessageBoxImage . Asterisk ) ;
293293 ReloadFile = ( result == MessageBoxResult . Yes ) ;
294294 }
295295 else //when the user didnt changed anything, we just reload the file since we are intelligent...
@@ -388,7 +388,7 @@ public void Save(bool Force = false)
388388 }
389389 catch ( Exception e )
390390 {
391- MessageBox . Show ( Program . MainWindow , Program . Translations . DSaveError + Environment . NewLine + "(" + e . Message + ")" , Program . Translations . SaveError ,
391+ MessageBox . Show ( Program . MainWindow , Program . Translations . GetLanguage ( " DSaveError" ) + Environment . NewLine + "(" + e . Message + ")" , Program . Translations . GetLanguage ( " SaveError" ) ,
392392 MessageBoxButton . OK , MessageBoxImage . Error ) ;
393393 return ;
394394 }
@@ -405,7 +405,7 @@ public void UpdateFontSize(double size, bool UpdateLineHeight = true)
405405 if ( size > 2 && size < 31 )
406406 {
407407 editor . FontSize = size ;
408- StatusLine_FontSize . Text = size . ToString ( "n0" ) + $ " { Program . Translations . PtAbb } ";
408+ StatusLine_FontSize . Text = size . ToString ( "n0" ) + $ " { Program . Translations . GetLanguage ( " PtAbb" ) } ";
409409 }
410410 if ( UpdateLineHeight )
411411 {
@@ -492,7 +492,7 @@ public void MoveLine(bool down)
492492 }
493493 }
494494
495- public void Close ( bool ForcedToSave = false , bool CheckSavings = true )
495+ public async void Close ( bool ForcedToSave = false , bool CheckSavings = true )
496496 {
497497 regularyTimer . Stop ( ) ;
498498 regularyTimer . Close ( ) ;
@@ -512,9 +512,10 @@ public void Close(bool ForcedToSave = false, bool CheckSavings = true)
512512 }
513513 else
514514 {
515- var Result = Program . MainWindow . ShowMessageAsync ( $ "{ Program . Translations . SavingFile } '" + Parent . Title . Trim ( new char [ ] { '*' } ) + "'" , "" , MessageDialogStyle . AffirmativeAndNegative , Program . MainWindow . MetroDialogOptions ) ;
516- Result . Wait ( ) ;
517- if ( Result . Result == MessageDialogResult . Affirmative )
515+ string title = $ "{ Program . Translations . GetLanguage ( "SavingFile" ) } '" + Parent . Title . Trim ( new char [ ] { '*' } ) + "'" ;
516+ string msg = "" ;
517+ MessageDialogResult Result = await Program . MainWindow . ShowMessageAsync ( title , msg , MessageDialogStyle . AffirmativeAndNegative , Program . MainWindow . MetroDialogOptions ) ;
518+ if ( Result == MessageDialogResult . Affirmative )
518519 {
519520 Save ( ) ;
520521 }
@@ -541,8 +542,8 @@ private void editor_TextChanged(object sender, EventArgs e)
541542
542543 private void Caret_PositionChanged ( object sender , EventArgs e )
543544 {
544- StatusLine_Coloumn . Text = $ "{ Program . Translations . ColAbb } { editor . TextArea . Caret . Column } ";
545- StatusLine_Line . Text = $ "{ Program . Translations . LnAbb } { editor . TextArea . Caret . Line } ";
545+ StatusLine_Coloumn . Text = $ "{ Program . Translations . GetLanguage ( " ColAbb" ) } { editor . TextArea . Caret . Column } ";
546+ StatusLine_Line . Text = $ "{ Program . Translations . GetLanguage ( " LnAbb" ) } { editor . TextArea . Caret . Line } ";
546547 EvaluateIntelliSense ( ) ;
547548 var result = bracketSearcher . SearchBracket ( editor . Document , editor . CaretOffset ) ;
548549 bracketHighlightRenderer . SetHighlight ( result ) ;
@@ -623,7 +624,7 @@ private void TextArea_TextEntered(object sender, TextCompositionEventArgs e)
623624
624625 private void TextArea_SelectionChanged ( object sender , EventArgs e )
625626 {
626- StatusLine_SelectionLength . Text = $ "{ Program . Translations . LenAbb } { editor . SelectionLength } ";
627+ StatusLine_SelectionLength . Text = $ "{ Program . Translations . GetLanguage ( " LenAbb" ) } { editor . SelectionLength } ";
627628 }
628629
629630 private void PrevMouseWheel ( object sender , MouseWheelEventArgs e )
@@ -726,18 +727,23 @@ public void Language_Translate(bool Initial = false)
726727 {
727728 return ;
728729 }
729- MenuC_Undo . Header = Program . Translations . Undo ;
730- MenuC_Redo . Header = Program . Translations . Redo ;
731- MenuC_Cut . Header = Program . Translations . Cut ;
732- MenuC_Copy . Header = Program . Translations . Copy ;
733- MenuC_Paste . Header = Program . Translations . Paste ;
734- MenuC_SelectAll . Header = Program . Translations . SelectAll ;
735- CompileBox . Content = Program . Translations . Compile ;
730+ MenuC_Undo . Header = Program . Translations . GetLanguage ( "Undo" ) ;
731+
732+ MenuC_Redo . Header = Program . Translations . GetLanguage ( "Redo" ) ;
733+
734+ MenuC_Cut . Header = Program . Translations . GetLanguage ( "Cut" ) ;
735+
736+ MenuC_Copy . Header = Program . Translations . GetLanguage ( "Copy" ) ;
737+
738+ MenuC_Paste . Header = Program . Translations . GetLanguage ( "Paste" ) ;
739+
740+ MenuC_SelectAll . Header = Program . Translations . GetLanguage ( "SelectAll" ) ;
741+ CompileBox . Content = Program . Translations . GetLanguage ( "Compile" ) ;
736742 if ( ! Initial )
737743 {
738- StatusLine_Coloumn . Text = $ "{ Program . Translations . ColAbb } { editor . TextArea . Caret . Column } ";
739- StatusLine_Line . Text = $ "{ Program . Translations . LnAbb } { editor . TextArea . Caret . Line } ";
740- StatusLine_FontSize . Text = editor . FontSize . ToString ( "n0" ) + $ " { Program . Translations . PtAbb } ";
744+ StatusLine_Coloumn . Text = $ "{ Program . Translations . GetLanguage ( " ColAbb" ) } { editor . TextArea . Caret . Column } ";
745+ StatusLine_Line . Text = $ "{ Program . Translations . GetLanguage ( " LnAbb" ) } { editor . TextArea . Caret . Line } ";
746+ StatusLine_FontSize . Text = editor . FontSize . ToString ( "n0" ) + $ " { Program . Translations . GetLanguage ( " PtAbb" ) } ";
741747 }
742748 }
743749 }
0 commit comments