Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Say before a move that a plug-in in /Library goes from every account

Țugui Dragoș6e5495cf7bee
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index 6be12fde..8a29c8dd 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -39803,6 +39803,112 @@
}
}
},
+ "Every account on this Mac has it, so moving it takes it from all of them." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Má ho každý účet v tomto Macu, takže jeho přesunutím o něj přijdou všechny účty."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Es ist für jeden Benutzeraccount auf diesem Mac vorhanden, daher wird es durch das Verschieben für alle entfernt."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Todas las cuentas de este Mac lo tienen, así que trasladarlo lo quita de todas ellas."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Tous les comptes de ce Mac en disposent : le déplacer le retire donc à chacun d’eux."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "È disponibile per ogni account di questo Mac, quindi spostarlo lo toglie a tutti."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "このMacのすべてのアカウントで利用できるため、ゴミ箱に入れるとすべてのアカウントから取り除かれます。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "이 Mac의 모든 계정에 있는 항목이므로, 이동하면 모든 계정에서 사라집니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Elke account op deze Mac heeft dit, dus als je het verplaatst, verdwijnt het bij al die accounts."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Ma ją każde konto na tym Macu, więc po przeniesieniu do Kosza zniknie ze wszystkich kont."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Todas as contas deste Mac o têm, então movê-lo o remove de todas elas."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Toate conturile de pe acest Mac îl au, așa că mutarea lui îl elimină pentru toate."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Он есть у каждой учетной записи на этом Mac, поэтому при перемещении он пропадет у всех."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Alla konton på den här datorn har den, så om den flyttas tas den bort från alla konton."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Bu Mac’teki her hesapta bulunur, bu yüzden onu taşımak tüm hesaplardan kaldırır."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Він доступний для всіх облікових записів на цьому Mac, тож переміщення забере його в усіх них."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "这台Mac上的每个账户都有它,因此移动它会使所有账户都失去它。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "這部Mac上的每個帳號都有它,因此移動它會讓所有帳號都失去它。"
+ }
+ }
+ }
+ },
"Every commit is signed with your SSH key, and GitHub shows it as Verified once you add the key there as a signing key." : {
"localizations" : {
"cs" : {
diff --git a/Peel/Views/Plugins/PluginDetailView.swift b/Peel/Views/Plugins/PluginDetailView.swift
index a9e5a564..7c145f3c 100644
--- a/Peel/Views/Plugins/PluginDetailView.swift
+++ b/Peel/Views/Plugins/PluginDetailView.swift
@@ -120,16 +120,7 @@ struct PluginDetailView: View {
}
Button("Cancel", role: .cancel) {}
} message: {
- switch (plugin.isAQuickAction, plugin.staysInTheTrash) {
- case (true, true):
- Text("It leaves the Services menu and Quick Actions, and it may be one someone made in Automator on this Mac. History can’t put it back, since code is loaded from its folder and it isn’t root’s alone, but you can drag it back out in Finder.")
- case (true, false):
- Text("It leaves the Services menu and Quick Actions, and it may be one someone made in Automator on this Mac.")
- case (false, true):
- Text("Apps that use it may stop working. History can’t put it back, since code is loaded from its folder and it isn’t root’s alone, but you can drag it back out in Finder.")
- case (false, false):
- Text("Apps that use it may stop working.")
- }
+ Text(verbatim: plugin.whenMoved.map { String(localized: $0) }.joined(separator: "\n\n"))
}
}
@@ -137,3 +128,25 @@ struct PluginDetailView: View {
plugin.requiresPrivileges && plugin.refusal == nil && !helper.canAct
}
}
+
+extension Plugin {
+ /// What the question before a move says, a paragraph each.
+ var whenMoved: [LocalizedStringResource] {
+ let forAllUsers: [LocalizedStringResource] = isInstalledForAllUsers
+ ? ["Every account on this Mac has it, so moving it takes it from all of them."] : []
+ return whatGoes + forAllUsers
+ }
+
+ private var whatGoes: [LocalizedStringResource] {
+ switch (isAQuickAction, staysInTheTrash) {
+ case (true, true):
+ ["It leaves the Services menu and Quick Actions, and it may be one someone made in Automator on this Mac. History can’t put it back, since code is loaded from its folder and it isn’t root’s alone, but you can drag it back out in Finder."]
+ case (true, false):
+ ["It leaves the Services menu and Quick Actions, and it may be one someone made in Automator on this Mac."]
+ case (false, true):
+ ["Apps that use it may stop working. History can’t put it back, since code is loaded from its folder and it isn’t root’s alone, but you can drag it back out in Finder."]
+ case (false, false):
+ ["Apps that use it may stop working."]
+ }
+ }
+}
diff --git a/PeelTests/PluginTextTests.swift b/PeelTests/PluginTextTests.swift
index 1c519899..1541d7a8 100644
--- a/PeelTests/PluginTextTests.swift
+++ b/PeelTests/PluginTextTests.swift
@@ -26,4 +26,13 @@ struct PluginTextTests {
#expect(Plugin.sayingForAllUsers([mine, everyones, alone]) == [everyones.id])
}
+
+ @Test func saysAMoveTakesAPlugInInLibraryFromEveryAccount() {
+ let mine = plugin("/Users/org.example/Library/Audio/Plug-Ins/Components/Echo.component", name: "Echo")
+ let everyones = plugin("/Library/Audio/Plug-Ins/Components/Echo.component", name: "Echo", forAllUsers: true)
+ let everyAccount = String(localized: "Every account on this Mac has it, so moving it takes it from all of them.")
+
+ #expect(mine.whenMoved.map { String(localized: $0) }.last != everyAccount)
+ #expect(everyones.whenMoved.map { String(localized: $0) }.last == everyAccount)
+ }
}