mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Additional localized strings
This commit is contained in:
parent
0892214bcd
commit
770a3fbdb3
6 changed files with 44 additions and 42 deletions
|
|
@ -458,7 +458,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, ObservableObject {
|
|||
if decodedInfo.moduleConfig.payloadVariant == ModuleConfig.OneOf_PayloadVariant.cannedMessage(decodedInfo.moduleConfig.cannedMessage) {
|
||||
|
||||
if decodedInfo.moduleConfig.cannedMessage.enabled {
|
||||
self.getCannedMessageModuleMessages(destNum: self.connectedPeripheral.num, wantResponse: true)
|
||||
_ = self.getCannedMessageModuleMessages(destNum: self.connectedPeripheral.num, wantResponse: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1038,16 +1038,8 @@ func nodeInfoAppPacket (packet: MeshPacket, context: NSManagedObjectContext) {
|
|||
|
||||
func adminAppPacket (packet: MeshPacket, context: NSManagedObjectContext) {
|
||||
|
||||
//print(packet.payloadVariant.debugDescription)
|
||||
|
||||
if let messages = try? CannedMessageModuleConfig(serializedData: packet.decoded.payload) {
|
||||
//let adminMessageId = bleManager.saveCannedMessageModuleMessages(messages: messages, fromUser: node!.user!, toUser: node!.user!, wantResponse: true)
|
||||
//if adminMessageId > 0 {
|
||||
|
||||
//}
|
||||
//print(messages)
|
||||
} else {
|
||||
//print(try! packet.decoded.jsonString())
|
||||
print(messages)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,25 +39,26 @@ struct Connect: View {
|
|||
if node != nil {
|
||||
Text(bleManager.connectedPeripheral.longName).font(.title2)
|
||||
}
|
||||
Text("BLE Name: ").font(.caption)+Text(bleManager.connectedPeripheral.peripheral.name ?? "Unknown")
|
||||
Text("ble.name").font(.caption)+Text(": \(bleManager.connectedPeripheral.peripheral.name ?? "Unknown")")
|
||||
.font(.caption).foregroundColor(Color.gray)
|
||||
if node != nil {
|
||||
Text("FW Version: ").font(.caption)+Text(node?.myInfo?.firmwareVersion ?? "Unknown")
|
||||
Text("firmware.version").font(.caption)+Text(": \(node?.myInfo?.firmwareVersion ?? "Unknown")")
|
||||
.font(.caption).foregroundColor(Color.gray)
|
||||
}
|
||||
if bleManager.isSubscribed {
|
||||
Text("Subscribed to mesh").font(.caption)
|
||||
Text("subscribed").font(.caption)
|
||||
.foregroundColor(.green)
|
||||
} else {
|
||||
Text("Communicating with device. . . ").font(.caption)
|
||||
Text("communicating").font(.caption)
|
||||
.foregroundColor(.orange)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
VStack(alignment: .center) {
|
||||
Text("Preferred").font(.caption2)
|
||||
Text("Radio").font(.caption2)
|
||||
Toggle("Preferred Radio", isOn: $bleManager.preferredPeripheral)
|
||||
Text("preferred.radio").font(.caption2)
|
||||
.multilineTextAlignment(.center)
|
||||
.frame(width: 75)
|
||||
Toggle("preferred.radio", isOn: $bleManager.preferredPeripheral)
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
.labelsHidden()
|
||||
.onChange(of: bleManager.preferredPeripheral) { value in
|
||||
|
|
@ -91,7 +92,7 @@ struct Connect: View {
|
|||
isPreferredRadio = false
|
||||
}
|
||||
} label: {
|
||||
Label("Disconnect", systemImage: "antenna.radiowaves.left.and.right.slash")
|
||||
Label("disconnect", systemImage: "antenna.radiowaves.left.and.right.slash")
|
||||
}
|
||||
}
|
||||
.contextMenu{
|
||||
|
|
@ -112,7 +113,7 @@ struct Connect: View {
|
|||
NavigationLink {
|
||||
LoRaConfig(node: node)
|
||||
} label: {
|
||||
Label("Set LoRa Region", systemImage: "globe.americas.fill")
|
||||
Label("set.region", systemImage: "globe.americas.fill")
|
||||
.foregroundColor(.red)
|
||||
.font(.title)
|
||||
}
|
||||
|
|
@ -127,7 +128,7 @@ struct Connect: View {
|
|||
.imageScale(.large).foregroundColor(.orange)
|
||||
.padding(.trailing)
|
||||
if bleManager.timeoutTimerCount == 0 {
|
||||
Text("Connecting . . .")
|
||||
Text("connecting")
|
||||
.font(.title3)
|
||||
.foregroundColor(.orange)
|
||||
} else {
|
||||
|
|
@ -151,7 +152,7 @@ struct Connect: View {
|
|||
.symbolRenderingMode(.hierarchical)
|
||||
.imageScale(.large).foregroundColor(.red)
|
||||
.padding(.trailing)
|
||||
Text("No device connected").font(.title3)
|
||||
Text("not.connected").font(.title3)
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
|
|
@ -215,7 +216,7 @@ struct Connect: View {
|
|||
|
||||
}) {
|
||||
|
||||
Label("Disconnect", systemImage: "antenna.radiowaves.left.and.right.slash")
|
||||
Label("disconnect", systemImage: "antenna.radiowaves.left.and.right.slash")
|
||||
|
||||
}
|
||||
.buttonStyle(.bordered)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ struct Contacts: View {
|
|||
|
||||
NavigationSplitView {
|
||||
List {
|
||||
Section(header: Text("channels")) {
|
||||
Section(header: Text("Channels (groups)")) {
|
||||
// Display Contacts for the rest of the non admin channels
|
||||
if node != nil && node!.myInfo != nil && node!.myInfo!.channels != nil {
|
||||
ForEach(node!.myInfo!.channels!.array as! [ChannelEntity], id: \.self) { (channel: ChannelEntity) in
|
||||
|
|
@ -92,24 +92,24 @@ struct Contacts: View {
|
|||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: 80, alignment: .leading)
|
||||
.contextMenu {
|
||||
if false { // Hide mute channel menu item until I can check it in notifications
|
||||
Button {
|
||||
channel.mute = !channel.mute
|
||||
|
||||
do {
|
||||
try context.save()
|
||||
// Would rather not do this but the merge changes on
|
||||
// A single object is only working on mac GVH
|
||||
context.refreshAllObjects()
|
||||
//context.refresh(channel, mergeChanges: true)
|
||||
} catch {
|
||||
context.rollback()
|
||||
print("💥 Save Channel Mute Error")
|
||||
}
|
||||
} label: {
|
||||
Label(channel.mute ? "Show Alerts" : "Hide Alerts", systemImage: channel.mute ? "bell" : "bell.slash")
|
||||
}
|
||||
}
|
||||
// Hide mute channel menu item until I can check it in notifications
|
||||
// Button {
|
||||
// channel.mute = !channel.mute
|
||||
//
|
||||
// do {
|
||||
// try context.save()
|
||||
// // Would rather not do this but the merge changes on
|
||||
// // A single object is only working on mac GVH
|
||||
// context.refreshAllObjects()
|
||||
// //context.refresh(channel, mergeChanges: true)
|
||||
// } catch {
|
||||
// context.rollback()
|
||||
// print("💥 Save Channel Mute Error")
|
||||
// }
|
||||
// } label: {
|
||||
// Label(channel.mute ? "Show Alerts" : "Hide Alerts", systemImage: channel.mute ? "bell" : "bell.slash")
|
||||
// }
|
||||
|
||||
if channel.allPrivateMessages.count > 0 {
|
||||
Button(role: .destructive) {
|
||||
isPresentingDeleteChannelMessagesConfirm = true
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ struct PositionConfig: View {
|
|||
Button("Save Position Config to \(bleManager.connectedPeripheral != nil ? bleManager.connectedPeripheral.longName : "Unknown")?") {
|
||||
|
||||
if fixedPosition {
|
||||
let sendPosition = bleManager.sendPosition(destNum: bleManager.connectedPeripheral.num, wantAck: true)
|
||||
_ = bleManager.sendPosition(destNum: bleManager.connectedPeripheral.num, wantAck: true)
|
||||
}
|
||||
|
||||
var pc = Config.PositionConfig()
|
||||
|
|
|
|||
|
|
@ -6,12 +6,21 @@
|
|||
|
||||
*/
|
||||
"available.radios"="Available Radios";
|
||||
"ble.name"="BLE Name";
|
||||
"cancel"="Cancel";
|
||||
"channels"="Channels (groups)";
|
||||
"connected.radio"="Connected Radio";
|
||||
"communicating"="Communicating with device. .";
|
||||
"connecting"="Connecting . .";
|
||||
"contacts"="Contacts";
|
||||
"delete"="Delete";
|
||||
"direct.messages"="Direct Messages";
|
||||
"disconnect"="Disconnect";
|
||||
"firmware.version"="Firmware Version";
|
||||
"not.connected"="No device connected";
|
||||
"preferred.radio"="Preferred Radio";
|
||||
"save"="Save";
|
||||
"subscribed"="Subscribed to mesh";
|
||||
"select.contact"="Select a Contact";
|
||||
"set.region"="Set LoRa Region";
|
||||
"unknown.age"="Unknown Age";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue