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

Fixed multi-display switch when non-english language.

This commit is contained in:
Ylian Saint-Hilaire
2021-06-25 14:02:37 -07:00
parent 5041fafd55
commit edd7b9d080
3 changed files with 60 additions and 51 deletions

View File

@@ -2847,6 +2847,17 @@ namespace MeshCentralRouter
return english;
}
static public string T(string english, string lang)
{
if (lang == "en") return english;
if (translationTable.ContainsKey(english))
{
Dictionary<string, string> translations = translationTable[english];
if (translations.ContainsKey(lang)) return translations[lang];
}
return english;
}
static public void TranslateControl(Control control)
{
control.Text = T(control.Text);