1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-21 18:53:16 +00:00

First pass at adding new internalization system.

This commit is contained in:
Ylian Saint-Hilaire
2021-06-01 15:25:40 -07:00
parent b418493e95
commit c97b719445
22 changed files with 1138 additions and 14 deletions

View File

@@ -12,6 +12,7 @@ namespace MeshCentralRouter
{ {
this.meshcentral = meshcentral; this.meshcentral = meshcentral;
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
} }
public string getName() { return nameTextBox.Text; } public string getName() { return nameTextBox.Text; }

View File

@@ -13,6 +13,7 @@ namespace MeshCentralRouter
{ {
this.meshcentral = meshcentral; this.meshcentral = meshcentral;
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
updateInfo(); updateInfo();
} }

View File

@@ -16,6 +16,7 @@ namespace MeshCentralRouter
public AppLaunchForm() public AppLaunchForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
UpdateInfo(); UpdateInfo();
} }

View File

@@ -15,6 +15,7 @@ namespace MeshCentralRouter
public DeviceSettingsForm() public DeviceSettingsForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
doubleClickComboBox.SelectedIndex = 0; doubleClickComboBox.SelectedIndex = 0;
} }

View File

@@ -1,11 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace MeshCentralRouter namespace MeshCentralRouter
@@ -15,6 +8,7 @@ namespace MeshCentralRouter
public FileDeletePromptForm(string message, bool rec) public FileDeletePromptForm(string message, bool rec)
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
mainLabel.Text = message; mainLabel.Text = message;
if (rec == false) if (rec == false)
{ {

View File

@@ -11,6 +11,7 @@ namespace MeshCentralRouter
{ {
this.fileViewer = fileViewer; this.fileViewer = fileViewer;
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
updateInfo(); updateInfo();
updateTimer.Enabled = true; updateTimer.Enabled = true;
} }

View File

@@ -76,6 +76,7 @@ namespace MeshCentralRouter
public FileViewer(MeshCentralServer server, NodeClass node) public FileViewer(MeshCentralServer server, NodeClass node)
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
if (node != null) { this.Text += " - " + node.name; } if (node != null) { this.Text += " - " + node.name; }
this.node = node; this.node = node;
this.server = server; this.server = server;

View File

@@ -21,6 +21,7 @@ namespace MeshCentralRouter
public FilenamePromptForm(string operation, string filename) public FilenamePromptForm(string operation, string filename)
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
mainGroupBox.Text = operation; mainGroupBox.Text = operation;
mainTextBox.Text = filename; mainTextBox.Text = filename;
okButton.Enabled = (filename.Length > 0); okButton.Enabled = (filename.Length > 0);

View File

@@ -11,6 +11,7 @@ namespace MeshCentralRouter
public InstallForm() public InstallForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
// Load customizations // Load customizations
FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location); FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location);

View File

@@ -29,6 +29,7 @@ namespace MeshCentralRouter
public KVMSettingsForm() public KVMSettingsForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
qualityComboBox.Items.Add(new DropListItem(90, "90%")); qualityComboBox.Items.Add(new DropListItem(90, "90%"));
qualityComboBox.Items.Add(new DropListItem(80, "80%")); qualityComboBox.Items.Add(new DropListItem(80, "80%"));
qualityComboBox.Items.Add(new DropListItem(70, "70%")); qualityComboBox.Items.Add(new DropListItem(70, "70%"));

View File

@@ -11,6 +11,7 @@ namespace MeshCentralRouter
{ {
this.viewer = viewer; this.viewer = viewer;
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
} }
private void refreshTimer_Tick(object sender, EventArgs e) private void refreshTimer_Tick(object sender, EventArgs e)

View File

@@ -46,6 +46,7 @@ namespace MeshCentralRouter
public KVMViewer(MeshCentralServer server, NodeClass node) public KVMViewer(MeshCentralServer server, NodeClass node)
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
this.Text += " - " + node.name; this.Text += " - " + node.name;
this.node = node; this.node = node;
this.server = server; this.server = server;

View File

@@ -153,6 +153,7 @@ namespace MeshCentralRouter
this.args = args; this.args = args;
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
mainPanel.Controls.Add(panel1); mainPanel.Controls.Add(panel1);
mainPanel.Controls.Add(panel2); mainPanel.Controls.Add(panel2);
mainPanel.Controls.Add(panel3); mainPanel.Controls.Add(panel3);

View File

@@ -11,6 +11,7 @@ namespace MeshCentralRouter
public MappingHelpForm() public MappingHelpForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
// Load customizations // Load customizations
FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location); FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location);

View File

@@ -11,6 +11,7 @@ namespace MeshCentralRouter
{ {
this.mapControl = mapControl; this.mapControl = mapControl;
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
} }
private void refreshTimer_Tick(object sender, EventArgs e) private void refreshTimer_Tick(object sender, EventArgs e)

View File

@@ -241,6 +241,7 @@
<Compile Include="SettingsForm.Designer.cs"> <Compile Include="SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon> <DependentUpon>SettingsForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Translate.cs" />
<Compile Include="UpdateForm.cs"> <Compile Include="UpdateForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>

View File

@@ -15,6 +15,7 @@ namespace MeshCentralRouter
public SettingsForm() public SettingsForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
} }
public bool BindAllInterfaces public bool BindAllInterfaces

View File

@@ -8,6 +8,7 @@ namespace MeshCentralRouter
public SshUsernameForm() public SshUsernameForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
} }
public string Username public string Username

1117
Translate.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -22,6 +22,7 @@ namespace MeshCentralRouter
public UpdateForm(string url, string hash, int size, string[] args, string serverhash) public UpdateForm(string url, string hash, int size, string[] args, string serverhash)
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
this.url = url; this.url = url;
this.hash = hash; this.hash = hash;
this.size = size; this.size = size;

View File

@@ -8,6 +8,7 @@ namespace MeshCentralRouter
public altPortForm() public altPortForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
} }
public int altPort public int altPort

View File

@@ -1,11 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace MeshCentralRouter namespace MeshCentralRouter
@@ -15,6 +8,7 @@ namespace MeshCentralRouter
public rdpPortForm() public rdpPortForm()
{ {
InitializeComponent(); InitializeComponent();
Translate.TranslateControl(this);
} }
public int originalRdpPort; public int originalRdpPort;