Skip to content

Commit

Permalink
Excluding unwanted strings from translation. (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
alienator88 authored Oct 18, 2024
2 parents adc1462 + 960d080 commit 4c8f39e
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 95 deletions.
28 changes: 0 additions & 28 deletions Pearcleaner/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
@@ -1,39 +1,11 @@
{
"sourceLanguage" : "en",
"strings" : {
"" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "needs_review",
"value" : ""
}
}
},
"shouldTranslate" : false
},
"(Build %@)" : {

},
"/Full/Path/example-1.txt, /Full/Path/example-2.txt" : {

},
"%@" : {
"shouldTranslate" : false
},
"%lld" : {
"shouldTranslate" : false
},
"%lld %@ %lld %@" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "%1$lld %2$@ %3$lld %4$@"
}
}
},
"shouldTranslate" : false
},
"•" : {
"localizations" : {
Expand Down
12 changes: 6 additions & 6 deletions Pearcleaner/Settings/About.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ struct AboutSettingsTab: View {

}
Spacer()
Button(""){
Button {
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/issues/new/choose")!)
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "paperplane", help: String(localized: "View")))

}
Expand All @@ -92,16 +92,16 @@ struct AboutSettingsTab: View {

Text("View project contributors")

DisclosureGroup("", isExpanded: $disclose, content: {
DisclosureGroup(isExpanded: $disclose) {
ScrollView {
LazyVStack(alignment: .leading, spacing: 0) {
ForEach(sponsors) { sponsor in
HStack() {
Text(sponsor.name)
Spacer()
Button(""){
Button {
NSWorkspace.shared.open(sponsor.url)
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "link", help: String(localized: "View")))
.padding(.trailing)
}
Expand All @@ -111,7 +111,7 @@ struct AboutSettingsTab: View {
}
.frame(height: 45)
.padding(5)
})
} label: { EmptyView() }

// Button(action: {
// NSWorkspace.shared.open(URL(string: "https://github.com/sponsors/alienator88")!)
Expand Down
8 changes: 4 additions & 4 deletions Pearcleaner/Settings/Folders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ struct FolderSettingsTab: View {
HStack {
Spacer()
Text("Drop folders above or click to add").opacity(0.5)
Button("") {
Button {
selectFolder()
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "plus.circle", help: String(localized: "Add folder"), size: 16, rotate: true))
Spacer()
}
Expand Down Expand Up @@ -183,9 +183,9 @@ struct FolderSettingsTab: View {
HStack {
Spacer()
Text("Drop files or folders above or click to add").opacity(0.5)
Button("") {
Button {
selectFilesFoldersZ()
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "plus.circle", help: String(localized: "Add file/folder"), size: 16, rotate: true))
Spacer()
}
Expand Down
4 changes: 2 additions & 2 deletions Pearcleaner/Settings/General.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ struct GeneralSettingsTab: View {
}
InfoButton(text: String(localized: "Real size type will show how much actual allocated space the file has on disk.\n\nLogical type shows the binary size. The filesystem can compress and deduplicate sectors on disk, so real size is sometimes smaller(or bigger) than logical size.\n\nFinder size is similar to if you right click > Get Info on a file in Finder, which will show both the logical and real sizes together."))
Spacer()
Picker("", selection: $sizeType) {
Picker(selection: $sizeType) {
Text("Real")
.tag("Real")
Text("Logical")
.tag("Logical")
// Text("Finder")
// .tag("Finder")
}
} label: { EmptyView() }
.buttonStyle(.borderless)

}
Expand Down
6 changes: 3 additions & 3 deletions Pearcleaner/Settings/Interface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ struct InterfaceSettingsTab: View {
})
.toggleStyle(.switch)
.disabled(menubarEnabled)
.help(menubarEnabled ? String(localized: "Disabled when menubar icon is enabled") : String(localized: ""))
.help(menubarEnabled ? String(localized: "Disabled when menubar icon is enabled") : "")
.onChange(of: mini) { newVal in
if mini {
appState.currentView = miniView ? .apps : .empty
Expand Down Expand Up @@ -371,7 +371,7 @@ struct InterfaceSettingsTab: View {
.foregroundStyle(.primary)
}
Spacer()
Picker("", selection: $selectedMenubarIcon) {
Picker(selection: $selectedMenubarIcon) {
ForEach(icons, id: \.self) { icon in
HStack {
Image(systemName: icon)
Expand All @@ -381,7 +381,7 @@ struct InterfaceSettingsTab: View {
.tag(icon)

}
}
} label: { EmptyView() }
.frame(width: 60)
.onChange(of: selectedMenubarIcon) { newValue in
MenuBarExtraManager.shared.swapMenuBarIcon(icon: newValue)
Expand Down
6 changes: 3 additions & 3 deletions Pearcleaner/Settings/SettingsWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct SettingsView: View {
detailView
}
}
.navigationTitle("")
.navigationTitle(Text(verbatim: ""))
.frame(width: 750, height: 620)
}

Expand Down Expand Up @@ -68,9 +68,9 @@ struct SettingsView: View {
Text("v\(Bundle.main.version)").foregroundStyle(.secondary)
.padding(.bottom, 4)

Button("") {
Button {
resetUserDefaults()
}
} label: { EmptyView() }
.buttonStyle(ResetSettingsButtonStyle(isResetting: $isResetting, label: String(localized: "Reset Settings"), help: String(localized: "Reset all settings to default")))
.disabled(isResetting)

Expand Down
12 changes: 6 additions & 6 deletions Pearcleaner/Settings/Update.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ struct UpdateSettingsTab: View {

HStack(alignment: .center, spacing: 20) {

Button(""){
Button {
updater.checkForUpdatesForce(showSheet: false)
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "arrow.uturn.left.circle", label: String(localized: "Refresh"), help: String(localized: "Refresh updater")))


Button(""){
Button {
updater.resetAnnouncementAlert()
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "star", label: String(localized: "Announcement"), help: String(localized: "Show announcements badge again")))


Button(""){
Button {
NSWorkspace.shared.open(URL(string: "https://github.com/alienator88/Pearcleaner/releases")!)
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "link", label: String(localized: "Releases"), help: String(localized: "View releases on GitHub")))
}

Expand Down
22 changes: 11 additions & 11 deletions Pearcleaner/Views/AppSearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct AppSearchView: View {
.popover(isPresented: $showMenu) {
VStack(alignment: .leading) {

Button("") {
Button {
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
// Cycle through all enum cases using `CaseIterable`
if let nextSortOption = SortOption(rawValue: selectedSortOption.rawValue + 1) {
Expand All @@ -105,17 +105,17 @@ struct AppSearchView: View {
showMenu = false
}
}
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "circle.fill", label: "Sorting: \(selectedSortOption.title)", help: "Sort app list alphabetically by name or by size", size: 5))

if mini && !menubarEnabled {
Button("") {
Button {
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
appState.currentView = .empty
appState.appInfo = AppInfo.empty
showPopover = false
}
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "circle.fill", label: "Drop Target", help: "Drop Target", size: 5))
}

Expand Down Expand Up @@ -168,11 +168,11 @@ struct AppSearchView: View {
}
} else if search.isEmpty && (!mini || !menubarEnabled) {

Button("") {
Button {
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
showMenu.toggle()
}
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "line.3.horizontal.decrease.circle", help: selectedSortOption.title, size: 16))
.popover(isPresented: $showMenu, arrowEdge: .bottom) {
VStack(alignment: .leading, spacing: 10) {
Expand All @@ -183,12 +183,12 @@ struct AppSearchView: View {
}
Divider()
ForEach(SortOption.allCases) { option in
Button("") {
Button {
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
selectedSortOption = option
showMenu = false
}
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: selectedSortOption == option ? "circle.inset.filled" : "circle", label: option.title, help: "", size: 5))


Expand Down Expand Up @@ -287,9 +287,9 @@ struct SimpleSearchStyle: TextFieldStyle {
Spacer()

if trash && text != "" {
Button("") {
Button {
text = ""
}
} label: { EmptyView() }
.buttonStyle(SimpleButtonStyle(icon: "delete.left.fill", help: String(localized: "Clear text"), size: 14, padding: padding))
}
}
Expand Down Expand Up @@ -332,7 +332,7 @@ struct SearchBar: View {

var body: some View {
HStack {
TextField("", text: $search)
TextField(text: $search) { EmptyView() }
.textFieldStyle(SimpleSearchStyle(trash: true, text: $search, darker: darker, glass: glass, padding: padding, sidebar: sidebar))
}
}
Expand Down
4 changes: 2 additions & 2 deletions Pearcleaner/Views/AppsListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ struct Header: View {

var body: some View {
HStack {
Text("\(title)").foregroundStyle(.primary).opacity(0.5)
Text(verbatim: "\(title)").foregroundStyle(.primary).opacity(0.5)

Text("\(count)")
Text(verbatim: "\(count)")
.font(.system(size: 10))
.monospacedDigit()
.frame(minWidth: count > 99 ? 30 : 24, minHeight: 17)
Expand Down
Loading

0 comments on commit 4c8f39e

Please sign in to comment.