From fc0e1daa7d342d452cbb11ec8c302af80a2b2f2e Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 12 Dec 2022 22:33:06 -0800 Subject: [PATCH] More strings --- Meshtastic/Views/Helpers/LastHeardText.swift | 7 +------ Meshtastic/Views/Nodes/NodeList.swift | 14 ++++---------- .../Config/Module/RangeTestConfig.swift | 2 +- .../Settings/Config/Module/SerialConfig.swift | 2 +- .../Config/Module/TelemetryConfig.swift | 2 +- Meshtastic/Views/Settings/Settings.swift | 19 +++++++++---------- de.lproj/Localizable.strings | 2 ++ en.lproj/Localizable.strings | 19 ++++++++++++++++++- 8 files changed, 37 insertions(+), 30 deletions(-) diff --git a/Meshtastic/Views/Helpers/LastHeardText.swift b/Meshtastic/Views/Helpers/LastHeardText.swift index eb68fd57..d4a877e9 100644 --- a/Meshtastic/Views/Helpers/LastHeardText.swift +++ b/Meshtastic/Views/Helpers/LastHeardText.swift @@ -7,16 +7,11 @@ import SwiftUI // struct LastHeardText: View { var lastHeard: Date? - let sixMonthsAgo = Calendar.current.date(byAdding: .month, value: -6, to: Date()) - var body: some View { if (lastHeard != nil && lastHeard! >= sixMonthsAgo!){ - - Text("Heard: \(lastHeard!, style: .relative) ago") - + Text("heard")+Text(": \(lastHeard!, style: .relative) ")+Text("ago") } else { - Text("unknown.age") } } diff --git a/Meshtastic/Views/Nodes/NodeList.swift b/Meshtastic/Views/Nodes/NodeList.swift index 2845bafe..aaefe178 100644 --- a/Meshtastic/Views/Nodes/NodeList.swift +++ b/Meshtastic/Views/Nodes/NodeList.swift @@ -30,13 +30,7 @@ struct NodeList: View { NavigationSplitView { List (nodes, id: \.self, selection: $selection) { node in if nodes.count == 0 { - Text("Scan for Radios").font(.largeTitle) - Text("No Meshtastic Nodes Found").font(.title2) - Text("Go to the bluetooth section in the bottom right menu and click the Start Scanning button to scan for nearby radios and find your Meshtastic device. Make sure your device is powered on and near your iPhone, iPad or Mac.") - .font(.body) - Text("Once the device shows under Available Devices touch the device you want to connect to and it will pull node information over BLE and populate the node list and mesh map in the Meshtastic app.") - Text("Views with bluetooth functionality will show an indicator in the upper right hand corner showing if bluetooth is on, and if a device is connected.") - .listRowSeparator(.visible) + Text("no.nodes").font(.title) } else { NavigationLink(value: node) { let connected: Bool = (bleManager.connectedPeripheral != nil && bleManager.connectedPeripheral.num == node.num) @@ -51,7 +45,7 @@ struct NodeList: View { Image(systemName: "repeat.circle.fill") .font(.title3) .symbolRenderingMode(.hierarchical) - Text("Currently Connected").font(.subheadline) + Text("connected").font(.subheadline) .foregroundColor(.green) } } @@ -85,7 +79,7 @@ struct NodeList: View { .padding([.top, .bottom]) } } - .navigationTitle("All Nodes") + .navigationTitle("nodes") .navigationBarItems(leading: MeshtasticLogo() ) @@ -97,7 +91,7 @@ struct NodeList: View { if let node = selection { NodeDetail(node:node) } else { - Text("Select a node") + Text("select.node") } } } diff --git a/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift b/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift index 1e5d7f12..75993452 100644 --- a/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/RangeTestConfig.swift @@ -114,7 +114,7 @@ struct RangeTestConfig: View { } } } - .navigationTitle("Range Test Config") + .navigationTitle("range.test.config") .navigationBarItems(trailing: ZStack { ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????") diff --git a/Meshtastic/Views/Settings/Config/Module/SerialConfig.swift b/Meshtastic/Views/Settings/Config/Module/SerialConfig.swift index f09e8500..77399586 100644 --- a/Meshtastic/Views/Settings/Config/Module/SerialConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/SerialConfig.swift @@ -148,7 +148,7 @@ struct SerialConfig: View { } } - .navigationTitle("Serial Config") + .navigationTitle("serial.config") .navigationBarItems(trailing: ZStack { diff --git a/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift b/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift index 621db50c..8a6726d6 100644 --- a/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/TelemetryConfig.swift @@ -154,7 +154,7 @@ struct TelemetryConfig: View { } } - .navigationTitle("Telemetry Config") + .navigationTitle("telemetry.config") .navigationBarItems(trailing: ZStack { ConnectedDevice(bluetoothOn: bleManager.isSwitchedOn, deviceConnected: bleManager.connectedPeripheral != nil, name: (bleManager.connectedPeripheral != nil) ? bleManager.connectedPeripheral.shortName : "????") diff --git a/Meshtastic/Views/Settings/Settings.swift b/Meshtastic/Views/Settings/Settings.swift index da96b83d..c2590955 100644 --- a/Meshtastic/Views/Settings/Settings.swift +++ b/Meshtastic/Views/Settings/Settings.swift @@ -134,30 +134,30 @@ struct Settings: View { } label: { Image(systemName: "point.3.connected.trianglepath.dotted") .symbolRenderingMode(.hierarchical) - Text("Range Test (ESP32 Only)") + Text("range.test") } NavigationLink { SerialConfig(node: nodes.first(where: { $0.num == connectedNodeNum })) } label: { Image(systemName: "terminal") .symbolRenderingMode(.hierarchical) - Text("Serial") + Text("serial") } NavigationLink { TelemetryConfig(node: nodes.first(where: { $0.num == connectedNodeNum })) } label: { Image(systemName: "chart.xyaxis.line") .symbolRenderingMode(.hierarchical) - Text("Telemetry (Sensors)") + Text("telemetry") } } - Section(header: Text("Logging")) { + Section(header: Text("logging")) { NavigationLink { MeshLog() } label: { Image(systemName: "list.bullet.rectangle") .symbolRenderingMode(.hierarchical) - Text("Mesh Log") + Text("mesh.log") } NavigationLink { let connectedNode = nodes.first(where: { $0.num == connectedNodeNum }) @@ -165,11 +165,11 @@ struct Settings: View { } label: { Image(systemName: "building.columns") .symbolRenderingMode(.hierarchical) - Text("Admin Message Log") + Text("admin.log") } } - Section(header: Text("About")) { + Section(header: Text("about")) { NavigationLink { @@ -180,10 +180,9 @@ struct Settings: View { Image(systemName: "questionmark.app") .symbolRenderingMode(.hierarchical) - Text("About Meshtastic") + Text("about.meshtastic") } } - } .onAppear { @@ -192,7 +191,7 @@ struct Settings: View { } .listStyle(GroupedListStyle()) - .navigationTitle("Settings") + .navigationTitle("settings") .navigationBarItems(leading: MeshtasticLogo() ) diff --git a/de.lproj/Localizable.strings b/de.lproj/Localizable.strings index c2bbe109..ab527870 100644 --- a/de.lproj/Localizable.strings +++ b/de.lproj/Localizable.strings @@ -5,9 +5,11 @@ Created by Garth Vander Houwen on 12/12/22. */ +"ago"="prije"; "available.radios"="Verfügbare Funkgeräte"; "cancel"="Absagen"; "connected.radio"="Verbundenes Radio"; "delete"="Löschen"; +"heard"="Čuo"; "save"="Speichern"; "unknown.age"="Unbekanntes Alter"; diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index 6fded5ec..fd15778d 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -3,8 +3,13 @@ Meshtastic Copyright(c) Garth Vander Houwen on 12/12/22. - + */ +"about"="About"; +"about.meshtastic"="About Meshtastic"; +"admin"="Admin"; +"admin.log"="Admin Message Log"; +"ago"="ago"; "available.radios"="Available Radios"; "ble.name"="BLE Name"; "bluetooth"="Bluetooth"; @@ -12,6 +17,7 @@ "channels"="Channels (groups)"; "connected.radio"="Connected Radio"; "communicating"="Communicating with device. ."; +"connected"="Currently Connected"; "connecting"="Connecting . ."; "contacts"="Contacts"; "delete"="Delete"; @@ -19,14 +25,25 @@ "distance"="Distance"; "disconnect"="Disconnect"; "firmware.version"="Firmware Version"; +"heard"="Heard"; +"logging"="Logging"; "map"="Mesh Map"; +"mesh.log"="Mesh Log"; "messages"="Messages"; "nodes"="Nodes"; +"no.nodes"="No Meshtastic Nodes Found"; "not.connected"="No device connected"; "preferred.radio"="Preferred Radio"; +"range.test"="Range Test"; +"range.test.config"="Range Test Config"; "save"="Save"; +"serial"="Serial"; +"serial.config"="Serial Config"; "settings"="Settings"; "subscribed"="Subscribed to mesh"; "select.contact"="Select a Contact"; +"select.node"="Select a Node"; "set.region"="Set LoRa Region"; +"telemetry"="Telemetry (Sensors)"; +"telemetry.config"="Telemetry Config"; "unknown.age"="Unknown Age";