Exclude strings from localization by using "verbatim."

This commit is contained in:
Jinyu Meng
2024-10-18 15:32:04 +09:00
parent 94b1292fc6
commit 2b70c885b1
5 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -158,7 +158,7 @@ struct InterfaceSettingsTab: View {
}) })
.toggleStyle(.switch) .toggleStyle(.switch)
.disabled(menubarEnabled) .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 .onChange(of: mini) { newVal in
if mini { if mini {
appState.currentView = miniView ? .apps : .empty appState.currentView = miniView ? .apps : .empty
+1 -1
View File
@@ -28,7 +28,7 @@ struct SettingsView: View {
detailView detailView
} }
} }
.navigationTitle("") .navigationTitle(Text(verbatim: ""))
.frame(width: 750, height: 620) .frame(width: 750, height: 620)
} }
+2 -2
View File
@@ -82,9 +82,9 @@ struct Header: View {
var body: some View { var body: some View {
HStack { 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)) .font(.system(size: 10))
.monospacedDigit() .monospacedDigit()
.frame(minWidth: count > 99 ? 30 : 24, minHeight: 17) .frame(minWidth: count > 99 ? 30 : 24, minHeight: 17)
+11 -11
View File
@@ -109,19 +109,19 @@ struct FilesView: View {
} }
VStack(alignment: .leading) { VStack(alignment: .leading) {
HStack(alignment: .center) { HStack(alignment: .center) {
Text("\(appState.appInfo.appName)").font(.title).fontWeight(.bold).lineLimit(1) Text(verbatim: "\(appState.appInfo.appName)").font(.title).fontWeight(.bold).lineLimit(1)
Image(systemName: "circle.fill").foregroundStyle(Color("AccentColor")).font(.system(size: 5)) Image(systemName: "circle.fill").foregroundStyle(Color("AccentColor")).font(.system(size: 5))
Text("\(appState.appInfo.appVersion)").font(.title3) Text(verbatim: "\(appState.appInfo.appVersion)").font(.title3)
} }
Text("\(appState.appInfo.bundleIdentifier)") Text(verbatim: "\(appState.appInfo.bundleIdentifier)")
.lineLimit(1) .lineLimit(1)
.font(.title3) .font(.title3)
.foregroundStyle((.primary.opacity(0.5))) .foregroundStyle((.primary.opacity(0.5)))
} }
Spacer() Spacer()
Button("\(detailsEnabled ? String(localized: "Hide Details") : String(localized: "Show Details"))") { Button(detailsEnabled ? "Hide Details" : "Show Details") {
withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) { withAnimation(Animation.easeInOut(duration: animationEnabled ? 0.35 : 0)) {
detailsEnabled.toggle() detailsEnabled.toggle()
} }
@@ -135,7 +135,7 @@ struct FilesView: View {
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
Text("Total size of files:") Text("Total size of files:")
.font(.callout).fontWeight(.bold) .font(.callout).fontWeight(.bold)
Text("") Text(verbatim: "")
.font(.footnote) .font(.footnote)
Text("Installed Date:") Text("Installed Date:")
.font(.footnote) .font(.footnote)
@@ -147,9 +147,9 @@ struct FilesView: View {
} }
Spacer() Spacer()
VStack(alignment: .trailing, spacing: 5) { VStack(alignment: .trailing, spacing: 5) {
Text("\(displaySizeTotal)").font(.callout).fontWeight(.bold)//.help("Total size on disk") Text(verbatim: "\(displaySizeTotal)").font(.callout).fontWeight(.bold)//.help("Total size on disk")
Text("\(appState.appInfo.fileSize.count == 1 ? "\(appState.selectedItems.count) \(String(localized: "of")) \(appState.appInfo.fileSize.count) \(String(localized: "item"))" : "\(appState.selectedItems.count) \(String(localized: "of")) \(appState.appInfo.fileSize.count) \(String(localized: "items"))")") Text(verbatim: "\(appState.appInfo.fileSize.count == 1 ? "\(appState.selectedItems.count) \(String(localized: "of")) \(appState.appInfo.fileSize.count) \(String(localized: "item"))" : "\(appState.selectedItems.count) \(String(localized: "of")) \(appState.appInfo.fileSize.count) \(String(localized: "items"))")")
.font(.footnote) .font(.footnote)
if let creationDate = appState.appInfo.creationDate { if let creationDate = appState.appInfo.creationDate {
@@ -341,7 +341,7 @@ struct FilesView: View {
// .padding(.top) // .padding(.top)
Button("\(sizeType == "Logical" ? totalSelectedSize.logical : totalSelectedSize.real)") { Button {
showCustomAlert(enabled: confirmAlert, title: String(localized: "Warning"), message: String(localized: "Are you sure you want to remove these files?"), style: .warning, onOk: { showCustomAlert(enabled: confirmAlert, title: String(localized: "Warning"), message: String(localized: "Are you sure you want to remove these files?"), style: .warning, onOk: {
Task { Task {
@@ -419,8 +419,8 @@ struct FilesView: View {
} }
}) })
} label: {
Text(verbatim: "\(sizeType == "Logical" ? totalSelectedSize.logical : totalSelectedSize.real)")
} }
.buttonStyle(UninstallButton(isEnabled: !appState.selectedItems.isEmpty)) .buttonStyle(UninstallButton(isEnabled: !appState.selectedItems.isEmpty))
.disabled(appState.selectedItems.isEmpty) .disabled(appState.selectedItems.isEmpty)
@@ -555,7 +555,7 @@ struct FileDetailsItem: View {
let displaySize = sizeType == "Real" ? formatByte(size: size!).human : let displaySize = sizeType == "Real" ? formatByte(size: size!).human :
formatByte(size: sizeL!).human formatByte(size: sizeL!).human
Text("\(displaySize)") Text(verbatim: "\(displaySize)")
} }
.contextMenu { .contextMenu {
+6 -6
View File
@@ -105,14 +105,14 @@ struct ZombieView: View {
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
Text("Total size of files:") Text("Total size of files:")
.font(.callout).fontWeight(.bold) .font(.callout).fontWeight(.bold)
Text("") Text(verbatim: "")
.font(.footnote) .font(.footnote)
} }
Spacer() Spacer()
VStack(alignment: .trailing, spacing: 5) { VStack(alignment: .trailing, spacing: 5) {
Text("\(displaySizeTotal)").font(.callout).fontWeight(.bold)//.help("Total size on disk") Text(verbatim: "\(displaySizeTotal)").font(.callout).fontWeight(.bold)//.help("Total size on disk")
Text("\(selectedZombieItemsLocal.count) \(String(localized: "of")) \(searchZ.isEmpty ? appState.zombieFile.fileSize.count : memoizedFiles.count) \(appState.zombieFile.fileSize.count == 1 ? "\(String(localized: "item"))" : "\(String(localized: "items"))")") Text(verbatim: "\(selectedZombieItemsLocal.count) \(String(localized: "of")) \(searchZ.isEmpty ? appState.zombieFile.fileSize.count : memoizedFiles.count) \(appState.zombieFile.fileSize.count == 1 ? "\(String(localized: "item"))" : "\(String(localized: "items"))")")
.font(.footnote).foregroundStyle(.secondary) .font(.footnote).foregroundStyle(.secondary)
} }
@@ -218,7 +218,7 @@ struct ZombieView: View {
} }
.buttonStyle(RescanButton()) .buttonStyle(RescanButton())
Button("\(sizeType == "Logical" ? totalLogicalSizeUninstallBtn : totalRealSizeUninstallBtn)") { Button {
showCustomAlert(enabled: confirmAlert, title: String(localized: "Warning"), message: String(localized: "Are you sure you want to remove these files?"), style: .warning, onOk: { showCustomAlert(enabled: confirmAlert, title: String(localized: "Warning"), message: String(localized: "Are you sure you want to remove these files?"), style: .warning, onOk: {
Task { Task {
@@ -264,7 +264,7 @@ struct ZombieView: View {
}) })
} } label: { Text(verbatim: "\(sizeType == "Logical" ? totalLogicalSizeUninstallBtn : totalRealSizeUninstallBtn)") }
.buttonStyle(UninstallButton(isEnabled: !selectedZombieItemsLocal.isEmpty)) .buttonStyle(UninstallButton(isEnabled: !selectedZombieItemsLocal.isEmpty))
.disabled(selectedZombieItemsLocal.isEmpty) .disabled(selectedZombieItemsLocal.isEmpty)
@@ -486,7 +486,7 @@ struct ZombieFileDetailsItem: View {
let displaySize = sizeType == "Real" ? formatByte(size: size!).human : let displaySize = sizeType == "Real" ? formatByte(size: size!).human :
formatByte(size: sizeL!).human formatByte(size: sizeL!).human
Text("\(displaySize)") Text(verbatim: "\(displaySize)")
} }
.contextMenu { .contextMenu {