2222using System . Linq ;
2323using System . Text . RegularExpressions ;
2424using System . Windows . Forms ;
25+ using GNU . Gettext ;
26+ using GNU . Gettext . WinForms ;
2527using Microsoft . Xna . Framework ;
2628using Orts . Formats . Msts ;
2729using Orts . MultiPlayer ;
@@ -45,6 +47,7 @@ public partial class MapViewer : Form
4547 /// Reference to the main simulator object.
4648 /// </summary>
4749 public readonly Simulator simulator ;
50+ private GettextResourceManager catalog = new GettextResourceManager ( "RunActivity" ) ;
4851 private readonly MapDataProvider MapDataProvider ;
4952 private readonly MapThemeProvider MapThemeProvider ;
5053 private string ThemeName = "light" ;
@@ -125,6 +128,8 @@ public MapViewer(Simulator simulator, Viewer viewer)
125128 {
126129 InitializeComponent ( ) ;
127130
131+ Localizer . Localize ( this , catalog ) ;
132+
128133 if ( simulator == null )
129134 throw new ArgumentNullException ( "simulator" , "Simulator object cannot be null." ) ;
130135
@@ -169,14 +174,6 @@ void InitializeForm()
169174 #region initData
170175 private void InitializeData ( )
171176 {
172- /*if (!loaded)
173- {
174- // do this only once
175- loaded = true;
176- //trackSections.DataSource = new List<InterlockingTrack>(simulator.InterlockingSystem.Tracks.Values).ToArray();
177- Localizer.Localize(this, Viewer.Catalog);
178- }*/
179-
180177 switchItemsDrawn = new List < SwitchWidget > ( ) ;
181178 signalItemsDrawn = new List < SignalWidget > ( ) ;
182179 switches = new List < SwitchWidget > ( ) ;
0 commit comments