diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 0d05008..d3a6c37 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -24,6 +24,47 @@ "homeDeviceCardOnline": "Device is online", "homeDeviceCardOffline": "Device is offline", "homeWolCardTitle": "Waking up...", + "homeWolCardIp": "'{ip}' is an invalid IPv4 address", + "@homeWolCardIp": { + "placeholders": { + "ip": { + "type": "String", + "example": "192.168.0.1" + } + } + }, + "homeWolCardMac": "'{mac}' is an invalid MAC address", + "@homeWolCardMac": { + "placeholders": { + "mac": { + "type": "String", + "example": "12:AB:00:00:00:00" + } + } + }, + "homeWolCardPort": "'{port}' is an invalid port", + "@homeWolCardPort": { + "placeholders": { + "port": { + "type": "String", + "example": "9" + } + } + }, + "homeWolCardValid": "Provided device details are valid", + "homeWolCardInvalid": "There was an error trying to send a WOL Package", + "homeWolCardPingInfo": "Trying to ping device until it is online...", + "homeWolCardPing": "Sending ping #{count}", + "@homeWolCardPing": { + "placeholders": { + "count": { + "type": "String", + "example": "1" + } + } + }, + "homeWolCardPingSuccess": "Device is online", + "homeWolCardPingFail": "Device is still offline", "@DISCOVER": {}, "discoverTitle": "Discover Devices", "discoverCardTitle": "Network Scan", diff --git a/lib/services/network.dart b/lib/services/network.dart index 3959648..54f5577 100644 --- a/lib/services/network.dart +++ b/lib/services/network.dart @@ -69,12 +69,12 @@ Stream sendWolPackage({required NetworkDevice device}) async* { bool invalid = false; if (!IPv4Address.validate(ip)) { - yield Message(text: "'$ip' is a invalid IPv4 address", type: MsgType.error); + yield Message(text: "'$ip' is an invalid IPv4 address", type: MsgType.error); invalid = true; } if (!MACAddress.validate(mac)) { - yield Message(text: "'$mac' is a invalid MAC address", type: MsgType.error); + yield Message(text: "'$mac' is an invalid MAC address", type: MsgType.error); invalid = true; } @@ -85,12 +85,12 @@ Stream sendWolPackage({required NetworkDevice device}) async* { } if (invalid) { - // yield Message(text: "There was a error when trying to send a WOL Package to this host", type: MsgType.error); + yield Message(text: "There was an error trying to send a WOL Package", type: MsgType.error); return; } // if no error occurred: try to send wol package - yield Message(text: "Provided ip and mac address are both valid"); + yield Message(text: "Provided device details are valid"); yield Message(text: "Trying to send WOL Packages"); IPv4Address ipv4Address = IPv4Address(ip); @@ -112,7 +112,7 @@ Stream sendWolPackage({required NetworkDevice device}) async* { text: "Successfully send WOL packages to $ip", type: MsgType.check); } catch (e) { yield Message( - text: "There was a error when trying to send WOL Packages to this host", + text: "There was an error when trying to send WOL Packages to this host", type: MsgType.error); }