More localization key

This commit is contained in:
Garth Vander Houwen 2025-05-08 08:59:24 -07:00
parent db680f8cf6
commit d318d960ea
9 changed files with 776 additions and 884 deletions

File diff suppressed because it is too large Load diff

View file

@ -120,15 +120,15 @@ enum SerialModeTypes: Int, CaseIterable, Identifiable {
case .default:
return "Default".localized
case .simple:
return "serial.mode.simple".localized
return "Simple".localized
case .proto:
return "serial.mode.proto".localized
return "Protobufs".localized
case .txtmsg:
return "serial.mode.txtmsg".localized
return "Text Message".localized
case .nmea:
return "serial.mode.nmea".localized
return "NMEA Positions".localized
case .caltopo:
return "serial.mode.caltopo".localized
return "CALTOPO".localized
}
}
func protoEnumValue() -> ModuleConfig.SerialConfig.Serial_Mode {

View file

@ -30,11 +30,11 @@ extension Date {
let hour = Calendar.current.component(.hour, from: self)
switch hour {
case 6..<12: return "relativetimeofday.morning".localized
case 12: return "relativetimeofday.midday".localized
case 13..<17: return "relativetimeofday.afternoon".localized
case 17..<22: return "relativetimeofday.evening".localized
default: return "relativetimeofday.nighttime".localized
case 6..<12: return "Morning".localized
case 12: return "Midday".localized
case 13..<17: return "Afternoon".localized
case 17..<22: return "Evening".localized
default: return "Nighttime".localized
}
}
}

View file

@ -16,7 +16,7 @@ struct MessagesTip: Tip {
Text("Messages")
}
var message: Text? {
Text("tip.messages.message")
Text("You can send and receive channel (group chats) and direct messages. From any message you can long press to see available actions like copy, reply, tapback and delete as well as delivery details.")
}
var image: Image? {
Image(systemName: "bubble.left.and.bubble.right")

View file

@ -194,7 +194,7 @@ struct UserList: View {
}
}
.listStyle(.plain)
.navigationTitle(String.localizedStringWithFormat("contacts %@".localized, String(users.count == 0 ? 0 : users.count)))
.navigationTitle(String.localizedStringWithFormat("Contacts (%@)".localized, String(users.count == 0 ? 0 : users.count)))
.sheet(isPresented: $editingFilters) {
NodeListFilter(filterTitle: "Contact Filters", viaLora: $viaLora, viaMqtt: $viaMqtt, isOnline: $isOnline, isPkiEncrypted: $isPkiEncrypted, isFavorite: $isFavorite, isIgnored: $isIgnored, isEnvironment: $isEnvironment, distanceFilter: $distanceFilter, maximumDistance: $maxDistance, hopsAway: $hopsAway, roleFilter: $roleFilter, deviceRoles: $deviceRoles)
}

View file

@ -44,7 +44,7 @@ struct PaxCounterLog: View {
y: .value("y", (point.wifi + point.ble))
)
}
.accessibilityLabel("paxcounter.total")
.accessibilityLabel("Total PAX")
.accessibilityValue("X: \(point.time!), Y: \(point.wifi + point.ble)")
.foregroundStyle(paxChartColor)
.interpolationMethod(.cardinal)
@ -55,7 +55,7 @@ struct PaxCounterLog: View {
y: .value("y", point.wifi)
)
}
.accessibilityLabel("paxcounter.wifi")
.accessibilityLabel("WiFi")
.accessibilityValue("X: \(point.time!), Y: \(point.wifi)")
.foregroundStyle(wifiChartColor)
@ -65,7 +65,7 @@ struct PaxCounterLog: View {
y: .value("y", point.ble)
)
}
.accessibilityLabel("paxcounter.ble")
.accessibilityLabel("BLE")
.accessibilityValue("X: \(point.time!), Y: \(point.ble)")
.foregroundStyle(bleChartColor)
}
@ -76,9 +76,9 @@ struct PaxCounterLog: View {
.chartXAxis(.automatic)
.chartYScale(domain: 0...maxValue)
.chartForegroundStyleScale([
"paxcounter.ble".localized: .blue,
"paxcounter.wifi".localized: .orange,
"paxcounter.total".localized: .green
"BLE".localized: .blue,
"WiFi".localized: .orange,
"Total PAX".localized: .green
])
.chartLegend(position: .automatic, alignment: .bottom)
}
@ -89,13 +89,13 @@ struct PaxCounterLog: View {
if UIScreen.main.bounds.size.width > 768 && (UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac) {
// Add a table for mac and ipad
Table(pax) {
TableColumn("paxcounter.ble") { pc in
TableColumn("BLE") { pc in
Text("\(pc.ble)")
}
TableColumn("paxcounter.wifi") { pc in
TableColumn("WiFi") { pc in
Text("\(pc.wifi)")
}
TableColumn("paxcounter.total") { pc in
TableColumn("Total PAX") { pc in
Text("\(pc.wifi + pc.ble)")
}
TableColumn("Uptime") { pc in
@ -120,10 +120,10 @@ struct PaxCounterLog: View {
]
LazyVGrid(columns: columns, alignment: .leading, spacing: 1) {
GridRow {
Text("paxcounter.ble")
Text("BLE")
.font(.caption)
.fontWeight(.bold)
Text("paxcounter.wifi")
Text("WiFi")
.font(.caption)
.fontWeight(.bold)
Text("Total")

View file

@ -55,15 +55,15 @@ struct PowerConfig: View {
if currentDevice?.architecture == .esp32 || currentDevice?.architecture == .esp32S3 {
Section {
Toggle(isOn: $adcOverride) {
Text("config.power.adc.override")
Text("ADC Override")
}
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
if adcOverride {
HStack {
Text("config.power.adc.multiplier")
Text("Multiplier")
Spacer()
FloatField(title: "config.power.adc.multiplier", number: $adcMultiplier) {
FloatField(title: "Multiplier", number: $adcMultiplier) {
(2.0 ... 6.0).contains($0)
}
.focused($isFocused)
@ -71,7 +71,7 @@ struct PowerConfig: View {
}
}
} header: {
Text("config.power.section.battery")
Text("Battery")
}
// Section {
// Picker("config.power.wait.bluetooth.secs", selection: $waitBluetoothSecs) {

View file

@ -30,7 +30,7 @@ struct SaveConfigButton: View {
onConfirmation()
}
} message: {
Text("config.save.confirm")
Text("After config values save the node will reboot.")
}
}
}

View file

@ -186,7 +186,7 @@ struct UserConfig: View {
}
}
} message: {
Text("config.save.confirm")
Text("After config values save the node will reboot.")
}
}
Spacer()