Skip to content

Commit 5c0b889

Browse files
committed
Foundation for translations
1 parent 699d060 commit 5c0b889

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Source/RunActivity/Viewer3D/Map/MapForm.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
using System.Linq;
2323
using System.Text.RegularExpressions;
2424
using System.Windows.Forms;
25+
using GNU.Gettext;
26+
using GNU.Gettext.WinForms;
2527
using Microsoft.Xna.Framework;
2628
using Orts.Formats.Msts;
2729
using 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

Comments
 (0)