From be5005888f7fae9e0f0e7f2151286daaeb2f4499 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 16 Nov 2015 16:26:28 -0500 Subject: [PATCH] Some changes for translation --- EduNetworkBuilder/NetworkCard.cs | 23 +++++----- .../Resources/languages/edustrings.resx | 24 ++++++++++ EduNetworkBuilder/toedit.txt | 46 ------------------- 3 files changed, 35 insertions(+), 58 deletions(-) diff --git a/EduNetworkBuilder/NetworkCard.cs b/EduNetworkBuilder/NetworkCard.cs index 4091244..6f25cf9 100644 --- a/EduNetworkBuilder/NetworkCard.cs +++ b/EduNetworkBuilder/NetworkCard.cs @@ -363,10 +363,9 @@ namespace EduNetworkBuilder if (nIF.isLocal(theIP)) { if(Tracker != null) - Tracker.AddMessage(DebugLevel.routing, myID.HostName, "Found local interface: ip" + nIF.myIP.GetIP.ToIpString() + - " gw:" + nIF.myIP.GetMask.ToIpString()); - if(Tracker != null && theIP != null) - Tracker.AddMessage(DebugLevel.routing, myID.HostName, " IP of local: " + theIP.GetIPString + " " + theIP.GetGateway.ToIpString()); + Tracker.AddMessage(DebugLevel.routing, myID.HostName, string.Format(NB.Translate("NC_FoundLocalIP"), nIF.myIP.GetIP.ToIpString(), nIF.myIP.GetMask.ToIpString())); + if (Tracker != null && theIP != null) + Tracker.AddMessage(DebugLevel.routing, myID.HostName, " " + string.Format(NB.Translate("NC_IpOfLocal"),theIP.GetIPString, theIP.GetGateway.ToIpString())); return nIF; } } @@ -435,7 +434,7 @@ namespace EduNetworkBuilder nPacket.AddMessage(DebugLevel.debug, " No Machine matching that IP address on this subnet. " + nPacket.destIP.GetIPString); Network mynet = NB.GetNetwork(); NetworkDevice nd = mynet.GetDeviceFromID(myID); - string hostname = "No Host"; + string hostname = NB.Translate("NC_NoHost"); if (nd != null) hostname = nd.hostname; nPacket.Tracking.Status = hostname + " No Machine matching that IP address on this subnet. " + nPacket.destIP.GetIPString; nPacket.MyStatus = PacketStatus.finished_failed; @@ -490,7 +489,7 @@ namespace EduNetworkBuilder nPacket.AddMessage(DebugLevel.debug, " No Machine matching that IP address on this subnet. " + nPacket.destIP.GetIPString); Network mynet = NB.GetNetwork(); NetworkDevice nd = mynet.GetDeviceFromID(myID); - string hostname = "No Host"; + string hostname = NB.Translate("NC_NoHost"); if (nd != null) hostname = nd.hostname; nPacket.Tracking.Status = hostname + " No Machine matching that IP address on this subnet. " + nPacket.destIP.GetIPString; nPacket.MyStatus = PacketStatus.finished_failed; @@ -556,7 +555,7 @@ namespace EduNetworkBuilder nPacket.AddMessage(DebugLevel.debug, " No Machine matching that IP address on this subnet. " + nPacket.destIP.GetIPString); Network mynet = NB.GetNetwork(); NetworkDevice nd = mynet.GetDeviceFromID(myID); - string hostname = "No Host"; + string hostname = NB.Translate("NC_NoHost"); if (nd != null) hostname = nd.hostname; nPacket.Tracking.Status = hostname + " No Machine matching that IP address on this subnet. " + nPacket.destIP.GetIPString; nPacket.MyStatus = PacketStatus.finished_failed; @@ -657,7 +656,7 @@ namespace EduNetworkBuilder tPacket.AddMessage(DebugLevel.debug, " The packet was not expected by the firewall, so it was rejected."); mynet = NB.GetNetwork(); nd = mynet.GetDeviceFromID(myID); - string hostname = "No Host"; + string hostname = NB.Translate("NC_NoHost"); if (nd != null) hostname = nd.hostname; tPacket.Tracking.Status = hostname + " The packet was rejected by the firewall.. Dropped."; tPacket.MyStatus = PacketStatus.finished_failed; @@ -670,13 +669,13 @@ namespace EduNetworkBuilder } else { - tPacket.AddMessage(DebugLevel.routing,"The Packet was destined for a different machine (MAC Address): Rejected"); - tPacket.AddMessage(DebugLevel.debug, string.Format(" Device MAC: {0} did not match packet: {1}", MAC, tPacket.destMAC)); + tPacket.AddMessage(DebugLevel.routing,NB.Translate("NC_ProcessInboundPacket_DifferentMachine1")); + tPacket.AddMessage(DebugLevel.debug, string.Format(" " + NB.Translate("NC_ProcessInboundPacket_DifferentMachine2"), MAC, tPacket.destMAC)); mynet = NB.GetNetwork(); nd = mynet.GetDeviceFromID(myID); - string hostname = "No Host"; + string hostname = NB.Translate("NC_NoHost"); if (nd != null) hostname = nd.hostname; - tPacket.Tracking.Status = hostname + " Packet destined for another machine. Dropped."; + tPacket.Tracking.Status = hostname + " " + NB.Translate("NC_ProcessInboundPacket_DifferentMachine3"); tPacket.MyStatus = PacketStatus.finished_failed; } } diff --git a/EduNetworkBuilder/Resources/languages/edustrings.resx b/EduNetworkBuilder/Resources/languages/edustrings.resx index 2cbb1ab..829432c 100644 --- a/EduNetworkBuilder/Resources/languages/edustrings.resx +++ b/EduNetworkBuilder/Resources/languages/edustrings.resx @@ -953,4 +953,28 @@ --Static Routes (Read/Write)-- LBW_UpdateFormStatRout = --Static Routes (Read/Write)-- + + Found local interface: ip {0} gw {1} + NC_FoundLocalIP = Found local interface: ip {0} gw {1} + + + IP of local: {0} {1} + NC_IpOfLocal = IP of local: {0} {1} + + + No Host + NC_NoHost = No Host + + + The Packet was destined for a different machine (MAC Address): Rejected + NC_ProcessInboundPacket_DifferentMachine1 = The Packet was destined for a different machine (MAC Address): Rejected + + + Device MAC: {0} did not match packet: {1} + NC_ProcessInboundPacket_DifferentMachine2 = Device MAC: {0} did not match packet: {1} + + + Packet destined for another machine. Dropped. + NC_ProcessInboundPacket_DifferentMachine3 = Packet destined for another machine. Dropped. + \ No newline at end of file diff --git a/EduNetworkBuilder/toedit.txt b/EduNetworkBuilder/toedit.txt index 17ee038..1d98d0d 100644 --- a/EduNetworkBuilder/toedit.txt +++ b/EduNetworkBuilder/toedit.txt @@ -13,10 +13,6 @@ DeviceConfig.cs:294: if (ClonedItem.GetType().ToString() == "EduNetwo DeviceConfig.cs:347: if (ClonedItem.GetType().ToString() == "EduNetworkBuilder.NetworkDevice") DeviceConfig.cs:353: selectedNIC = Regex.Replace(selectedNIC, " .*", ""); DeviceConfig.cs:354: selectedNIC = Regex.Replace(selectedNIC, "\\*", ""); -IPAddress.cs:66: writer.WriteElementString("ip", _ip.ToIpString()); -IPAddress.cs:67: writer.WriteElementString("mask", _mask.ToIpString()); -IPAddress.cs:68: writer.WriteElementString("gateway", _gw.ToIpString()); -IPAddress.cs:69: writer.WriteElementString("type", myType.ToString()); IPAddress.cs:99: public bool Edit(NetworkDevice FromWhat, string message="") IPAddress.cs:102: if (message != "") IPAddress.cs:122: _mask = "255.255.255.0".ParseIp(); @@ -38,7 +34,6 @@ LanguageString.cs:15: public string language="en"; LanguageString.cs:30: if(Regex.IsMatch(theNode.Name.ToLower(),"^[a-z][a-z]_" + tag)) LanguageString.cs:34: language = Regex.Replace(theNode.Name.ToLower(), "_" + tag, ""); LanguageString.cs:39: language = "en"; -LanguageString.cs:48: writer.WriteElementString(language+"_" + tag_type, text); LanguageString.cs:55: string tag = ""; LanguageString.cs:113: if(language != "en") LanguageString.cs:115: return GetText("en"); @@ -61,10 +56,6 @@ ListBoxWindow.cs:230: if(selected != null && selected != "") ListBoxWindow.cs:251: TheName = Regex.Replace(TheName, @"^\* ", ""); NB.cs:95: HostName = ""; NB.cs:96: NicName = ""; -NB.cs:123: writer.WriteElementString("hostid", HostID.ToString()); -NB.cs:124: writer.WriteElementString("nicid", NicID.ToString()); -NB.cs:125: writer.WriteElementString("hostname", HostName); -NB.cs:126: writer.WriteElementString("nicname", NicName); NB.cs:131: get { return HostID.ToString()+"-"+NicID.ToString(); } NB.cs:213: PuzzleTags.Add("Level_" + Individual.InnerText); NB.cs:228: public static string BroadcastMACString = "FF:FF:FF:FF:FF:FF"; //The broadcast MAC address @@ -92,10 +83,6 @@ NB.cs:595: "Invalid Bit " + BitNumber.ToString() + "! (Should be NB.cs:608: "Invalid Bit" + BitNumber.ToString() + "! (Should be from 0 to 7)"); NetTest.cs:14: public string sHost = ""; NetTest.cs:15: public string dHost = ""; -NetTest.cs:79: writer.WriteStartElement("nettest"); -NetTest.cs:80: writer.WriteElementString("shost", sHost); -NetTest.cs:81: writer.WriteElementString("dhost", dHost); -NetTest.cs:82: writer.WriteElementString("thetest", TheTest.ToString()); NetTest.cs:114: string toreturn = ""; NetTest.cs:119: toreturn = "Has a problem"; NetTest.cs:127: toreturn = "Needs the gateway set"; @@ -156,18 +143,7 @@ Network.cs:167: if(Regex.IsMatch(Individual.Name.ToLo Network.cs:172: if (Regex.IsMatch(Individual.Name.ToLower(), "title")) Network.cs:183: if (NetMessage.GetText() != "" && !AlreadyDisplayedMessage) Network.cs:207: Save(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Test.enbx")); -Network.cs:220: writer.WriteStartElement("EduNetworkBuilder"); Network.cs:221: writer.WriteComment("This is a network file for EduNetworkBuilder."); -Network.cs:235: writer.WriteStartElement("Network"); -Network.cs:238: writer.WriteElementString("height", myHeight.ToString()); -Network.cs:239: writer.WriteElementString("width", myWidth.ToString()); -Network.cs:240: writer.WriteElementString("itemsize", itemsize.ToString()); -Network.cs:241: writer.WriteElementString("showlabels", ShowLabels.ToString()); -Network.cs:242: writer.WriteElementString("level", Level.ToString()); -Network.cs:243: writer.WriteElementString("sortorder", SortOrder.ToString()); -Network.cs:244: writer.WriteElementString("uniqueidentifier", UniqueIdentifier.ToString()); -Network.cs:245: writer.WriteElementString("startinghelplevel", StartingHelpLevel.ToString()); -Network.cs:264: writer.WriteElementString("tag",HT.ToString()); Network.cs:327: if (tItem.GetType().ToString() == "EduNetworkBuilder.NetworkDevice") Network.cs:342: if (tItem.GetType().ToString() == "EduNetworkBuilder.NetworkDevice") Network.cs:357: if(tItem.GetType().ToString() == "EduNetworkBuilder.NetworkDevice") @@ -281,17 +257,9 @@ NetworkBuilder.cs:1253: LoadNetworkFromResource("firewalls"); NetworkBuilder.cs:1269: DialogResult answer = MessageBox.Show("Changing the language can only be done when the program starts: Close the program and prompt for a new language when you start it again?","Are you Sure?",MessageBoxButtons.YesNoCancel); NetworkCard.cs:26: private string _nic_name=""; NetworkCard.cs:42: nInterface = new NetworkInterface(NicName(), "127.0.0.1", "255.0.0.0", myID); -NetworkCard.cs:113: writer.WriteStartElement("nic"); -NetworkCard.cs:114: writer.WriteElementString("nictype", myNicType.ToString()); -NetworkCard.cs:115: writer.WriteElementString("nicname", _nic_name); NetworkCard.cs:116: myID.Save(writer, "myid"); -NetworkCard.cs:117: writer.WriteElementString("nictype", myNicType.ToString()); -NetworkCard.cs:118: writer.WriteElementString("uniqueidentifier", UniqueIdentifier.ToString()); -NetworkCard.cs:119: writer.WriteElementString("usesdhcp", UsesDHCP.ToString()); NetworkCard.cs:120: if(EncryptionKey != "") -NetworkCard.cs:121: writer.WriteElementString("encryptionkey", EncryptionKey); NetworkCard.cs:122: if (SSID != "") -NetworkCard.cs:123: writer.WriteElementString("ssid", SSID); NetworkCard.cs:126: TunnelEndpoint.Save(writer, "tunnelendpoint"); NetworkCard.cs:171: string connected = " "; NetworkCard.cs:172: if (isConnected(true)) connected = "*"; @@ -350,14 +318,6 @@ NetworkComponent.cs:18: public bool IsDirty = true; //If something has ch NetworkComponent.cs:20: public string hostname = ""; NetworkComponent.cs:88: throw new ArgumentException("The type must be serializable.", "source"); NetworkDevice.cs:295: DefaultGW.Edit(this,"Default Gateway"); -NetworkDevice.cs:382: writer.WriteStartElement("device"); -NetworkDevice.cs:383: writer.WriteElementString("hostname", hostname); -NetworkDevice.cs:384: writer.WriteElementString("size", Size.ToString()); -NetworkDevice.cs:385: writer.WriteElementString("uniqueidentifier", UniqueIdentifier.ToString()); -NetworkDevice.cs:386: writer.WriteElementString("location", MyLocation.X.ToString() + "," + MyLocation.Y.ToString()); -NetworkDevice.cs:387: writer.WriteElementString("mytype", myType.ToString()); -NetworkDevice.cs:388: writer.WriteElementString("isdns", isDNSServer.ToString()); -NetworkDevice.cs:389: writer.WriteElementString("isdhcp", isDHCPServer.ToString()); NetworkDevice.cs:390: DefaultGW.Save(writer, "gateway"); NetworkDevice.cs:397: ip.Save(writer, "route"); NetworkDevice.cs:401: dhcp.Save(writer, "dhcprange"); @@ -455,8 +415,6 @@ NetworkDevice.cs:2460: if (ip.GetIP.ToIpString() != "127.0.0.1") NetworkDevice.cs:2464: theStrings.Add("IF:" + ip.GetIP.ToIpString().PadLeft(15) + " Range: " + NetworkDevice.cs:2465: ip.GetMask.ToIpString() + " - " + ip.GetGateway.ToIpString()); NetworkDevice.cs:2481: if (ip.GetIP.ToIpString() != "127.0.0.1" && InterfaceIP.IsLocal(ip)) -NetworkInterface.cs:48: writer.WriteStartElement("interface"); -NetworkInterface.cs:49: writer.WriteElementString("nicname", nic_name); NetworkInterface.cs:50: myIP.Save(writer, "myip"); NetworkInterface.cs:59: tstring += " - " + myIP.GetMask.ToIpString(); NetworkInterface.cs:64: mask = Regex.Replace(mask, "0", ""); @@ -464,12 +422,8 @@ NetworkInterface.cs:66: tstring += "/" + count.ToString(); NetworkInterface.cs:107: tPacket.sourceIP = new IPAddress(myIP.GetIP.ToIpString(), "", IPAddressType.ip_only); //We only want the IP address NetworkLink.cs:50: if(IsWireless && AccessPoint != null && Client != null && AccessPoint.SSID != null && AccessPoint.SSID != "") NetworkLink.cs:65: MessageBox.Show("The SSID and Key have been updated on the client."); -NetworkLink.cs:119: writer.WriteStartElement("link"); NetworkLink.cs:120: SrcNic.Save(writer, "SrcNic"); NetworkLink.cs:121: DstNic.Save(writer, "DstNic"); -NetworkLink.cs:122: writer.WriteElementString("hostname", hostname); -NetworkLink.cs:123: writer.WriteElementString("linktype", theLinkType.ToString()); -NetworkLink.cs:124: writer.WriteElementString("uniqueidentifier", UniqueIdentifier.ToString()); NetworkLink.cs:287: //Console.WriteLine(" health=" + tPacket.health.ToString()); NetworkLink.cs:306: tPacket.Tracking.AddMessage(DebugLevel.info, this, "The packet was corrupted. The network wire may run too close to electricity or fluorescent lighting, or the wireless path is being interfered by a microwave, wireless phone, or other radio device."); NetworkLink.cs:307: tPacket.Tracking.Status = "The packet got corrupted and was dropped.";