From a2c869ec067cd12c2d0a436f92d0afc75652f552 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Tue, 20 May 2025 21:16:12 -0700 Subject: [PATCH] Fix localization keys merged from community pull requests --- Localizable.xcstrings | 896 ++++-------------- Meshtastic/Enums/RouteEnums.swift | 12 +- Meshtastic/Extensions/String.swift | 2 +- .../Helpers/BLESignalStrengthIndicator.swift | 2 +- Meshtastic/Views/Helpers/BatteryCompact.swift | 4 +- .../RequestPositionButton.swift | 2 +- .../TextMessageField/TextMessageSize.swift | 4 +- .../Views/Nodes/Helpers/NodeListItem.swift | 8 +- 8 files changed, 218 insertions(+), 712 deletions(-) diff --git a/Localizable.xcstrings b/Localizable.xcstrings index b183b5ec..f08588ee 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -4070,6 +4070,7 @@ } }, "Battery Level" : { + "comment" : "VoiceOver label for battery gauge", "localizations" : { "de" : { "stringUnit" : { @@ -4128,6 +4129,7 @@ } }, "Battery Level %" : { + "comment" : "VoiceOver value for battery level", "localizations" : { "it" : { "stringUnit" : { @@ -4183,40 +4185,6 @@ } } }, - "biking" : { - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "biken" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "tour in bicicletta" - } - }, - "sr" : { - "stringUnit" : { - "state" : "translated", - "value" : "тура бициклом" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "自行车旅行" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "自行車" - } - } - } - }, "Biking" : { "localizations" : { "de" : { @@ -4451,6 +4419,129 @@ } } }, + "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" : { @@ -4683,6 +4774,28 @@ } } }, + "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" : { @@ -5037,6 +5150,9 @@ } } }, + "Bytes Used" : { + "comment" : "VoiceOver value for bytes used" + }, "Call Sign" : { "localizations" : { "it" : { @@ -7231,15 +7347,9 @@ }, "Contact URL" : { "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Contact URL" - } - }, "zh-Hant-TW" : { "stringUnit" : { - "state" : "translated", + "state" : "needs_review", "value" : "聯絡人網址" } } @@ -9352,6 +9462,28 @@ } } }, + "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" : { @@ -10252,40 +10384,6 @@ } } }, - "driving" : { - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "fahren" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "guida" - } - }, - "sr" : { - "stringUnit" : { - "state" : "translated", - "value" : "вожња" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "驾驶" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "開車" - } - } - } - }, "Driving" : { "localizations" : { "de" : { @@ -14053,6 +14151,9 @@ } } } + }, + "Hide sidebar" : { + }, "HIGH" : { "localizations" : { @@ -14088,40 +14189,6 @@ } } }, - "hiking" : { - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "wandern" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "escursione" - } - }, - "sr" : { - "stringUnit" : { - "state" : "translated", - "value" : "планинарње" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "徒步" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "登山" - } - } - } - }, "Hiking" : { "localizations" : { "de" : { @@ -17432,16 +17499,6 @@ } } }, - "message" : { - "localizations" : { - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "訊息" - } - } - } - }, "Message" : { "localizations" : { "de" : { @@ -17672,6 +17729,9 @@ } } }, + "Message Size" : { + "comment" : "VoiceOver label for message size" + }, "Message Status Options" : { "localizations" : { "it" : { @@ -21326,34 +21386,6 @@ } } }, - "overlanding" : { - "localizations" : { - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "overland drive" - } - }, - "sr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Вожња преко копна" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "越野" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "開車 (overland drive)" - } - } - } - }, "Overlanding" : { "localizations" : { "it" : { @@ -28939,40 +28971,6 @@ } } }, - "skiing" : { - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "skitour" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "tour sciistico" - } - }, - "sr" : { - "stringUnit" : { - "state" : "translated", - "value" : "ски тура" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "滑雪之旅" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "滑雪" - } - } - } - }, "Skiing" : { "localizations" : { "de" : { @@ -32959,6 +32957,28 @@ } } }, + "unknown" : { + "localizations" : { + "it" : { + "stringUnit" : { + "state" : "needs_review", + "value" : "sconosciuto" + } + }, + "sr" : { + "stringUnit" : { + "state" : "needs_review", + "value" : "непознато" + } + }, + "zh-Hant-TW" : { + "stringUnit" : { + "state" : "needs_review", + "value" : "未知" + } + } + } + }, "Unknown" : { "localizations" : { "fr" : { @@ -34343,40 +34363,6 @@ } } }, - "walk" : { - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "gehen" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "passeggiata" - } - }, - "sr" : { - "stringUnit" : { - "state" : "translated", - "value" : "шетња" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "步行" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "走路" - } - } - } - }, "Walking" : { "localizations" : { "de" : { @@ -35509,485 +35495,7 @@ } } } - }, - "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" : "訊號微弱" - } - } - } - }, - "signal_strength" : { - "comment" : "VoiceOver label for signal strength indicator", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Signalstärke" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Signal strength" - } - }, - "it" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Intensità del segnale" - } - }, - "sr" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Јачина сигнала" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "信号强度" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "訊號強度" - } - } - } - }, - "message_size" : { - "comment" : "VoiceOver label for message size", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Nachrichtengröße" - } - }, - "en" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Message size" - } - }, - "it" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Dimensione messaggio" - } - }, - "sr" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Величина поруке" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "消息大小" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "訊息大小" - } - } - } - }, - "device_charging" : { - "comment" : "VoiceOver value for charging device", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Charging" - } - } - } - }, - "Bluetooth is off.off" : { - "extractionState" : "stale", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Bluetooth ist aus" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Le Bluetooth est arrêté" - } - }, - "he" : { - "stringUnit" : { - "state" : "translated", - "value" : "בלוטוס כבוי" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Il Bluetooth è spento" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Bluetooth jest wyłączony" - } - }, - "se" : { - "stringUnit" : { - "state" : "translated", - "value" : "Bluetooth är avstängt" - } - }, - "sr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Блутут је искључен" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "蓝牙已关闭" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "藍芽已關閉" - } - } - } - }, - "bytes_used" : { - "comment" : "VoiceOver value for bytes used", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "%d von %d Bytes verwendet" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "%d of %d bytes used" - } - }, - "it" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "%d di %d byte usati" - } - }, - "sr" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "%d од %d бајтова искоришћено" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "已用%d/%d字节" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "已用%d/%d位元組" - } - } - } - }, - "heading" : { - "comment" : "Heading label for VoiceOver" - }, - "Hide sidebar" : {}, - "bluetooth.not.connected" : { - "comment" : "VoiceOver label for disconnected Bluetooth icon", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "No Bluetooth device connected" - } - } - } - }, - "device.configuration" : { - "extractionState" : "stale", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Gerätekonfiguration" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Device Configuration" - } - }, - "he" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Device Configuration" - } - }, - "it" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Configurazione del dispositivo" - } - }, - "pl" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Device Configuration" - } - }, - "se" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "Enhetsinställningar" - } - }, - "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.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" : "訊號正常" - } - } - } - }, - "bluetooth.connected" : { - "comment" : "VoiceOver label for connected Bluetooth icon", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Connected to Bluetooth device" - } - } - } - }, - "request_position" : { - "comment" : "VoiceOver label for request position button", - "localizations" : { - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Position anfordern" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Request position" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Richiedi posizione" - } - }, - "sr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Захтевај позицију" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "请求位置" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "translated", - "value" : "請求位置" - } - } - } - }, - "distance" : { - "comment" : "Distance label for VoiceOver" - }, - "device_plugged_in" : { - "comment" : "VoiceOver value for plugged in device", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Plugged in" - } - } - } - }, - "unknown" : { - "localizations" : { - "it" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "sconosciuto" - } - }, - "sr" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "непознато" - } - }, - "zh-Hant-TW" : { - "stringUnit" : { - "state" : "needs_review", - "value" : "未知" - } - } - } } }, "version" : "1.0" -} +} \ No newline at end of file diff --git a/Meshtastic/Enums/RouteEnums.swift b/Meshtastic/Enums/RouteEnums.swift index 06876b4a..95b9c642 100644 --- a/Meshtastic/Enums/RouteEnums.swift +++ b/Meshtastic/Enums/RouteEnums.swift @@ -37,17 +37,17 @@ enum ActivityType: Int, CaseIterable, Identifiable { var fileNameString: String { switch self { case .walking: - return "walk".localized + return "Walking".localized.lowercased() case .hiking: - return "hiking".localized + return "Hiking".localized.lowercased() case .biking: - return "biking".localized + return "Biking".localized.lowercased() case .driving: - return "driving".localized + return "Driving".localized.lowercased() case .overlanding: - return "overlanding".localized + return "Overlanding".localized.lowercased() case .skiing: - return "skiing".localized + return "Skiing".localized.lowercased() } } } diff --git a/Meshtastic/Extensions/String.swift b/Meshtastic/Extensions/String.swift index 6a57da9e..9ade6991 100644 --- a/Meshtastic/Extensions/String.swift +++ b/Meshtastic/Extensions/String.swift @@ -123,7 +123,7 @@ extension String { with: "$1 $2", options: .regularExpression ) - return "Node " + spaced + return "Node".localized + " " + spaced } // Adds variation selectors to prefer the graphical form of emoji. diff --git a/Meshtastic/Views/Helpers/BLESignalStrengthIndicator.swift b/Meshtastic/Views/Helpers/BLESignalStrengthIndicator.swift index 6b0287b0..e8efaf3e 100644 --- a/Meshtastic/Views/Helpers/BLESignalStrengthIndicator.swift +++ b/Meshtastic/Views/Helpers/BLESignalStrengthIndicator.swift @@ -58,7 +58,7 @@ struct SignalStrengthIndicator: View { } } .accessibilityElement(children: .ignore) - .accessibilityLabel(NSLocalizedString("signal_strength", comment: "VoiceOver label for signal strength indicator")) + .accessibilityLabel("Signal strength".localized) .accessibilityValue(accessibilityDescription) } diff --git a/Meshtastic/Views/Helpers/BatteryCompact.swift b/Meshtastic/Views/Helpers/BatteryCompact.swift index bb9819a2..6d31e6af 100644 --- a/Meshtastic/Views/Helpers/BatteryCompact.swift +++ b/Meshtastic/Views/Helpers/BatteryCompact.swift @@ -101,7 +101,7 @@ struct BatteryCompact: View { .accessibilityLabel(NSLocalizedString("Battery Level", comment: "VoiceOver label for battery gauge")) // Set appropriate value based on the battery state using a computed property .accessibilityValue(batteryLevel.map { level in - if level > 100 { + if level > 100 { // Plugged in - same as PWD visual indicator return NSLocalizedString("device_plugged_in", comment: "VoiceOver value for plugged in device") } else if level == 100 { @@ -109,7 +109,7 @@ struct BatteryCompact: View { return NSLocalizedString("device_charging", comment: "VoiceOver value for charging device") } else { // Normal battery level - return String(format: NSLocalizedString("battery_level_percent", comment: "VoiceOver value for battery level"), Int(level)) + return String(format: NSLocalizedString("Battery Level %", comment: "VoiceOver value for battery level"), Int(level)) } } ?? "Unknown") } diff --git a/Meshtastic/Views/Messages/TextMessageField/RequestPositionButton.swift b/Meshtastic/Views/Messages/TextMessageField/RequestPositionButton.swift index fd166f51..fac95a11 100644 --- a/Meshtastic/Views/Messages/TextMessageField/RequestPositionButton.swift +++ b/Meshtastic/Views/Messages/TextMessageField/RequestPositionButton.swift @@ -6,7 +6,7 @@ struct RequestPositionButton: View { var body: some View { Button(action: action) { Image(systemName: "mappin.and.ellipse") - .accessibilityLabel(NSLocalizedString("request_position", comment: "VoiceOver label for request position button")) + .accessibilityLabel("Position Exchange Requested".localized) .symbolRenderingMode(.hierarchical) .imageScale(.large) .foregroundColor(.accentColor) diff --git a/Meshtastic/Views/Messages/TextMessageField/TextMessageSize.swift b/Meshtastic/Views/Messages/TextMessageField/TextMessageSize.swift index 9839e246..c6a0032f 100644 --- a/Meshtastic/Views/Messages/TextMessageField/TextMessageSize.swift +++ b/Meshtastic/Views/Messages/TextMessageField/TextMessageSize.swift @@ -6,8 +6,8 @@ struct TextMessageSize: View { var body: some View { ProgressView("\("Bytes".localized): \(totalBytes) / \(maxbytes)", value: Double(totalBytes), total: Double(maxbytes)) - .accessibilityLabel(NSLocalizedString("message_size", comment: "VoiceOver label for message size")) - .accessibilityValue(String(format: NSLocalizedString("bytes_used", comment: "VoiceOver value for bytes used"), totalBytes, maxbytes)) + .accessibilityLabel(NSLocalizedString("Message Size", comment: "VoiceOver label for message size")) + .accessibilityValue(String(format: NSLocalizedString("Bytes Used", comment: "VoiceOver value for bytes used"), totalBytes, maxbytes)) .frame(width: 130) .padding(5) .font(.subheadline) diff --git a/Meshtastic/Views/Nodes/Helpers/NodeListItem.swift b/Meshtastic/Views/Nodes/Helpers/NodeListItem.swift index 62dd5fd0..a25d9d51 100644 --- a/Meshtastic/Views/Nodes/Helpers/NodeListItem.swift +++ b/Meshtastic/Views/Nodes/Helpers/NodeListItem.swift @@ -20,7 +20,7 @@ struct NodeListItem: View { } else if let longName = node.user?.longName { desc = longName } else { - desc = "unknown node" + desc = "Unknown".localized + " " + "Node".localized } if connected { desc += ", currently connected" @@ -66,14 +66,13 @@ struct NodeListItem: View { distanceFormatter.unitStyle = .medium let formattedDistance = distanceFormatter.string(fromMeters: metersAway) // For VoiceOver, prepend 'Distance' (localized) - desc += ", " + String(format: "%@: %@", NSLocalizedString("distance", comment: "Distance label for VoiceOver"), formattedDistance) - + desc += ", " + String(format: "%@: %@", "Distance".localized, formattedDistance) // Add bearing/heading information for VoiceOver let trueBearing = getBearingBetweenTwoPoints(point1: myCoord, point2: nodeCoord) let heading = Measurement(value: trueBearing, unit: UnitAngle.degrees) let formattedHeading = heading.formatted(.measurement(width: .narrow, numberFormatStyle: .number.precision(.fractionLength(0)))) // Using a direct format without requiring a new localization key - desc += ", " + NSLocalizedString("heading", comment: "Heading label for VoiceOver") + " " + formattedHeading + desc += ", " + "Heading".localized + " " + formattedHeading } // Add signal strength if available if node.snr != 0 && !node.viaMqtt { @@ -99,7 +98,6 @@ struct NodeListItem: View { return desc } - @ObservedObject var node: NodeInfoEntity var connected: Bool var connectedNode: Int64