Skip to content

Free, open-source macOS cleaner. CleanMyMac alternative with zero telemetry. Native SwiftUI, scheduled auto-cleaning, Xcode/Homebrew/system cache cleanup. MIT licensed.

feat: add Chinese (Simplified) localization support

PXLZJdbf8427b74df
diff --git a/PureMac.xcodeproj/project.pbxproj b/PureMac.xcodeproj/project.pbxproj
index a3b90c0..a32874a 100644
--- a/PureMac.xcodeproj/project.pbxproj
+++ b/PureMac.xcodeproj/project.pbxproj
@@ -21,6 +21,7 @@
DDD6BA35DBF32E7A6B5F6F8B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2EA41E1096FA8E3B916AD13 /* Assets.xcassets */; };
EDEF28CAD23E936FBED1783B /* PureMacApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63581B70F9B10231964E3602 /* PureMacApp.swift */; };
F1A2B3C4D5E6F70819203142 /* FullDiskAccessManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1B2C3D4E5F607182930A1B2 /* FullDiskAccessManager.swift */; };
+ AA0000000000000000000004 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = AA0000000000000000000003 /* Localizable.strings */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -41,6 +42,8 @@
B2EA41E1096FA8E3B916AD13 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
C5ADDC35F31E40780FB5D017 /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = "<group>"; };
DD7FDA1B749FFA61DFB52AB5 /* AppViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppViewModel.swift; sourceTree = "<group>"; };
+ AA0000000000000000000001 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
+ AA0000000000000000000002 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
@@ -111,6 +114,7 @@
isa = PBXGroup;
children = (
B2EA41E1096FA8E3B916AD13 /* Assets.xcassets */,
+ AA0000000000000000000003 /* Localizable.strings */,
46660271CFF167AB0FE7371D /* Info.plist */,
5664D2BDAEAA9AE3A53DB364 /* PureMac.entitlements */,
63581B70F9B10231964E3602 /* PureMacApp.swift */,
@@ -125,6 +129,18 @@
};
/* End PBXGroup section */
+/* Begin PBXVariantGroup section */
+ AA0000000000000000000003 /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ AA0000000000000000000001 /* en */,
+ AA0000000000000000000002 /* zh-Hans */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
/* Begin PBXNativeTarget section */
B19E38DEAA0144A77120F39C /* PureMac */ = {
isa = PBXNativeTarget;
@@ -165,6 +181,7 @@
knownRegions = (
Base,
en,
+ "zh-Hans",
);
mainGroup = 13CF0676D0E93925F46C13AA;
minimizedProjectReferenceProxies = 1;
@@ -184,6 +201,7 @@
buildActionMask = 2147483647;
files = (
DDD6BA35DBF32E7A6B5F6F8B /* Assets.xcassets in Resources */,
+ AA0000000000000000000004 /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/PureMac/Models/Models.swift b/PureMac/Models/Models.swift
index 4636364..7603f28 100644
--- a/PureMac/Models/Models.swift
+++ b/PureMac/Models/Models.swift
@@ -159,14 +159,14 @@ struct ScheduleConfig: Codable {
var minimumCleanSize: Int64 = 100 * 1024 * 1024 // 100 MB
var formattedLastRun: String {
- guard let date = lastRunDate else { return "Never" }
+ guard let date = lastRunDate else { return String(localized: "Never") }
let formatter = RelativeDateTimeFormatter()
formatter.unitsStyle = .abbreviated
return formatter.localizedString(for: date, relativeTo: Date())
}
var formattedNextRun: String {
- guard let date = nextRunDate else { return "Not scheduled" }
+ guard let date = nextRunDate else { return String(localized: "Not scheduled") }
let formatter = RelativeDateTimeFormatter()
formatter.unitsStyle = .abbreviated
return formatter.localizedString(for: date, relativeTo: Date())
diff --git a/PureMac/ViewModels/AppViewModel.swift b/PureMac/ViewModels/AppViewModel.swift
index 485b048..7dc0dea 100644
--- a/PureMac/ViewModels/AppViewModel.swift
+++ b/PureMac/ViewModels/AppViewModel.swift
@@ -279,7 +279,8 @@ class AppViewModel: ObservableObject {
private func sendNotification(freed: Int64) {
let content = UNMutableNotificationContent()
content.title = "PureMac"
- content.body = "Found \(ByteCountFormatter.string(fromByteCount: freed, countStyle: .file)) of junk files."
+ let sizeStr = ByteCountFormatter.string(fromByteCount: freed, countStyle: .file)
+ content.body = String(format: NSLocalizedString("Found %@ of junk files.", comment: ""), sizeStr)
content.sound = .default
let request = UNNotificationRequest(
diff --git a/PureMac/Views/CategoryDetailView.swift b/PureMac/Views/CategoryDetailView.swift
index 1422e3c..3f3e965 100644
--- a/PureMac/Views/CategoryDetailView.swift
+++ b/PureMac/Views/CategoryDetailView.swift
@@ -52,11 +52,11 @@ struct CategoryDetailView: View {
}
VStack(alignment: .leading, spacing: 4) {
- Text(category.rawValue)
+ Text(LocalizedStringKey(category.rawValue))
.font(.pmHeadline)
.foregroundColor(.pmTextPrimary)
- Text(category.description)
+ Text(LocalizedStringKey(category.description))
.font(.pmCaption)
.foregroundColor(.pmTextSecondary)
}
diff --git a/PureMac/Views/ContentView.swift b/PureMac/Views/ContentView.swift
index becb6c9..5291a3c 100644
--- a/PureMac/Views/ContentView.swift
+++ b/PureMac/Views/ContentView.swift
@@ -168,7 +168,7 @@ struct TopBarView: View {
Circle()
.fill(Color.pmSuccess)
.frame(width: 6, height: 6)
- Text("Auto-clean: \(vm.scheduler.config.interval.rawValue)")
+ Text("Auto-clean: ") + Text(LocalizedStringKey(vm.scheduler.config.interval.rawValue))
.font(.pmCaption)
.foregroundColor(.pmTextSecondary)
}
diff --git a/PureMac/Views/SettingsView.swift b/PureMac/Views/SettingsView.swift
index f9318ce..47b7162 100644
--- a/PureMac/Views/SettingsView.swift
+++ b/PureMac/Views/SettingsView.swift
@@ -61,7 +61,7 @@ struct ScheduleSettingsTab: View {
set: { vm.scheduler.updateSchedule(interval: $0) }
)) {
ForEach(ScheduleInterval.allCases) { interval in
- Text(interval.rawValue).tag(interval)
+ Text(LocalizedStringKey(interval.rawValue)).tag(interval)
}
}
.pickerStyle(.menu)
diff --git a/PureMac/Views/SidebarView.swift b/PureMac/Views/SidebarView.swift
index 8f6f69c..4001d70 100644
--- a/PureMac/Views/SidebarView.swift
+++ b/PureMac/Views/SidebarView.swift
@@ -144,7 +144,7 @@ struct SidebarItem: View {
// Label
VStack(alignment: .leading, spacing: 2) {
- Text(category.rawValue)
+ Text(LocalizedStringKey(category.rawValue))
.font(.pmBody)
.foregroundColor(isSelected ? .pmTextPrimary : .pmTextSecondary)
.lineLimit(1)
diff --git a/PureMac/Views/SmartScanView.swift b/PureMac/Views/SmartScanView.swift
index 118ce29..2b1d08f 100644
--- a/PureMac/Views/SmartScanView.swift
+++ b/PureMac/Views/SmartScanView.swift
@@ -113,7 +113,7 @@ struct SmartScanView: View {
.foregroundColor(.pmTextPrimary)
.contentTransition(.numericText())
- Text(vm.currentScanCategory)
+ Text(LocalizedStringKey(vm.currentScanCategory))
.font(.pmCaption)
.foregroundColor(.pmTextSecondary)
.lineLimit(1)
@@ -281,7 +281,7 @@ struct SmartScanView: View {
.foregroundColor(result.category.color)
.frame(width: 20)
- Text(result.category.rawValue)
+ Text(LocalizedStringKey(result.category.rawValue))
.font(.pmCaption)
.foregroundColor(.pmTextSecondary)
@@ -535,7 +535,7 @@ struct ResultRow: View {
}
VStack(alignment: .leading, spacing: 2) {
- Text(result.category.rawValue)
+ Text(LocalizedStringKey(result.category.rawValue))
.font(.pmBody)
.foregroundColor(isCategorySelected ? .pmTextPrimary : .pmTextMuted)
@@ -576,7 +576,7 @@ struct ResultRow: View {
// MARK: - Gradient Action Button
struct GradientActionButton: View {
- let title: String
+ let title: LocalizedStringKey
let icon: String
let gradient: LinearGradient
let action: () -> Void
diff --git a/PureMac/en.lproj/Localizable.strings b/PureMac/en.lproj/Localizable.strings
new file mode 100644
index 0000000..17c8f2e
--- /dev/null
+++ b/PureMac/en.lproj/Localizable.strings
@@ -0,0 +1,116 @@
+/* Full Disk Access Banner */
+"Full Disk Access Required" = "Full Disk Access Required";
+"PureMac needs Full Disk Access to scan Trash, Mail, Desktop, Documents, and Homebrew cache." = "PureMac needs Full Disk Access to scan Trash, Mail, Desktop, Documents, and Homebrew cache.";
+"Open Settings" = "Open Settings";
+
+/* Top Bar */
+"Macintosh HD" = "Macintosh HD";
+"%@ free" = "%@ free";
+"Auto-clean: " = "Auto-clean: ";
+
+/* Sidebar */
+"CLEANING" = "CLEANING";
+"Last cleaned: %@" = "Last cleaned: %@";
+
+/* Smart Scan */
+"Smart Scan" = "Smart Scan";
+"Click Scan to start" = "Click Scan to start";
+"Total" = "Total";
+"Used" = "Used";
+"Free" = "Free";
+"Purgeable" = "Purgeable";
+"junk found" = "junk found";
+"Your Mac is clean!" = "Your Mac is clean!";
+"freed up" = "freed up";
+"Cleaning..." = "Cleaning...";
+"Scanning..." = "Scanning...";
+"%lld/%lld items" = "%lld/%lld items";
+
+/* Category Detail */
+"All Clean!" = "All Clean!";
+"No junk files found in this category." = "No junk files found in this category.";
+"Not scanned yet" = "Not scanned yet";
+"Click Scan to analyze this category" = "Click Scan to analyze this category";
+"%lld of %lld selected" = "%lld of %lld selected";
+"Select All" = "Select All";
+"Deselect All" = "Deselect All";
+"%lld items" = "%lld items";
+
+/* Buttons */
+"Scan" = "Scan";
+"Re-scan" = "Re-scan";
+"Scan Again" = "Scan Again";
+"Done" = "Done";
+"Clean (%@)" = "Clean (%@)";
+"Clean %lld items (%@)" = "Clean %lld items (%@)";
+
+/* Settings - Schedule */
+"Schedule" = "Schedule";
+"Automatic Cleaning" = "Automatic Cleaning";
+"Automatically scan and clean your Mac on a schedule" = "Automatically scan and clean your Mac on a schedule";
+"Scan Interval" = "Scan Interval";
+"Automation" = "Automation";
+"Auto-clean after scan" = "Auto-clean after scan";
+"Minimum junk size to trigger clean:" = "Minimum junk size to trigger clean:";
+"50 MB" = "50 MB";
+"100 MB" = "100 MB";
+"250 MB" = "250 MB";
+"500 MB" = "500 MB";
+"1 GB" = "1 GB";
+"Auto-purge purgeable space" = "Auto-purge purgeable space";
+"Show notification on completion" = "Show notification on completion";
+"Status" = "Status";
+"Last run" = "Last run";
+"Next run" = "Next run";
+"Never" = "Never";
+"Not scheduled" = "Not scheduled";
+
+/* Settings - General */
+"General" = "General";
+"App Behavior" = "App Behavior";
+"Launch at login" = "Launch at login";
+"Show in Dock" = "Show in Dock";
+"Show menu bar icon" = "Show menu bar icon";
+"Safety" = "Safety";
+"PureMac will never delete system-critical files. Only caches, logs, temporary files, and user-selected items are removed." = "PureMac will never delete system-critical files. Only caches, logs, temporary files, and user-selected items are removed.";
+
+/* Settings - About */
+"About" = "About";
+"Version 1.0.0" = "Version 1.0.0";
+"A free, open-source Mac cleaning utility.\nKeep your Mac fast, clean, and optimized." = "A free, open-source Mac cleaning utility.\nKeep your Mac fast, clean, and optimized.";
+"GitHub Repository" = "GitHub Repository";
+"MIT License" = "MIT License";
+
+/* Cleaning Categories */
+"System Junk" = "System Junk";
+"User Cache" = "User Cache";
+"Mail Files" = "Mail Files";
+"Trash Bins" = "Trash Bins";
+"Large & Old Files" = "Large & Old Files";
+"Purgeable Space" = "Purgeable Space";
+"Xcode Junk" = "Xcode Junk";
+"Brew Cache" = "Brew Cache";
+
+/* Category Descriptions */
+"Scan everything at once" = "Scan everything at once";
+"System caches, logs, and temporary files" = "System caches, logs, and temporary files";
+"Application caches and browser data" = "Application caches and browser data";
+"Downloaded mail attachments" = "Downloaded mail attachments";
+"Files in your Trash" = "Files in your Trash";
+"Files over 100 MB or older than 1 year" = "Files over 100 MB or older than 1 year";
+"APFS purgeable disk space" = "APFS purgeable disk space";
+"Derived data, archives, and simulators" = "Derived data, archives, and simulators";
+"Homebrew download cache" = "Homebrew download cache";
+
+/* Schedule Intervals */
+"Every Hour" = "Every Hour";
+"Every 3 Hours" = "Every 3 Hours";
+"Every 6 Hours" = "Every 6 Hours";
+"Every 12 Hours" = "Every 12 Hours";
+"Daily" = "Daily";
+"Weekly" = "Weekly";
+"Every 2 Weeks" = "Every 2 Weeks";
+"Monthly" = "Monthly";
+
+/* Notifications */
+"Found %@ of junk files." = "Found %@ of junk files.";
diff --git a/PureMac/zh-Hans.lproj/Localizable.strings b/PureMac/zh-Hans.lproj/Localizable.strings
new file mode 100644
index 0000000..ae2267d
--- /dev/null
+++ b/PureMac/zh-Hans.lproj/Localizable.strings
@@ -0,0 +1,116 @@
+/* Full Disk Access Banner */
+"Full Disk Access Required" = "需要完整磁盘访问权限";
+"PureMac needs Full Disk Access to scan Trash, Mail, Desktop, Documents, and Homebrew cache." = "PureMac 需要完整磁盘访问权限才能扫描废纸篓、邮件、桌面、文稿和 Homebrew 缓存。";
+"Open Settings" = "打开设置";
+
+/* Top Bar */
+"Macintosh HD" = "Macintosh HD";
+"%@ free" = "%@ 可用";
+"Auto-clean: " = "自动清理:";
+
+/* Sidebar */
+"CLEANING" = "清理";
+"Last cleaned: %@" = "上次清理:%@";
+
+/* Smart Scan */
+"Smart Scan" = "智能扫描";
+"Click Scan to start" = "点击扫描开始";
+"Total" = "总计";
+"Used" = "已用";
+"Free" = "可用";
+"Purgeable" = "可清除";
+"junk found" = "垃圾文件";
+"Your Mac is clean!" = "您的 Mac 很干净!";
+"freed up" = "已释放";
+"Cleaning..." = "正在清理...";
+"Scanning..." = "正在扫描...";
+"%lld/%lld items" = "%lld/%lld 个项目";
+
+/* Category Detail */
+"All Clean!" = "全部干净!";
+"No junk files found in this category." = "此类别未发现垃圾文件。";
+"Not scanned yet" = "尚未扫描";
+"Click Scan to analyze this category" = "点击扫描分析此类别";
+"%lld of %lld selected" = "已选 %lld / %lld";
+"Select All" = "全选";
+"Deselect All" = "取消全选";
+"%lld items" = "%lld 个项目";
+
+/* Buttons */
+"Scan" = "扫描";
+"Re-scan" = "重新扫描";
+"Scan Again" = "再次扫描";
+"Done" = "完成";
+"Clean (%@)" = "清理(%@)";
+"Clean %lld items (%@)" = "清理 %lld 个项目(%@)";
+
+/* Settings - Schedule */
+"Schedule" = "计划";
+"Automatic Cleaning" = "自动清理";
+"Automatically scan and clean your Mac on a schedule" = "按计划自动扫描和清理您的 Mac";
+"Scan Interval" = "扫描间隔";
+"Automation" = "自动化";
+"Auto-clean after scan" = "扫描后自动清理";
+"Minimum junk size to trigger clean:" = "触发清理的最小垃圾大小:";
+"50 MB" = "50 MB";
+"100 MB" = "100 MB";
+"250 MB" = "250 MB";
+"500 MB" = "500 MB";
+"1 GB" = "1 GB";
+"Auto-purge purgeable space" = "自动清除可清除空间";
+"Show notification on completion" = "完成时显示通知";
+"Status" = "状态";
+"Last run" = "上次运行";
+"Next run" = "下次运行";
+"Never" = "从未";
+"Not scheduled" = "未计划";
+
+/* Settings - General */
+"General" = "通用";
+"App Behavior" = "应用程序行为";
+"Launch at login" = "登录时启动";
+"Show in Dock" = "在程序坞中显示";
+"Show menu bar icon" = "显示菜单栏图标";
+"Safety" = "安全";
+"PureMac will never delete system-critical files. Only caches, logs, temporary files, and user-selected items are removed." = "PureMac 永远不会删除系统关键文件。只会删除缓存、日志、临时文件和用户选择的项目。";
+
+/* Settings - About */
+"About" = "关于";
+"Version 1.0.0" = "版本 1.0.0";
+"A free, open-source Mac cleaning utility.\nKeep your Mac fast, clean, and optimized." = "免费、开源的 Mac 清理工具。\n让您的 Mac 保持快速、干净和优化。";
+"GitHub Repository" = "GitHub 仓库";
+"MIT License" = "MIT 许可证";
+
+/* Cleaning Categories */
+"System Junk" = "系统垃圾";
+"User Cache" = "用户缓存";
+"Mail Files" = "邮件文件";
+"Trash Bins" = "废纸篓";
+"Large & Old Files" = "大型旧文件";
+"Purgeable Space" = "可清除空间";
+"Xcode Junk" = "Xcode 垃圾";
+"Brew Cache" = "Brew 缓存";
+
+/* Category Descriptions */
+"Scan everything at once" = "一次性扫描所有内容";
+"System caches, logs, and temporary files" = "系统缓存、日志和临时文件";
+"Application caches and browser data" = "应用程序缓存和浏览器数据";
+"Downloaded mail attachments" = "下载的邮件附件";
+"Files in your Trash" = "废纸篓中的文件";
+"Files over 100 MB or older than 1 year" = "超过 100 MB 或一年以上的文件";
+"APFS purgeable disk space" = "APFS 可清除磁盘空间";
+"Derived data, archives, and simulators" = "衍生数据、归档和模拟器";
+"Homebrew download cache" = "Homebrew 下载缓存";
+
+/* Schedule Intervals */
+"Every Hour" = "每小时";
+"Every 3 Hours" = "每 3 小时";
+"Every 6 Hours" = "每 6 小时";
+"Every 12 Hours" = "每 12 小时";
+"Daily" = "每天";
+"Weekly" = "每周";
+"Every 2 Weeks" = "每两周";
+"Monthly" = "每月";
+
+/* Notifications */
+"Found %@ of junk files." = "发现了 %@ 的垃圾文件。";