Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Count Space's areas in Found without adding them up
Țugui Dragoș4edce43a1711
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex 168947fb..92ecb7e5 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -1952,346 +1952,6 @@}}},- "%@ in ^[%lld area](inflect: true)." : {- "localizations" : {- "cs" : {- "variations" : {- "plural" : {- "few" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ připadá na %lld oblasti."- }- },- "many" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ připadá na %lld oblasti."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ připadá na %lld oblast."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ připadá na %lld oblastí."- }- }- }- }- },- "de" : {- "variations" : {- "plural" : {- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ in %lld Bereich."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ in %lld Bereichen."- }- }- }- }- },- "es" : {- "variations" : {- "plural" : {- "many" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ en %lld de áreas."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ en %lld área."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ en %lld áreas."- }- }- }- }- },- "fr" : {- "variations" : {- "plural" : {- "many" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ dans %lld d’emplacements."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ dans %lld emplacement."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ dans %lld emplacements."- }- }- }- }- },- "it" : {- "variations" : {- "plural" : {- "many" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ in %lld di aree."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ in %lld area."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ in %lld aree."- }- }- }- }- },- "ja" : {- "stringUnit" : {- "state" : "translated",- "value" : "%2$lld個の領域で、合計%1$@です。"- }- },- "ko" : {- "stringUnit" : {- "state" : "translated",- "value" : "영역 %2$lld개, 총 %1$@."- }- },- "nl" : {- "variations" : {- "plural" : {- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ op %lld plek."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ op %lld plekken."- }- }- }- }- },- "pl" : {- "variations" : {- "plural" : {- "few" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ w %lld obszarach."- }- },- "many" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ w %lld obszarach."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ w %lld obszarze."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ w %lld obszaru."- }- }- }- }- },- "pt" : {- "variations" : {- "plural" : {- "many" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ em %lld de áreas."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ em %lld área."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ em %lld áreas."- }- }- }- }- },- "ro" : {- "variations" : {- "plural" : {- "few" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ în %lld zone."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ în %lld zonă."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ în %lld de zone."- }- }- }- }- },- "ru" : {- "variations" : {- "plural" : {- "few" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ в %lld местах."- }- },- "many" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ в %lld местах."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ в %lld месте."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ в %lld места."- }- }- }- }- },- "sv" : {- "variations" : {- "plural" : {- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ i %lld område."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ i %lld områden."- }- }- }- }- },- "tr" : {- "variations" : {- "plural" : {- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%2$lld alanda %1$@."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%2$lld alanda %1$@."- }- }- }- }- },- "uk" : {- "variations" : {- "plural" : {- "few" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ у %lld розташуваннях."- }- },- "many" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ у %lld розташуваннях."- }- },- "one" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ у %lld розташуванні."- }- },- "other" : {- "stringUnit" : {- "state" : "translated",- "value" : "%@ у %lld розташування."- }- }- }- }- },- "zh-Hans" : {- "stringUnit" : {- "state" : "translated",- "value" : "%2$lld个区域,共%1$@。"- }- },- "zh-Hant" : {- "stringUnit" : {- "state" : "translated",- "value" : "%2$lld個區域,共%1$@。"- }- }- }- },"%@ in ^[%lld group](inflect: true)." : {"localizations" : {"cs" : {diff --git a/Peel/Model/FoundLastTimeStore.swift b/Peel/Model/FoundLastTimeStore.swiftindex 42afd75f..196e1a70 100644--- a/Peel/Model/FoundLastTimeStore.swift+++ b/Peel/Model/FoundLastTimeStore.swift@@ -63,8 +63,9 @@ extension HomebrewLibrary {}extension SpaceLibrary {+ /// No size: the areas overlap what Developer and iCloud Drive find, and Space never adds them up.var looked: Looked? {- report.map { Looked(count: $0.items.count, size: SizeTotal(combining: $0.items.map(\.size))) }+ report.map { Looked(count: $0.items.count, size: nil) }}}diff --git a/Peel/Views/ToolSummaries.swift b/Peel/Views/ToolSummaries.swiftindex 595d094a..12580b37 100644--- a/Peel/Views/ToolSummaries.swift+++ b/Peel/Views/ToolSummaries.swift@@ -27,8 +27,7 @@ extension Tool {return total.map { AttributedString(localized: "\($0) in ^[\(count) project](inflect: true).") }?? AttributedString(localized: "^[\(count) project](inflect: true).")case .space:- return total.map { AttributedString(localized: "\($0) in ^[\(count) area](inflect: true).") }- ?? AttributedString(localized: "^[\(count) area](inflect: true).")+ return AttributedString(localized: "^[\(count) area](inflect: true).")case .installers, .cloud, .fileSearch:return total.map { AttributedString(localized: "\($0) in ^[\(count) item](inflect: true).") }?? AttributedString(localized: "^[\(count) item](inflect: true).")@@ -40,9 +39,9 @@ extension Tool {}/// What the tool found in a word or two, for the menu bar panel's Found list: the size when it is known, and- /// otherwise the count.+ /// otherwise the count. Space only counts, since it never adds its areas up.func figure(for looked: Looked) -> String? {- if let size = looked.size, size.known > 0 { return size.text }+ if self != .space, let size = looked.size, size.known > 0 { return size.text }let count = looked.countlet words: AttributedString? = switch self {case .applications, .homebrew: AttributedString(localized: "^[\(count) update](inflect: true)")diff --git a/PeelTests/ToolSummariesTests.swift b/PeelTests/ToolSummariesTests.swiftnew file mode 100644index 00000000..b00a2c0d--- /dev/null+++ b/PeelTests/ToolSummariesTests.swift@@ -0,0 +1,15 @@+import Foundation+@testable import Peel+import PeelCore+import Testing++struct ToolSummariesTests {+ @Test func spaceCountsItsAreasAndNeverAddsThemUp() {+ let looked = Looked(count: 9, size: SizeTotal(known: 180_000_000_000, isComplete: true))+ let areas = AttributedString(localized: "^[\(9) area](inflect: true)")++ #expect(Tool.space.figure(for: looked) == String(areas.characters))+ #expect(Tool.space.sentence(for: looked) == AttributedString(localized: "^[\(9) area](inflect: true)."))+ #expect(Tool.developer.figure(for: looked) == looked.size?.text, "a tool that adds up still shows its total")+ }+}