Skip to content

fix unlocalizable leftovers - #179

Merged
sarensw merged 7 commits into
sarensw:mainfrom
pincetgore:fix/finder-toolbar-localization
Aug 13, 2026
Merged

fix unlocalizable leftovers#179
sarensw merged 7 commits into
sarensw:mainfrom
pincetgore:fix/finder-toolbar-localization

Conversation

@pincetgore

@pincetgore pincetgore commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

After deeper investigation I found some leftovers

Summary

This branch improves localization coverage for user-visible strings and removes raw diagnostic messages from archive operation status text.

Changes

Finder extension

  • Localized the disabled toolbar-menu message shown when no Finder items are selected:
    • Nothing selected
  • Added the English source entry to the Finder extension string catalog.

Permission dialogs

Localized the user-facing text in file and folder access panels:

  • File-access prompt and confirmation button.
  • Folder-access prompt, explanatory message, and confirmation button.

Settings, debug tools, and log export

Localized previously hard-coded UI strings in:

  • Advanced Settings log-export error alert.
  • Debug Settings labels, actions, explanatory text, and export error alert.
  • Quick Look Harness window title, file-picker prompt, toolbar label, and accessibility description.

ArchiveState localization

  • Localized archive operation statuses and the password-protected archive message.
  • Added a dedicated Core Localizable.xcstrings catalog.
  • Registered the catalog as a Core package resource.
  • Updated all affected String(localized:) calls in ArchiveState to use bundle: .module instead of bundle: .main, so Core resolves its strings from its own resource bundle.

Semantic archive-loader status updates

  • Replaced raw EngineStatus.processing text messages with semantic ProcessingActivity values.
  • Updated ArchiveLoader to emit structured activities for:
    • loading and selecting an engine;
    • engine-loaded diagnostics;
    • temporary-directory creation;
    • entries found;
    • extracted entries;
    • split-volume resolution;
    • invalid or missing archive state;
    • tree-building progress.
  • Updated ArchiveState.receiveStatusUpdates to map semantic activities to localized status text at the UI boundary:
    • loading-related activities display localized loading...;
    • tree-building activities display localized building tree....
  • Kept diagnostic values, such as engine names, type identifiers, entry counts, and URLs, as structured activity data instead of exposing them as raw English UI text.
  • Preserved the existing localized .done and .error status handling.

Validation

  • Confirmed no raw message-based EngineStatus.processing emissions remain in Core.
  • Validated both updated string catalogs as JSON.
  • Ran Swift syntax parsing for the modified Core Swift files successfully.
  • Ran git diff --check successfully.

A complete SwiftPM build remains blocked by missing vendored 7-Zip submodule source files in the current checkout.

Summary by CodeRabbit

Localization

  • Added localized text for Finder toolbar states, file and folder access prompts, settings, and archive operations.
  • Improved translation context for clearer, more consistent wording.
  • Added localized archive progress, completion, and error messages, including password-protection errors.
  • Added English localization support for archive module content.

Bug Fixes

  • Replaced the Finder toolbar’s hard-coded empty-selection placeholder with “Nothing selected.”
  • Improved consistency and clarity of progress messages during archive loading, extraction, and saving.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8515aaff-d54b-413c-829d-76e45c410005

📥 Commits

Reviewing files that changed from the base of the PR and between 8f0c0c9 and da05723.

📒 Files selected for processing (4)
  • MacPacker/Core/Constants.swift
  • MacPacker/Core/Sandbox/FolderAccessStore.swift
  • MacPacker/Core/UrlHandling/AppUrlHandler.swift
  • MacPacker/Localizable.xcstrings
🚧 Files skipped from review as they are similar to previous changes (3)
  • MacPacker/Core/UrlHandling/AppUrlHandler.swift
  • MacPacker/Core/Sandbox/FolderAccessStore.swift
  • MacPacker/Localizable.xcstrings

📝 Walkthrough

Walkthrough

The change localizes Finder and macOS interface strings, adds Core localization resources, and replaces archive status messages with typed processing activities.

Changes

Localization and archive status reporting

Layer / File(s) Summary
Finder and macOS UI localization
FinderExtension/..., MacPacker/Core/..., MacPacker/Features/..., MacPacker/Localizable.xcstrings, MacPacker/MacPackerApp.swift
Finder controls, access panels, settings alerts, and UI strings now use localization APIs with translator comments. Development-only views identify strings that should not be translated.
Typed archive processing activities
Modules/Sources/Core/Engine/ArchiveEngine.swift, Modules/Sources/Core/ArchiveLoader.swift
EngineStatus.processing now carries ProcessingActivity. ArchiveLoader reports typed activities for archive loading, extraction, volume handling, and tree building.
Archive status localization and resource wiring
Modules/Sources/Core/ArchiveState.swift, Modules/Sources/Core/Localizable.xcstrings, Modules/Package.swift
Archive operation, progress, completion, loading, tree-building, and error messages now use localized catalog entries. The Core target processes the catalog, and CSevenZip paths are relative to its target path.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to da057

The PR expands localization coverage and keeps archive status messages user-facing and localized; no actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ArchiveLoader
  participant ArchiveEngine
  participant ArchiveState
  ArchiveLoader->>ArchiveEngine: Report ProcessingActivity
  ArchiveEngine->>ArchiveState: Send processing progress and activity
  ArchiveState->>ArchiveState: Convert activity to localized status text
Loading

Possibly related PRs

