Skip to content

Commit 2f37438

Browse files
authored
Merge pull request #993 from bjpetit/traceroute-list-name-cleanup
Update traceroute list naming
2 parents 05eb9e0 + 0cec1cb commit 2f37438

File tree

2 files changed

+49
-10
lines changed

2 files changed

+49
-10
lines changed

Localizable.xcstrings

+40-2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@
8484
}
8585
}
8686
},
87+
"%@ - %@" : {
88+
"localizations" : {
89+
"en" : {
90+
"stringUnit" : {
91+
"state" : "new",
92+
"value" : "%1$@ - %2$@"
93+
}
94+
}
95+
}
96+
},
8797
"%@ - %@ - %@" : {
8898
"localizations" : {
8999
"en" : {
@@ -100,12 +110,12 @@
100110
}
101111
}
102112
},
103-
"%@ - %d Hops Towards %d Hops Back" : {
113+
"%@ - %@ Towards %@ Back" : {
104114
"localizations" : {
105115
"en" : {
106116
"stringUnit" : {
107117
"state" : "new",
108-
"value" : "%1$@ - %2$d Hops Towards %3$d Hops Back"
118+
"value" : "%1$@ - %2$@ Towards %3$@ Back"
109119
}
110120
},
111121
"sr" : {
@@ -350,6 +360,34 @@
350360
}
351361
}
352362
},
363+
"%d Hops" : {
364+
"localizations" : {
365+
"en" : {
366+
"variations" : {
367+
"plural" : {
368+
"one" : {
369+
"stringUnit" : {
370+
"state" : "translated",
371+
"value" : "%d Hop"
372+
}
373+
},
374+
"other" : {
375+
"stringUnit" : {
376+
"state" : "new",
377+
"value" : "%d Hops"
378+
}
379+
},
380+
"zero" : {
381+
"stringUnit" : {
382+
"state" : "translated",
383+
"value" : "Direct"
384+
}
385+
}
386+
}
387+
}
388+
}
389+
}
390+
},
353391
"%d%%" : {
354392
"localizations" : {
355393
"sr" : {

Meshtastic/Views/Nodes/TraceRouteLog.swift

+9-8
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,21 @@ struct TraceRouteLog: View {
3737
VStack {
3838
List(node.traceRoutes?.reversed() as? [TraceRouteEntity] ?? [], id: \.self, selection: $selectedRoute) { route in
3939
Label {
40-
if route.response && route.hopsTowards == 0 {
41-
Text("\(route.time?.formatted() ?? "unknown".localized) - Direct")
42-
.font(.caption)
43-
} else if route.response && route.hopsTowards == 1 {
44-
Text("\(route.time?.formatted() ?? "unknown".localized) - 1 Hop")
40+
let routeTime = route.time?.formatted() ?? "unknown".localized
41+
if route.response && route.hopsTowards == route.hopsBack {
42+
let hopString = String(localized: "\(route.hopsTowards) Hops")
43+
Text("\(routeTime) - \(hopString)")
4544
.font(.caption)
4645
} else if route.response {
47-
Text("\(route.time?.formatted() ?? "unknown".localized) - \(route.hopsTowards) Hops Towards \(route.hopsBack) Hops Back")
46+
let hopTowardsString = String(localized: "\(route.hopsTowards) Hops")
47+
let hopBackString = String(localized: "\(route.hopsBack) Hops")
48+
Text("\(routeTime) - \(hopTowardsString) Towards \(hopBackString) Back")
4849
.font(.caption)
4950
} else if route.sent {
50-
Text("\(route.time?.formatted() ?? "unknown".localized) - No Response")
51+
Text("\(routeTime) - No Response")
5152
.font(.caption)
5253
} else {
53-
Text("\(route.time?.formatted() ?? "unknown".localized) - Not Sent")
54+
Text("\(routeTime) - Not Sent")
5455
.font(.caption)
5556
}
5657
} icon: {

0 commit comments

Comments
 (0)