diff --git a/Localizable.xcstrings b/Localizable.xcstrings index f08588ee..ba8240c5 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -4419,129 +4419,6 @@ } } }, - "ble.signal.strength.normal" : { - "comment" : "VoiceOver value for normal BLE signal strength", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Signalstärke normal" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Signal strength normal" - } - }, - "it" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Segnale normale" - } - }, - "sr" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Нормалан сигнал" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "信号正常" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "訊號正常" - } - } - } - }, - "ble.signal.strength.strong" : { - "comment" : "VoiceOver value for strong BLE signal strength", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Signalstärke stark" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Signal strength strong" - } - }, - "it" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Segnale forte" - } - }, - "sr" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Јак сигнал" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "信号强" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "訊號強" - } - } - } - }, - "ble.signal.strength.weak" : { - "comment" : "VoiceOver value for weak BLE signal strength", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Signalstärke schwach" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Signal strength weak" - } - }, - "it" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Segnale debole" - } - }, - "sr" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Слаб сигнал" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "信号弱" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "訊號微弱" - } - } - } - }, "Bluetooth" : { "localizations" : { "de" : { @@ -4774,28 +4651,6 @@ } } }, - "bluetooth.connected" : { - "comment" : "VoiceOver label for connected Bluetooth icon", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Connected to Bluetooth device" - } - } - } - }, - "bluetooth.not.connected" : { - "comment" : "VoiceOver label for disconnected Bluetooth icon", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "No Bluetooth device connected" - } - } - } - }, "Broadcast Interval" : { "localizations" : { "it" : { @@ -9462,28 +9317,6 @@ } } }, - "device_charging" : { - "comment" : "VoiceOver value for charging device", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Charging" - } - } - } - }, - "device_plugged_in" : { - "comment" : "VoiceOver value for plugged in device", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Plugged in" - } - } - } - }, "Dilution of precision (DOP) PDOP used by default" : { "localizations" : { "it" : { diff --git a/Meshtastic/AppIntents/AddContactIntent.swift b/Meshtastic/AppIntents/AddContactIntent.swift index 17c6b960..e68ac4a3 100644 --- a/Meshtastic/AppIntents/AddContactIntent.swift +++ b/Meshtastic/AppIntents/AddContactIntent.swift @@ -23,11 +23,9 @@ struct AddContactIntent: AppIntent { } if contactUrl.absoluteString.lowercased().contains("meshtastic.org/v/#") { - let components = self.contactUrl.absoluteString.components(separatedBy: "#") // Extract contact information from the URL if let contactData = components.last { - let decodedString = contactData.base64urlToBase64() if let decodedData = Data(base64Encoded: decodedString) { do { @@ -38,7 +36,6 @@ struct AddContactIntent: AppIntent { } catch { throw AppIntentErrors.AppIntentError.message("Failed to parse contact data: \(error.localizedDescription)") - } } } diff --git a/Meshtastic/Views/Helpers/BLESignalStrengthIndicator.swift b/Meshtastic/Views/Helpers/BLESignalStrengthIndicator.swift index e8efaf3e..2e8d5c53 100644 --- a/Meshtastic/Views/Helpers/BLESignalStrengthIndicator.swift +++ b/Meshtastic/Views/Helpers/BLESignalStrengthIndicator.swift @@ -36,11 +36,11 @@ struct SignalStrengthIndicator: View { private var accessibilityDescription: String { switch signalStrength { case .weak: - return NSLocalizedString("ble.signal.strength.weak", comment: "VoiceOver value for weak BLE signal strength") + return "Signal strength weak".localized case .normal: - return NSLocalizedString("ble.signal.strength.normal", comment: "VoiceOver value for normal BLE signal strength") + return "Signal strength normal".localized case .strong: - return NSLocalizedString("ble.signal.strength.strong", comment: "VoiceOver value for strong BLE signal strength") + return "Signal strength strong".localized } } diff --git a/Meshtastic/Views/Helpers/BatteryCompact.swift b/Meshtastic/Views/Helpers/BatteryCompact.swift index 6d31e6af..f2142534 100644 --- a/Meshtastic/Views/Helpers/BatteryCompact.swift +++ b/Meshtastic/Views/Helpers/BatteryCompact.swift @@ -103,10 +103,10 @@ struct BatteryCompact: View { .accessibilityValue(batteryLevel.map { level in if level > 100 { // Plugged in - same as PWD visual indicator - return NSLocalizedString("device_plugged_in", comment: "VoiceOver value for plugged in device") + return "Plugged in".localized } else if level == 100 { // Charging - same as CHG visual indicator - return NSLocalizedString("device_charging", comment: "VoiceOver value for charging device") + return "Charging".localized } else { // Normal battery level return String(format: NSLocalizedString("Battery Level %", comment: "VoiceOver value for battery level"), Int(level)) diff --git a/Meshtastic/Views/Helpers/BatteryGauge.swift b/Meshtastic/Views/Helpers/BatteryGauge.swift index 81e81e7e..addbc97c 100644 --- a/Meshtastic/Views/Helpers/BatteryGauge.swift +++ b/Meshtastic/Views/Helpers/BatteryGauge.swift @@ -79,8 +79,8 @@ struct PluggedInIndicator: View { .symbolRenderingMode(.hierarchical) // Override the accessibility to ensure correct VoiceOver announcement .accessibilityElement(children: .ignore) - .accessibilityLabel(NSLocalizedString("Battery Level", comment: "VoiceOver label for battery gauge")) - .accessibilityValue(NSLocalizedString("device_plugged_in", comment: "VoiceOver value for plugged in device")) + .accessibilityLabel("Battery Level".localized) + .accessibilityValue("Plugged in".localized) } } diff --git a/Meshtastic/Views/Helpers/ConnectedDevice.swift b/Meshtastic/Views/Helpers/ConnectedDevice.swift index 4a46db41..e0dc8a02 100644 --- a/Meshtastic/Views/Helpers/ConnectedDevice.swift +++ b/Meshtastic/Views/Helpers/ConnectedDevice.swift @@ -38,7 +38,7 @@ struct ConnectedDevice: View { .accessibilityHidden(true) } .accessibilityElement(children: .ignore) - .accessibilityLabel("bluetooth.connected".localized + ", " + name.formatNodeNameForVoiceOver()) + .accessibilityLabel("Connected to Bluetooth device".localized + ", " + name.formatNodeNameForVoiceOver()) } else { // Create a container for disconnected state HStack { @@ -49,7 +49,7 @@ struct ConnectedDevice: View { .accessibilityHidden(true) } .accessibilityElement(children: .ignore) - .accessibilityLabel("bluetooth.not.connected".localized) + .accessibilityLabel("No Bluetooth device connected".localized) } } else { // Create a container for Bluetooth off state diff --git a/Meshtastic/Views/Messages/UserMessageList.swift b/Meshtastic/Views/Messages/UserMessageList.swift index 54ff0b4d..65854fc0 100644 --- a/Meshtastic/Views/Messages/UserMessageList.swift +++ b/Meshtastic/Views/Messages/UserMessageList.swift @@ -14,7 +14,6 @@ struct UserMessageList: View { @EnvironmentObject var appState: AppState @EnvironmentObject var bleManager: BLEManager @Environment(\.managedObjectContext) var context - // Keyboard State @FocusState var messageFieldFocused: Bool // View State Items @@ -24,23 +23,22 @@ struct UserMessageList: View { @State private var showScrollToBottomButton = false @State private var hasReachedBottom = false @State private var gotFirstUnreadMessage: Bool = false - @State private var messageToHighlight: Int64 = 0 - + var body: some View { VStack { ScrollViewReader { scrollView in ZStack(alignment: .bottomTrailing) { ScrollView { LazyVStack { - ForEach( Array(user.messageList.enumerated()) , id: \.element.id) { index, message in + ForEach( Array(user.messageList.enumerated()), id: \.element.id) { index, message in // Get the previous message, if it exists let previousMessage = index > 0 ? user.messageList[index - 1] : nil if message.displayTimestamp(aboveMessage: previousMessage) { Text(message.timestamp.formatted(date: .abbreviated, time: .shortened)) .font(.caption) .foregroundColor(.gray) - } + } if user.num != bleManager.connectedPeripheral?.num ?? -1 { let currentUser: Bool = (Int64(UserDefaults.preferredPeripheralNum) == message.fromUser?.num ?? -1 ? true : false) diff --git a/Meshtastic/Views/Nodes/Helpers/NodeListItem.swift b/Meshtastic/Views/Nodes/Helpers/NodeListItem.swift index a25d9d51..e7d00a6a 100644 --- a/Meshtastic/Views/Nodes/Helpers/NodeListItem.swift +++ b/Meshtastic/Views/Nodes/Helpers/NodeListItem.swift @@ -49,9 +49,9 @@ struct NodeListItem: View { if let battery = node.latestDeviceMetrics?.batteryLevel { // Check for plugged in and charging states, same logic as in BatteryCompact and BatteryGauge if battery > 100 { - desc += ", " + NSLocalizedString("device_plugged_in", comment: "VoiceOver value for plugged in device") + desc += ", " + "Plugged in".localized } else if battery == 100 { - desc += ", " + NSLocalizedString("device_charging", comment: "VoiceOver value for charging device") + desc += ", " + "Charging".localized } else { desc += ", battery \(battery)%" } @@ -60,7 +60,6 @@ struct NodeListItem: View { if !connected, let (lastPosition, myCoord) = locationData { let nodeCoord = CLLocation(latitude: lastPosition.nodeCoordinate!.latitude, longitude: lastPosition.nodeCoordinate!.longitude) let metersAway = nodeCoord.distance(from: myCoord) - // Distance information let distanceFormatter = LengthFormatter() distanceFormatter.unitStyle = .medium @@ -87,11 +86,11 @@ struct NodeListItem: View { let signalString: String switch signalStrength { case .weak: - signalString = NSLocalizedString("ble.signal.strength.weak", comment: "VoiceOver value for weak BLE signal strength") + signalString = "Signal strength weak".localized case .normal: - signalString = NSLocalizedString("ble.signal.strength.normal", comment: "VoiceOver value for normal BLE signal strength") + signalString = "Signal strength normal".localized case .strong: - signalString = NSLocalizedString("ble.signal.strength.strong", comment: "VoiceOver value for strong BLE signal strength") + signalString = "Signal strength strong".localized } desc += ", " + signalString } diff --git a/Meshtastic/Views/Nodes/Helpers/ShareContactQRDialog.swift b/Meshtastic/Views/Nodes/Helpers/ShareContactQRDialog.swift index 5d361fbe..4bc56e24 100644 --- a/Meshtastic/Views/Nodes/Helpers/ShareContactQRDialog.swift +++ b/Meshtastic/Views/Nodes/Helpers/ShareContactQRDialog.swift @@ -15,12 +15,10 @@ import OSLog struct ShareContactQRDialog: View { let node: NodeInfo @Environment(\.dismiss) private var dismiss - var qrString: String { var contact = SharedContact() contact.nodeNum = node.num contact.user = node.user - do { let contactString = try contact.serializedData().base64EncodedString() return ("https://meshtastic.org/v/#" + contactString.base64ToBase64url()) @@ -28,9 +26,7 @@ struct ShareContactQRDialog: View { Logger.services.error("Error serializing contact: \(error)") return "" } - } - var qrImage: UIImage { let context = CIContext() let filter = CIFilter.qrCodeGenerator() @@ -42,7 +38,6 @@ struct ShareContactQRDialog: View { } return UIImage(systemName: "xmark.circle") ?? UIImage() } - var body: some View { VStack(spacing: 20) { Text("Share Contact QR") @@ -86,8 +81,8 @@ struct ShareContactQRDialog_Previews: PreviewProvider { userProto.id = "!1234" userProto.longName = "Bud" userProto.shortName = "Bud" - userProto.hwModel = HardwareModel(rawValue:1)!; - userProto.role = Config.DeviceConfig.Role(rawValue: 1)! + userProto.hwModel = HardwareModel.tbeam + userProto.role = Config.DeviceConfig.Role.client userProto.publicKey = Data() node.user = userProto