Ben thought he was writing C#

This commit is contained in:
Garth Vander Houwen 2025-05-20 22:29:53 -07:00
parent a2c869ec06
commit d7d2378c51
9 changed files with 19 additions and 197 deletions

View file

@ -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" : {

View file

@ -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)")
}
}
}

View file

@ -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
}
}

View file

@ -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))

View file

@ -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)
}
}

View file

@ -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

View file

@ -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)

View file

@ -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
}

View file

@ -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