Skip to content

Modernize Polyglott for current macOS and Swift toolchains#10

Open
Fredmf wants to merge 1 commit into
masterfrom
codex/update-project-for-current-macs
Open

Modernize Polyglott for current macOS and Swift toolchains#10
Fredmf wants to merge 1 commit into
masterfrom
codex/update-project-for-current-macs

Conversation

@Fredmf
Copy link
Copy Markdown
Owner

@Fredmf Fredmf commented Mar 30, 2026

Motivation

  • Bring the project up to date so it builds and runs on modern macOS/Xcode toolchains by replacing deprecated APIs and bumping deployment/Swift versions.
  • Replace legacy Swift 1/2-era patterns (e.g. NSTask, @NSApplicationMain, old NSSpeechSynthesizer attribute access) with current Swift APIs for maintainability.
  • Fix small runtime/asset issues and refresh tests so the project is easier for the community to build and maintain.

Description

  • Rewrote AppDelegate to use @main, Process (instead of NSTask), modern NSStatusBar/status item APIs, updated action signatures, safer optional handling, voice list sorting, and escaped voice-name handling when writing defaults in shell commands (AppDelegate.swift).
  • Updated voice scanning to use current NSSpeechSynthesizer.attributes(forVoice:) keys and to build the menu with modern APIs and selectors; added error logging around shell invocation and removed brittle manual menu-item index management (AppDelegate.swift).
  • Fixed image asset lookup typo and replaced legacy println with modern print in voiceDoc.swift (changed INUK to IN-UK).
  • Modernized unit test file to current XCTest patterns (XCTAssertTrue, measure {}) in polyglottTests/polyglottTests.swift.
  • Bumped Xcode project settings in polyglott.xcodeproj/project.pbxproj: updated LastUpgradeCheck, set MACOSX_DEPLOYMENT_TARGET = 12.0, and added SWIFT_VERSION = 5.0 across relevant build configurations.
  • Added a short note to readme.md announcing the community refresh for current Macs.

Testing

  • plutil -lint polyglott/Info.plist polyglottTests/Info.plist passed with OK for both plists.
  • Attempted to run xcodebuild -list -project polyglott.xcodeproj but xcodebuild is not available in this Linux execution environment, so a full macOS build/test run could not be executed here.
  • Unit test sources were updated to modern APIs but were not executed in this environment due to the lack of Xcode tooling.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant