Localize dashboard labels & fix toggle state#3
Merged
Conversation
- Add localized strings for dashboard fields (Channel, Connected, IP Address, Noise, PHY Mode, Router, SIGNAL STRENGTH, etc.) in Localizable.xcstrings - Bump project version/marketing version in project.pbxproj. - Refactor the quick-toggle to use an ObservableObject (WifiToggleState) so SwiftUI views and the NSMenuItem stay in sync.
Author
|
@joshcalvert47 Before:
After:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fix dashboard localization and Wi-Fi toggle state reactivity
Issues
The technical panel in the modern menu (IP Address, Channel, Router, PHY Mode, Noise, Connected, Signal Strength) was always rendered in English. The Wi-Fi toggle also always appeared "on" when reopening the menu, even when Wi-Fi was disabled.
Technical Dashboard Localization (
NetworkDetailsDashboard)Added
String.Dashboardenum withNSLocalizedString-backed constants for all translatable dashboard labels. Translations for all 18 supported locales were derived from the existing" IP Address: "-style keys (stripping leading spaces and colon) and from"Wi-Fi: Connected". Technical terms (BSSID, SNR) are left untranslated intentionally.Wi-Fi toggle reactivity (
QuickToggleView/ModernToggleMenuItem)PR #1 "Fix Wi-Fi toggle not updating visually when disabled" has not completely fixed the issue.
The toggle was backed by a plain
Boolproperty. SwiftUI has no mechanism to detect when an external change to a plain property occurs, so theNSHostingViewnever re-rendered whenisNetworkCardEnabledchanged.Fix: back the toggle with a
WifiToggleState: ObservableObject(@Published var isOn).QuickToggleViewuses@ObservedObject, so any external write toisOntriggers an automatic re-render.ModernToggleMenuItemexposesupdate(isOn:), called fromisNetworkCardEnabled.willSet.Note about versioning
On macOS, app release versioning generally follows the standard Major.Minor.Patch convention (e.g., 2.3.0).
I think it's a good idea to make this change to the Heliport versions. It's currently version 2.3, build 2.3. The version can change to 2.3.0 and the build to an integer that increments with each compilation in Xcode.