Suggested reviewers: sarensw

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing remaining user-visible strings that were not localized.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Modules/Sources/Core/ArchiveState.swift`:
- Around line 446-450: Update receiveStatusUpdates so .processing values are not
written directly as raw English statusText; emit semantic status data and
localize it at the UI boundary, preserving diagnostic details separately if
needed. Align ArchiveLoader’s processing emissions (including engine loaded,
entries found, and entry extracted) with this semantic representation, while
keeping the existing localized .done and .error handling.
- Around line 193-194: Update the Core package resources and all localized
status-text calls in ArchiveState, including the password-protected message and
the cited locations, so they resolve through Core’s own resource bundle rather
than bundle: .main. Add or reuse the Core bundle/catalog resource and pass that
bundle to each String(localized:) call, preserving the existing fallback text
and localization comments.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ab625e64-6781-4013-ba5d-4f5a532b215d

📥 Commits

Reviewing files that changed from the base of the PR and between 3de1e7c and 197d2b7.

📒 Files selected for processing (8)
  • FinderExtension/FinderSync.swift
  • FinderExtension/Localizable.xcstrings
  • MacPacker/Core/Sandbox/FolderAccessStore.swift
  • MacPacker/Core/UrlHandling/AppUrlHandler.swift
  • MacPacker/Features/Debug/QuickLookHarnessWindowController.swift
  • MacPacker/Features/Settings/AdvancedSettingsView.swift
  • MacPacker/Features/Settings/DebugSettingsView.swift
  • Modules/Sources/Core/ArchiveState.swift

Comment thread Modules/Sources/Core/ArchiveState.swift Outdated
Comment thread Modules/Sources/Core/ArchiveState.swift Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
Modules/Package.swift (1)

371-372: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Declare the package default localization.

Modules/Package.swift processes a localized Core catalog, but its Package(...) declaration has no defaultLocalization. Add defaultLocalization: "en" so the package declares its development locale consistently for localized resources. Apple documents this manifest setting for localized package resources. (developer.apple.com)

Proposed manifest change
 let package = Package(
     name: "Modules",
+    defaultLocalization: "en",
     platforms: [ .macOS(.v14) ],
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Modules/Package.swift` around lines 371 - 372, Update the Package(...)
declaration in Modules/Package.swift to include defaultLocalization: "en",
preserving the existing localized resource processing and other manifest
settings.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Modules/Package.swift`:
- Around line 371-372: Update the Package(...) declaration in
Modules/Package.swift to include defaultLocalization: "en", preserving the
existing localized resource processing and other manifest settings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fc36b38-6a62-491d-8906-f33b54bf9be0

📥 Commits

Reviewing files that changed from the base of the PR and between 197d2b7 and e8e0911.

📒 Files selected for processing (5)
  • Modules/Package.swift
  • Modules/Sources/Core/ArchiveLoader.swift
  • Modules/Sources/Core/ArchiveState.swift
  • Modules/Sources/Core/Engine/ArchiveEngine.swift
  • Modules/Sources/Core/Localizable.xcstrings
🚧 Files skipped from review as they are similar to previous changes (1)
  • Modules/Sources/Core/ArchiveState.swift

@sarensw

sarensw commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Hi @pincetgore , it took me a while to go through this PR, simply because it doesn't even compile. Changes that eventually become PRs should compile and all tests should be green 😉

Regardless of that, this uncovered an issue that I will fix as part of this PR. So I will hopefully make the necessary changes soon, now that I finally understood what's happening here.

CSevenZip declared `path: "."`, making all of Modules/ its resource
territory. SwiftPM auto-discovers .xcstrings anywhere under a target's
path and flattens resources into a single bundle namespace, so the target
silently absorbed ArchivePreviewUI's catalog. Adding a second catalog for
Core made the basenames collide:

    error: 'modules': multiple resources named 'Localizable.xcstrings'
           in target 'CSevenZip'

Point the target at Sources/CSevenZip and rebase the source list, public
headers path, and header search paths accordingly. Each module now emits
its own resource bundle; CSevenZip emits none.
DebugSettingsView sits behind #if DEBUG and the Quick Look harness is a
development tool, so their labels are not meant for translation. Revert
both to plain strings and remove the keys that had already been extracted
into the app catalog.

What stays localized is the user-facing text this branch set out to fix:
the Finder "Nothing selected" item (now covering all 14 languages), the
file- and folder-access panels, and the Advanced settings export alert.

Also moves the "Open…" translator comment into the source, so the catalog
entry is regenerated from code rather than drifting with whichever call
site was extracted last.
The file- and folder-access panels carried two near-identical strings, so
translators saw the same sentence twice. Collapse them into a single
"%@ needs access to %@" entry and feed the app name from Constants rather
than hard-coding it in the string.
The file panel said "Give access to MacPacker" and the folder panel said
"Grant Access" for the same action. Settle on "Grant Access" for both and
drop the now-unused key.

Also references this PR from the localization changelog entry.
@sarensw
sarensw merged commit 907b7a0 into sarensw:main Aug 13, 2026
5 checks passed
@sarensw

sarensw commented Aug 13, 2026

Copy link
Copy Markdown
Owner

@pincetgore . I have merged the PR now. I have removed a couple of translations, though. They are not customer facing but only for debugging / development purposes. I don't want this to be translated.

@pincetgore
pincetgore deleted the fix/finder-toolbar-localization branch August 13, 2026 10:19
@pincetgore

Copy link
Copy Markdown
Contributor Author

Thank you @sarensw I really appreciate your support and review!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants