diff --git a/AddPortMapForm.cs b/AddPortMapForm.cs index acf90d5..ad5168d 100644 --- a/AddPortMapForm.cs +++ b/AddPortMapForm.cs @@ -12,6 +12,7 @@ namespace MeshCentralRouter { this.meshcentral = meshcentral; InitializeComponent(); + Translate.TranslateControl(this); } public string getName() { return nameTextBox.Text; } diff --git a/AddRelayMapForm.cs b/AddRelayMapForm.cs index 9f2797c..054ba85 100644 --- a/AddRelayMapForm.cs +++ b/AddRelayMapForm.cs @@ -13,6 +13,7 @@ namespace MeshCentralRouter { this.meshcentral = meshcentral; InitializeComponent(); + Translate.TranslateControl(this); updateInfo(); } diff --git a/AppLaunchForm.cs b/AppLaunchForm.cs index 48b60d1..a4d8aca 100644 --- a/AppLaunchForm.cs +++ b/AppLaunchForm.cs @@ -16,6 +16,7 @@ namespace MeshCentralRouter public AppLaunchForm() { InitializeComponent(); + Translate.TranslateControl(this); UpdateInfo(); } diff --git a/DeviceSettingsForm.cs b/DeviceSettingsForm.cs index 6761b73..3a8b224 100644 --- a/DeviceSettingsForm.cs +++ b/DeviceSettingsForm.cs @@ -15,6 +15,7 @@ namespace MeshCentralRouter public DeviceSettingsForm() { InitializeComponent(); + Translate.TranslateControl(this); doubleClickComboBox.SelectedIndex = 0; } diff --git a/FileDeletePromptForm.cs b/FileDeletePromptForm.cs index 41633c2..dceeb1d 100644 --- a/FileDeletePromptForm.cs +++ b/FileDeletePromptForm.cs @@ -1,11 +1,4 @@ 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; namespace MeshCentralRouter @@ -15,6 +8,7 @@ namespace MeshCentralRouter public FileDeletePromptForm(string message, bool rec) { InitializeComponent(); + Translate.TranslateControl(this); mainLabel.Text = message; if (rec == false) { diff --git a/FileTransferStatusForm.cs b/FileTransferStatusForm.cs index 9c3f4d8..34d3e25 100644 --- a/FileTransferStatusForm.cs +++ b/FileTransferStatusForm.cs @@ -11,6 +11,7 @@ namespace MeshCentralRouter { this.fileViewer = fileViewer; InitializeComponent(); + Translate.TranslateControl(this); updateInfo(); updateTimer.Enabled = true; } diff --git a/FileViewer.cs b/FileViewer.cs index 89e5634..29de5be 100644 --- a/FileViewer.cs +++ b/FileViewer.cs @@ -76,6 +76,7 @@ namespace MeshCentralRouter public FileViewer(MeshCentralServer server, NodeClass node) { InitializeComponent(); + Translate.TranslateControl(this); if (node != null) { this.Text += " - " + node.name; } this.node = node; this.server = server; diff --git a/FilenamePromptForm.cs b/FilenamePromptForm.cs index 52a1b29..83a27a8 100644 --- a/FilenamePromptForm.cs +++ b/FilenamePromptForm.cs @@ -21,6 +21,7 @@ namespace MeshCentralRouter public FilenamePromptForm(string operation, string filename) { InitializeComponent(); + Translate.TranslateControl(this); mainGroupBox.Text = operation; mainTextBox.Text = filename; okButton.Enabled = (filename.Length > 0); diff --git a/InstallForm.cs b/InstallForm.cs index b94f28b..b9c96e4 100644 --- a/InstallForm.cs +++ b/InstallForm.cs @@ -11,6 +11,7 @@ namespace MeshCentralRouter public InstallForm() { InitializeComponent(); + Translate.TranslateControl(this); // Load customizations FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location); diff --git a/KVMSettingsForm.cs b/KVMSettingsForm.cs index 3f183af..39c048b 100644 --- a/KVMSettingsForm.cs +++ b/KVMSettingsForm.cs @@ -29,6 +29,7 @@ namespace MeshCentralRouter public KVMSettingsForm() { InitializeComponent(); + Translate.TranslateControl(this); qualityComboBox.Items.Add(new DropListItem(90, "90%")); qualityComboBox.Items.Add(new DropListItem(80, "80%")); qualityComboBox.Items.Add(new DropListItem(70, "70%")); diff --git a/KVMStats.cs b/KVMStats.cs index 8eac32b..bce0986 100644 --- a/KVMStats.cs +++ b/KVMStats.cs @@ -11,6 +11,7 @@ namespace MeshCentralRouter { this.viewer = viewer; InitializeComponent(); + Translate.TranslateControl(this); } private void refreshTimer_Tick(object sender, EventArgs e) diff --git a/KVMViewer.cs b/KVMViewer.cs index cbb6d42..8dc2576 100644 --- a/KVMViewer.cs +++ b/KVMViewer.cs @@ -46,6 +46,7 @@ namespace MeshCentralRouter public KVMViewer(MeshCentralServer server, NodeClass node) { InitializeComponent(); + Translate.TranslateControl(this); this.Text += " - " + node.name; this.node = node; this.server = server; diff --git a/MainForm.cs b/MainForm.cs index fab2ff0..13d618e 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -153,6 +153,7 @@ namespace MeshCentralRouter this.args = args; InitializeComponent(); + Translate.TranslateControl(this); mainPanel.Controls.Add(panel1); mainPanel.Controls.Add(panel2); mainPanel.Controls.Add(panel3); diff --git a/MappingHelpForm.cs b/MappingHelpForm.cs index 739e37d..f22011e 100644 --- a/MappingHelpForm.cs +++ b/MappingHelpForm.cs @@ -11,6 +11,7 @@ namespace MeshCentralRouter public MappingHelpForm() { InitializeComponent(); + Translate.TranslateControl(this); // Load customizations FileInfo selfExe = new FileInfo(Assembly.GetExecutingAssembly().Location); diff --git a/MappingStats.cs b/MappingStats.cs index e0bf9bb..b28cbea 100644 --- a/MappingStats.cs +++ b/MappingStats.cs @@ -11,6 +11,7 @@ namespace MeshCentralRouter { this.mapControl = mapControl; InitializeComponent(); + Translate.TranslateControl(this); } private void refreshTimer_Tick(object sender, EventArgs e) diff --git a/MeshCentralRouter.csproj b/MeshCentralRouter.csproj index e24969f..f69efd4 100644 --- a/MeshCentralRouter.csproj +++ b/MeshCentralRouter.csproj @@ -241,6 +241,7 @@ SettingsForm.cs + Form diff --git a/SettingsForm.cs b/SettingsForm.cs index 15a2179..ab389b8 100644 --- a/SettingsForm.cs +++ b/SettingsForm.cs @@ -15,6 +15,7 @@ namespace MeshCentralRouter public SettingsForm() { InitializeComponent(); + Translate.TranslateControl(this); } public bool BindAllInterfaces diff --git a/SshUsernameForm.cs b/SshUsernameForm.cs index ae281aa..faab8a3 100644 --- a/SshUsernameForm.cs +++ b/SshUsernameForm.cs @@ -8,6 +8,7 @@ namespace MeshCentralRouter public SshUsernameForm() { InitializeComponent(); + Translate.TranslateControl(this); } public string Username diff --git a/Translate.cs b/Translate.cs new file mode 100644 index 0000000..8be8958 --- /dev/null +++ b/Translate.cs @@ -0,0 +1,1117 @@ +/* +Copyright 2009-2021 Intel Corporation + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +using System.Collections.Generic; +using System.Threading; +using System.Windows.Forms; + +namespace MeshCentralRouter +{ + public class Translate + { + // *** TRANSLATION TABLE START *** + static private Dictionary> translationTable = new Dictionary>() { + { + "Count", + new Dictionary() { + {"ru","Считать"}, + {"fi","Считать"}, + {"fr","Compter"}, + {"es","Contar"} + } + }, + { + "Intel® ME State...", + new Dictionary() { + {"ru","Состояние Intel® ME ..."}, + {"fi","Состояние Intel® ME ..."}, + {"fr","État Intel® ME..."}, + {"es","Estado Intel® ME ..."} + } + }, + { + "Remote Sessions...", + new Dictionary() { + {"ru","Удаленные сеансы ..."}, + {"fi","Удаленные сеансы ..."}, + {"fr","Séances à distance..."}, + {"es","Sesiones remotas ..."} + } + }, + { + "Remote Sessions", + new Dictionary() { + {"ru","Удаленные сеансы"}, + {"fi","Удаленные сеансы"}, + {"fr","Séances à distance"}, + {"es","Sesiones remotas"} + } + }, + { + "MeshCentral Assistant", + new Dictionary() { + {"fr","Assistant MeshCentral"}, + {"es","Asistente MeshCentral"}, + {"ru","MeshCentral Ассистент"} + } + }, + { + "&Start Agent", + new Dictionary() { + {"ru","& Запустить агент"}, + {"fi","& Запустить агент"}, + {"fr","&Démarrer l'agent"}, + {"es","& Iniciar agente"} + } + }, + { + "Agent Select", + new Dictionary() { + {"ru","Агент Выбрать"}, + {"fi","Агент Выбрать"}, + {"fr","Sélection d'agent"}, + {"es","Seleccionar agente"} + } + }, + { + "Agent is paused", + new Dictionary() { + {"ru","Агент приостановлен"}, + {"fi","Агент приостановлен"}, + {"fr","L'agent est en pause"}, + {"es","El agente está en pausa"} + } + }, + { + "Agent is continue pending", + new Dictionary() { + {"ru","Агент ожидает продолжения"}, + {"fi","Агент ожидает продолжения"}, + {"fr","L'agent est en attente de poursuite"}, + {"es","El agente sigue pendiente"} + } + }, + { + "Later", + new Dictionary() { + {"ru","Позже"}, + {"fi","Позже"}, + {"fr","Plus tard"}, + {"es","Mas tarde"} + } + }, + { + "Agent is stopped pending", + new Dictionary() { + {"ru","Агент остановлен в ожидании"}, + {"fi","Агент остановлен в ожидании"}, + {"fr","L'agent est arrêté en attente"}, + {"es","El agente está detenido pendiente"} + } + }, + { + "Agent is missing", + new Dictionary() { + {"ru","Агент отсутствует"}, + {"fi","Агент отсутствует"}, + {"fr","L'agent est manquant"}, + {"es","Falta el agente"} + } + }, + { + "Intel® Management Engine state for this computer.", + new Dictionary() { + {"ru","Состояние Intel® Management Engine для этого компьютера."}, + {"fi","Состояние Intel® Management Engine для этого компьютера."}, + {"fr","État du moteur de gestion Intel® pour cet ordinateur."}, + {"es","Estado del motor de administración Intel® para este equipo."} + } + }, + { + "Item", + new Dictionary() { + {"ru","Пункт"}, + {"fi","Пункт"}, + {"fr","Article"}, + {"es","Artículo"} + } + }, + { + "Loading...", + new Dictionary() { + {"de","Laden..."}, + {"hi","लोड हो रहा है..."}, + {"fr","Chargement..."}, + {"zh-cht","載入中..."}, + {"zh-chs","载入中..."}, + {"fi","Ladataan..."}, + {"tr","Yükleniyor..."}, + {"cs","Načítání…"}, + {"ja","読み込み中..."}, + {"es","Cargando..."}, + {"pt","Carregando..."}, + {"nl","Laden..."}, + {"ko","불러오는 중 ..."}, + {"ru","Загрузка..."} + } + }, + { + "&Update Software", + new Dictionary() { + {"ru","&Обновление программного обеспечения"}, + {"fi","&Обновление программного обеспечения"}, + {"fr","&Mettre à jour le logiciel"}, + {"es","&Actualiza el software"} + } + }, + { + "Agent is disconnected", + new Dictionary() { + {"ru","Агент отключен"}, + {"fi","Агент отключен"}, + {"fr","L'agent est déconnecté"}, + {"es","El agente está desconectado"} + } + }, + { + "Request Help", + new Dictionary() { + {"ru","Запросить помощь"}, + {"fi","Запросить помощь"}, + {"fr","Demander de l'aide"}, + {"es","Solicitar ayuda"} + } + }, + { + "Remote Sessions: {0}", + new Dictionary() { + {"ru","Удаленные сеансы: {0}"}, + {"fi","Удаленные сеансы: {0}"}, + {"fr","Sessions à distance : {0}"}, + {"es","Sesiones remotas: {0}"} + } + }, + { + "Assistant Update", + new Dictionary() { + {"ru","Ассистент Обновление"}, + {"fi","Ассистент Обновление"}, + {"fr","Mise à jour de l'assistant"}, + {"es","Asistente de actualización"} + } + }, + { + "User", + new Dictionary() { + {"de","Benutzer"}, + {"hi","उपयोगकर्ता"}, + {"fr","Utilisateur"}, + {"zh-cht","用戶"}, + {"zh-chs","用户"}, + {"fi","Käyttäjä"}, + {"tr","Kullanıcı"}, + {"cs","Uživatel"}, + {"ja","ユーザー"}, + {"es","Usuario"}, + {"pt","Do utilizador"}, + {"nl","Gebruiker"}, + {"ko","사용자"}, + {"ru","Пользователь"} + } + }, + { + "{0} remote sessions", + new Dictionary() { + {"ru","{0} удаленных сеансов"}, + {"fi","{0} удаленных сеансов"}, + {"fr","{0} sessions à distance"}, + {"es","{0} sesiones remotas"} + } + }, + { + "Notify", + new Dictionary() { + {"de","Benachrichtigen"}, + {"hi","सूचित करें"}, + {"fr","Notifier"}, + {"zh-cht","通知"}, + {"zh-chs","通知"}, + {"fi","Ilmoita"}, + {"tr","Bildir"}, + {"cs","Upozornit"}, + {"ja","通知する"}, + {"es","Notificar"}, + {"pt","Notificar"}, + {"nl","Melden"}, + {"ko","알림"}, + {"ru","Уведомить"} + } + }, + { + "Enter help request details", + new Dictionary() { + {"ru","Введите детали запроса на помощь"}, + {"fi","Введите детали запроса на помощь"}, + {"fr","Entrez les détails de la demande d'aide"}, + {"es","Ingrese los detalles de la solicitud de ayuda"} + } + }, + { + "{0} Assistant", + new Dictionary() { + {"ru","{0} Ассистент"}, + {"fi","{0} Ассистент"}, + {"fr","{0} Assistante"}, + {"es","{0} Asistente"} + } + }, + { + "&Open", + new Dictionary() { + {"ru","&Открыть"}, + {"fi","&Открыть"}, + {"fr","&Ouvert"}, + {"es","&Abierto"} + } + }, + { + "{0} remote sessions are active.", + new Dictionary() { + {"ru","Активных удаленных сеансов: {0}."}, + {"fi","Активных удаленных сеансов: {0}."}, + {"fr","{0} sessions à distance sont actives."}, + {"es","{0} sesiones remotas están activas."} + } + }, + { + "E&xit", + new Dictionary() { + {"ru","Выход"}, + {"fi","Выход"}, + {"fr","Sortir"}, + {"es","Salida"} + } + }, + { + "Time", + new Dictionary() { + {"de","Zeit"}, + {"hi","समय"}, + {"fr","Temps"}, + {"zh-cht","時間"}, + {"zh-chs","时间"}, + {"fi","Aika"}, + {"tr","Zaman"}, + {"cs","Čas"}, + {"ja","時間"}, + {"es","Tiempo"}, + {"pt","Tempo"}, + {"nl","Tijd"}, + {"ko","시간"}, + {"ru","Время"} + } + }, + { + "Events", + new Dictionary() { + {"de","Ereignisse"}, + {"hi","आयोजन"}, + {"fr","Événements"}, + {"zh-cht","事件"}, + {"zh-chs","事件"}, + {"fi","Tapahtumat"}, + {"tr","Etkinlikler"}, + {"cs","Události"}, + {"ja","イベント"}, + {"es","Eventos"}, + {"pt","Eventos"}, + {"nl","Gebeurtenissen"}, + {"ko","이벤트"}, + {"ru","События"} + } + }, + { + "Versions", + new Dictionary() { + {"ru","Версии "}, + {"fi","Версии"}, + {"es","Versiones"} + } + }, + { + "Agent is start pending", + new Dictionary() { + {"ru","Агент ожидает запуска"}, + {"fi","Агент ожидает запуска"}, + {"fr","L'agent est en attente de démarrage"}, + {"es","El agente está pendiente de inicio"} + } + }, + { + "Type", + new Dictionary() { + {"de","Typ"}, + {"hi","प्रकार"}, + {"zh-cht","類型"}, + {"zh-chs","类型"}, + {"fi","Tyyppi"}, + {"tr","tip"}, + {"cs","Typ"}, + {"ja","タイプ"}, + {"es","Tipo"}, + {"pt","Tipo"}, + {"ko","유형"}, + {"ru","Удаленный ввод"} + } + }, + { + "Disconnected", + new Dictionary() { + {"de","Getrennt"}, + {"hi","डिस्कनेक्ट किया गया"}, + {"fr","Débranché"}, + {"zh-cht","已斷線"}, + {"zh-chs","已断线"}, + {"fi","Yhteys katkaistu"}, + {"tr","Bağlantı kesildi"}, + {"cs","Odpojeno"}, + {"ja","切断されました"}, + {"es","Desconectado"}, + {"pt","Desconectado"}, + {"nl","Verbroken"}, + {"ko","연결 해제"}, + {"ru","Отключен"} + } + }, + { + "State", + new Dictionary() { + {"de","Zustand"}, + {"hi","राज्य"}, + {"fr","Etat"}, + {"zh-cht","狀態"}, + {"zh-chs","状况"}, + {"fi","Tila"}, + {"tr","Durum"}, + {"cs","Stav"}, + {"ja","状態"}, + {"es","Estado"}, + {"pt","Estado"}, + {"nl","Status"}, + {"ko","상태"}, + {"ru","Состояние"} + } + }, + { + "Connected to server", + new Dictionary() { + {"ru","Подключено к серверу"}, + {"fi","Подключено к серверу"}, + {"fr","Connecté au serveur"}, + {"es","Conectado al servidor"} + } + }, + { + "Value", + new Dictionary() { + {"ru","Значение"}, + {"fi","Значение"}, + {"fr","Valeur"}, + {"es","Valor"} + } + }, + { + "List of remote sessions active on this computer.", + new Dictionary() { + {"ru","Список удаленных сеансов, активных на этом компьютере."}, + {"fi","Список удаленных сеансов, активных на этом компьютере."}, + {"fr","Liste des sessions distantes actives sur cet ordinateur."}, + {"es","Lista de sesiones remotas activas en esta computadora."} + } + }, + { + "Help Requested", + new Dictionary() { + {"ru","Запрошена помощь"}, + {"fi","Запрошена помощь"}, + {"fr","Aide demandée"}, + {"es","Ayuda solicitada"} + } + }, + { + "Enabled", + new Dictionary() { + {"de","aktiviert"}, + {"hi","सक्रिय"}, + {"fr","Activer"}, + {"zh-cht","已啟用"}, + {"zh-chs","已启用"}, + {"fi","Käytössä"}, + {"tr","Etkin"}, + {"cs","Povoleno"}, + {"ja","有効"}, + {"es","Habilitado"}, + {"pt","ativado"}, + {"nl","Ingeschakeld"}, + {"ko","활성화 됨"}, + {"ru","Включено"} + } + }, + { + "Files", + new Dictionary() { + {"de","Dateien"}, + {"hi","फ़ाइलें"}, + {"fr","Dossiers"}, + {"zh-cht","檔案"}, + {"zh-chs","档案"}, + {"fi","Tiedostot"}, + {"tr","Dosyalar"}, + {"cs","Soubory"}, + {"ja","ファイル"}, + {"es","Archivos"}, + {"pt","Arquivos"}, + {"nl","Bestanden"}, + {"ko","파일"}, + {"ru","Файлы"} + } + }, + { + "Cancel", + new Dictionary() { + {"de","Abbrechen"}, + {"hi","रद्द करना"}, + {"fr","Annuler"}, + {"zh-cht","取消"}, + {"zh-chs","取消"}, + {"fi","Peruuta"}, + {"tr","İptal etmek"}, + {"cs","Storno"}, + {"ja","キャンセル"}, + {"es","Cancelar"}, + {"pt","Cancelar"}, + {"nl","Annuleren"}, + {"ko","취소"}, + {"ru","Отмена"} + } + }, + { + "Connected", + new Dictionary() { + {"de","Verbunden"}, + {"hi","जुड़े हुए"}, + {"fr","Connecté"}, + {"zh-cht","已連接"}, + {"zh-chs","已连接"}, + {"fi","Yhdistetty"}, + {"tr","Bağlandı"}, + {"cs","Připojeno"}, + {"ja","接続済み"}, + {"es","Conectado"}, + {"pt","Conectado"}, + {"nl","Verbonden"}, + {"ko","연결됨"}, + {"ru","Подключено"} + } + }, + { + "Show Sessions...", + new Dictionary() { + {"ru","Показать сеансы ..."}, + {"fi","Показать сеансы ..."}, + {"fr","Afficher les séances..."}, + {"es","Mostrar sesiones ..."} + } + }, + { + "PrivacyBarForm", + new Dictionary() { + {"ru","Конфиденциальность"}, + {"fi","Конфиденциальность"} + } + }, + { + "Agent is pause pending", + new Dictionary() { + {"ru","Агент ожидает приостановки"}, + {"fi","Агент ожидает приостановки"}, + {"fr","L'agent est en attente de pause"}, + {"es","El agente está en pausa pendiente"} + } + }, + { + "Agent not installed", + new Dictionary() { + {"ru","Агент не установлен"}, + {"fi","Агент не установлен"}, + {"fr","Agent non installé"}, + {"es","Agente no instalado"} + } + }, + { + "No remote sessions", + new Dictionary() { + {"ru","Нет удаленных сеансов"}, + {"fi","Нет удаленных сеансов"}, + {"fr","Pas de sessions à distance"}, + {"es","Sin sesiones remotas"} + } + }, + { + "No active remote sessions.", + new Dictionary() { + {"ru","Нет активных удаленных сеансов."}, + {"fi","Нет активных удаленных сеансов."}, + {"fr","Aucune session à distance active."}, + {"es","No hay sesiones remotas activas."} + } + }, + { + "Connecting", + new Dictionary() { + {"ru","Подключение"}, + {"fi","Подключение"}, + {"fr","De liaison"}, + {"es","Conectando"} + } + }, + { + "Allow", + new Dictionary() { + {"ru","Позволять"}, + {"fi","Позволять"}, + {"fr","Permettre"}, + {"es","Permitir"} + } + }, + { + "Show &Events...", + new Dictionary() { + {"ru","Показать и события ..."}, + {"fi","Показать и события ..."}, + {"fr","Afficher les &événements..."}, + {"es","Espectáculos y eventos ..."} + } + }, + { + "A new version of this software is available. Update now?", + new Dictionary() { + {"ru","Доступна новая версия этого программного обеспечения. Обновить сейчас?"}, + {"fi","Доступна новая версия этого программного обеспечения. Обновить сейчас?"}, + {"fr","Une nouvelle version de ce logiciel est disponible. Mettez à jour maintenant?"}, + {"es","Hay disponible una nueva versión de este software. ¿Actualizar ahora?"} + } + }, + { + "Event", + new Dictionary() { + {"ru","Мероприятие"}, + {"fi","Мероприятие"}, + {"fr","Événement"}, + {"es","Evento"} + } + }, + { + "Deny", + new Dictionary() { + {"ru","Отрицать"}, + {"fi","Отрицать"}, + {"fr","Refuser"}, + {"es","Negar"} + } + }, + { + "1 remote session", + new Dictionary() { + {"ru","1 удаленный сеанс"}, + {"fi","1 удаленный сеанс"}, + {"fr","1 séance à distance"}, + {"es","1 sesión remota"} + } + }, + { + "{0} - {1}", + new Dictionary() { + + } + }, + { + "Close", + new Dictionary() { + {"de","Schließen"}, + {"hi","बंद करे"}, + {"fr","Fermer"}, + {"zh-cht","關"}, + {"zh-chs","关"}, + {"fi","Sulje"}, + {"tr","Kapat"}, + {"cs","Zavřít"}, + {"ja","閉じる"}, + {"es","Cerrar"}, + {"pt","Fechar"}, + {"nl","Sluiten"}, + {"ko","닫기"}, + {"ru","Закрыть"} + } + }, + { + "Disabled", + new Dictionary() { + {"de","Deaktiviertes"}, + {"hi","विकलांग"}, + {"fr","Désactivé"}, + {"zh-cht","已禁用"}, + {"zh-chs","已禁用"}, + {"fi","Poistettu käytöstä"}, + {"tr","Devre dışı"}, + {"cs","Zakázáno"}, + {"ja","無効"}, + {"es","Deshabilitado"}, + {"pt","Desativado"}, + {"nl","Uitgeschakeld"}, + {"ko","비활성화"}, + {"ru","Отключено"} + } + }, + { + "OK", + new Dictionary() { + {"hi","ठीक"}, + {"fr","ОК"}, + {"tr","tamam"}, + {"pt","Ok"}, + {"ko","확인"}, + {"ru","ОК"} + } + }, + { + "Direct Connect", + new Dictionary() { + {"ru","Прямое соединение"}, + {"fi","Прямое соединение"}, + {"fr","Connection directe"}, + {"es","Conexión directa"} + } + }, + { + "Not Activated (In)", + new Dictionary() { + {"de","Nicht aktiviert (In)"}, + {"hi","सक्रिय नहीं (में)"}, + {"fr","Non activé (en)"}, + {"zh-cht","未啟動(輸入)"}, + {"zh-chs","未激活(输入)"}, + {"fi","Ei aktivoitu (sisään)"}, + {"tr","Etkinleştirilmedi (İçinde)"}, + {"cs","Neaktivováno (v)"}, + {"ja","アクティブ化されていない(イン)"}, + {"es","No Activada (entrada)"}, + {"pt","Não ativado (entrada)"}, + {"nl","Niet geactiveerd (In)"}, + {"ko","활성화되지 않음 (In)"}, + {"ru","Не активированно (In)"} + } + }, + { + "1 remote session is active.", + new Dictionary() { + {"ru","Активен 1 удаленный сеанс."}, + {"fi","Активен 1 удаленный сеанс."}, + {"fr","1 session à distance est active."}, + {"es","1 sesión remota está activa."} + } + }, + { + "(None)", + new Dictionary() { + {"ru","(Никто)"}, + {"fi","(Никто)"}, + {"fr","(Rien)"}, + {"es","(Ninguno)"} + } + }, + { + "Desktop", + new Dictionary() { + {"hi","डेस्कटॉप"}, + {"fr","Bureau"}, + {"zh-cht","桌面"}, + {"zh-chs","桌面"}, + {"fi","Työpöytä"}, + {"tr","Masaüstü Bilgisayar"}, + {"cs","Plocha"}, + {"ja","デスクトップ"}, + {"es","Escritorio"}, + {"pt","Área de Trabalho"}, + {"nl","Bureaublad"}, + {"ko","데스크탑"}, + {"ru","Рабочий стол"} + } + }, + { + "Unknown", + new Dictionary() { + {"de","Unbekannt"}, + {"hi","अनजान"}, + {"fr","Inconnue"}, + {"zh-cht","未知"}, + {"zh-chs","未知"}, + {"fi","Tuntematon"}, + {"tr","Bilinmeyen"}, + {"cs","Neznámé"}, + {"ja","未知の"}, + {"es","Desconocido"}, + {"pt","Desconhecido"}, + {"nl","Onbekend"}, + {"ko","알 수 없는"}, + {"ru","Неизвестно"} + } + }, + { + "Activated", + new Dictionary() { + {"de","Aktiviertes"}, + {"hi","सक्रिय"}, + {"fr","Activé"}, + {"zh-cht","已啟動"}, + {"zh-chs","已激活"}, + {"fi","Aktivoitu"}, + {"tr","Aktif"}, + {"cs","Zapnuto"}, + {"ja","有効化"}, + {"es","Activado"}, + {"pt","ativado"}, + {"nl","Geactiveerd"}, + {"ko","활성화 됨"}, + {"ru","Активировано"} + } + }, + { + "Multiple Users", + new Dictionary() { + {"ru","Несколько пользователей"}, + {"fi","Несколько пользователей"}, + {"fr","Utilisateurs multiples"}, + {"es","Múltiples usuarios"} + } + }, + { + "Terminal", + new Dictionary() { + {"hi","टर्मिनल"}, + {"zh-cht","終端機"}, + {"zh-chs","终端"}, + {"fi","Pääte"}, + {"tr","terminal"}, + {"cs","Terminál"}, + {"ja","ターミナル"}, + {"ko","터미널"}, + {"ru","Терминал"} + } + }, + { + "&Close", + new Dictionary() { + {"ru","&Закрывать"}, + {"fi","&Закрывать"}, + {"fr","&Fermer"}, + {"es","&Cerca"} + } + }, + { + "Authenticating", + new Dictionary() { + {"ru","Аутентификация"}, + {"fi","Аутентификация"}, + {"fr","Authentification"}, + {"es","Autenticando"} + } + }, + { + "User Consent", + new Dictionary() { + {"de","Benutzereinwilligung"}, + {"hi","उपयोगकर्ता सहमति"}, + {"fr","Consentement de l'utilisateur"}, + {"zh-cht","用戶同意"}, + {"zh-chs","用户同意"}, + {"fi","Käyttäjän suostumus"}, + {"tr","Kullanıcı Onayı"}, + {"cs","Souhlas uživatele"}, + {"ja","ユーザーの同意"}, + {"es","Consentimiento del Usuario"}, + {"pt","Consentimento do Usuário"}, + {"nl","Toestemming van gebruiker"}, + {"ko","사용자 연결 옵션"}, + {"ru","Согласие пользователя"} + } + }, + { + "Not Activated (Pre)", + new Dictionary() { + {"de","Nicht aktiviert (Pre)"}, + {"hi","सक्रिय नहीं (पूर्व)"}, + {"fr","Non activé (pré)"}, + {"zh-cht","未啟動(預)"}, + {"zh-chs","未激活(预)"}, + {"fi","Ei aktivoitu (ennakko)"}, + {"tr","Etkinleştirilmedi (Ön)"}, + {"cs","Neaktivováno (před)"}, + {"ja","アクティブ化されていない(前)"}, + {"es","No activada (Pre)"}, + {"pt","Não ativado (pré)"}, + {"nl","Niet geactiveerd (Pre)"}, + {"ko","활성화되지 않음 (Pre)"}, + {"ru","Не активированно (Pre)"} + } + }, + { + "S&top Agent", + new Dictionary() { + {"ru","S & главный агент"}, + {"fi","S & главный агент"}, + {"fr","Agent d'arrêt"}, + {"es","Agente s & top"} + } + }, + { + "UDP relay", + new Dictionary() { + {"ru","UDP реле"}, + {"fi","UDP реле"}, + {"fr","Relais UDP"}, + {"es","Relé UDP"} + } + }, + { + "Agent is stopped", + new Dictionary() { + {"ru","Агент остановлен"}, + {"fi","Агент остановлен"}, + {"fr","L'agent est arrêté"}, + {"es","El agente está detenido"} + } + }, + { + "Intel® Management Engine", + new Dictionary() { + {"fr","Moteur de gestion Intel®"}, + {"es","Motor de administración Intel®"} + } + }, + { + "Agent Snapshot", + new Dictionary() { + {"ru","Снимок агента"}, + {"fi","Снимок агента"}, + {"fr","Instantané de l'agent"}, + {"es","Instantánea del agente"} + } + }, + { + "Request Help...", + new Dictionary() { + {"ru","Запросить помощь ..."}, + {"fi","Запросить помощь ..."}, + {"fr","Demander de l'aide..."}, + {"es","Solicitar ayuda ..."} + } + }, + { + "O&pen Site...", + new Dictionary() { + {"ru","Открытие сайта ..."}, + {"fi","Открытие сайта ..."}, + {"fr","&Ouvrir le site..."}, + {"es","Sitio de O & pen ..."} + } + }, + { + "Send", + new Dictionary() { + {"de","Senden"}, + {"hi","संदेश"}, + {"fr","Envoyer"}, + {"zh-cht","發送"}, + {"zh-chs","发送"}, + {"fi","Lähetä"}, + {"tr","Gönder"}, + {"cs","Odeslat"}, + {"ja","送る"}, + {"es","Enviar"}, + {"pt","Enviar"}, + {"nl","Verzenden"}, + {"ko","전송"}, + {"ru","Отправить"} + } + }, + { + "Clear", + new Dictionary() { + {"de","Leeren"}, + {"hi","स्पष्ट"}, + {"fr","Nettoyer"}, + {"zh-cht","清除"}, + {"zh-chs","清除"}, + {"fi","Tyhjennä"}, + {"tr","Açık"}, + {"cs","Vymazat"}, + {"ja","クリア"}, + {"es","Borrar"}, + {"pt","Limpo"}, + {"nl","Wissen"}, + {"ko","지우기"}, + {"ru","Очистить"} + } + }, + { + "Cancel Help Request", + new Dictionary() { + {"ru","Отменить запрос помощи"}, + {"fi","Отменить запрос помощи"}, + {"fr","Annuler la demande d'aide"}, + {"es","Cancelar solicitud de ayuda"} + } + }, + { + "TCP relay", + new Dictionary() { + {"ru","Реле TCP"}, + {"fi","Реле TCP"}, + {"fr","Relais TCP"}, + {"es","Relé TCP"} + } + }, + { + "Privacy Bar", + new Dictionary() { + {"de","Datenschutzleiste"}, + {"hi","गोपनीयता बार"}, + {"fr","Barre de confidentialité"}, + {"zh-cht","隱私欄"}, + {"zh-chs","隐私栏"}, + {"fi","Tietosuojapalkki"}, + {"tr","Gizlilik Çubuğu"}, + {"cs","Bar ochrany osobních údajů"}, + {"ja","プライバシーバー"}, + {"es","Barra de Privacidad"}, + {"pt","Barra de Privacidade"}, + {"nl","Privacy balk"}, + {"ko","프라이버시 바"}, + {"ru","Панель конфиденциальности"} + } + }, + { + "Update", + new Dictionary() { + {"de","Updates"}, + {"hi","अपडेट करें"}, + {"fr","Mettre à jour"}, + {"zh-cht","更新資料"}, + {"zh-chs","更新资料"}, + {"fi","Päivittää"}, + {"tr","Güncelleme"}, + {"cs","Aktualizace"}, + {"ja","更新"}, + {"es","Actualizar"}, + {"pt","Atualizar"}, + {"nl","Bijwerken"}, + {"ko","개조하다"}, + {"ru","Обновить"} + } + }, + { + "Agent is running", + new Dictionary() { + {"ru","Агент работает"}, + {"fi","Агент работает"}, + {"fr","L'agent est en cours d'exécution"}, + {"es","El agente se está ejecutando"} + } + }, + { + "Agent Console", + new Dictionary() { + {"de","Agent-Konsole"}, + {"hi","एजेंट कंसोल"}, + {"fr","Console d'agent"}, + {"zh-cht","代理控制台"}, + {"zh-chs","代理控制台"}, + {"fi","Agentin konsoli"}, + {"tr","Aracı Konsolu"}, + {"cs","Konzole agenta"}, + {"ja","エージェントコンソール"}, + {"es","Consola de Agente"}, + {"pt","Console do agente"}, + {"nl","Agent console"}, + {"ko","에이전트 콘솔"}, + {"ru","Консоль агента"} + } + } + }; + // *** TRANSLATION TABLE END *** + + static public string T(string english) + { + string lang = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName; + if (lang == "en") return english; + if (translationTable.ContainsKey(english)) + { + Dictionary translations = translationTable[english]; + if (translations.ContainsKey(lang)) return translations[lang]; + } + return english; + } + + static public void TranslateControl(Control control) + { + control.Text = T(control.Text); + foreach (Control c in control.Controls) { TranslateControl(c); } + } + + static public void TranslateContextMenu(ContextMenuStrip menu) + { + menu.Text = T(menu.Text); + foreach (object i in menu.Items) { if (i.GetType() == typeof(ToolStripMenuItem)) { TranslateToolStripMenuItem((ToolStripMenuItem)i); } } + } + + static public void TranslateToolStripMenuItem(ToolStripMenuItem menu) + { + menu.Text = T(menu.Text); + foreach (object i in menu.DropDownItems) + { + if (i.GetType() == typeof(ToolStripMenuItem)) + { + TranslateToolStripMenuItem((ToolStripMenuItem)i); + } + } + } + + static public void TranslateListView(ListView listview) + { + listview.Text = T(listview.Text); + foreach (object c in listview.Columns) + { + if (c.GetType() == typeof(ColumnHeader)) + { + ((ColumnHeader)c).Text = T(((ColumnHeader)c).Text); + } + } + } + + + } +} diff --git a/UpdateForm.cs b/UpdateForm.cs index 38f82e6..19e1ffe 100644 --- a/UpdateForm.cs +++ b/UpdateForm.cs @@ -22,6 +22,7 @@ namespace MeshCentralRouter public UpdateForm(string url, string hash, int size, string[] args, string serverhash) { InitializeComponent(); + Translate.TranslateControl(this); this.url = url; this.hash = hash; this.size = size; diff --git a/altPortForm.cs b/altPortForm.cs index 9b4d544..91e3a66 100644 --- a/altPortForm.cs +++ b/altPortForm.cs @@ -8,6 +8,7 @@ namespace MeshCentralRouter public altPortForm() { InitializeComponent(); + Translate.TranslateControl(this); } public int altPort diff --git a/rdpPortForm.cs b/rdpPortForm.cs index aacca54..ed7b10e 100644 --- a/rdpPortForm.cs +++ b/rdpPortForm.cs @@ -1,11 +1,4 @@ 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; namespace MeshCentralRouter @@ -15,6 +8,7 @@ namespace MeshCentralRouter public rdpPortForm() { InitializeComponent(); + Translate.TranslateControl(this); } public int originalRdpPort;