Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ let appResources: ResourceFileElements = [
"supacode/AppIcon.icon",
"supacode/Assets.xcassets",
"supacode/notification.wav",
"supacode/Resources/Localizable.xcstrings",
"supacode/Resources/InfoPlist.xcstrings",
]

let appBuildableFolders: [BuildableFolder] = [
Expand Down Expand Up @@ -234,6 +236,8 @@ let project = Project(
settings: .settings(
base: [
"SWIFT_DEFAULT_ACTOR_ISOLATION": "MainActor",
// Extract SwiftUI LocalizedStringKey literals into Localizable.xcstrings at build time.
"SWIFT_EMIT_LOC_STRINGS": "YES",
],
defaultSettings: .essential
)
Expand All @@ -257,6 +261,8 @@ let project = Project(
settings: .settings(
base: [
"SWIFT_DEFAULT_ACTOR_ISOLATION": "MainActor",
// Extract SwiftUI LocalizedStringKey literals into Localizable.xcstrings at build time.
"SWIFT_EMIT_LOC_STRINGS": "YES",
],
defaultSettings: .essential
)
Expand Down Expand Up @@ -303,6 +309,8 @@ let project = Project(
"ENABLE_HARDENED_RUNTIME": "YES",
"LD_RUNPATH_SEARCH_PATHS": "$(inherited) @executable_path/../Frameworks",
"OTHER_LDFLAGS": "$(inherited) -lc++",
// Extract SwiftUI LocalizedStringKey literals into Localizable.xcstrings at build time.
"SWIFT_EMIT_LOC_STRINGS": "YES",
],
debug: [
"CODE_SIGN_ENTITLEMENTS": "supacode/supacodeDebug.entitlements",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ public struct RepositoryScriptsSettingsView: View {
if store.isGitRepository {
LifecycleScriptSection(
text: $store.settings.setupScript,
title: "Setup Script",
subtitle: "Runs once after worktree creation.",
title: String(localized: "Setup Script"),
subtitle: String(localized: "Runs once after worktree creation."),
icon: "truck.box.badge.clock",
iconColor: .blue,
footerExample: "pnpm install"
)
LifecycleScriptSection(
text: $store.settings.archiveScript,
title: "Archive Script",
subtitle: "Runs before a worktree is archived.",
title: String(localized: "Archive Script"),
subtitle: String(localized: "Runs before a worktree is archived."),
icon: "archivebox",
iconColor: .orange,
footerExample: "docker compose down"
)
}
LifecycleScriptSection(
text: $store.settings.deleteScript,
title: "Delete Script",
title: String(localized: "Delete Script"),
subtitle: store.isGitRepository
? "Runs before a worktree is deleted."
: "Runs before this folder is removed from Supacode.",
? String(localized: "Runs before a worktree is deleted.")
: String(localized: "Runs before this folder is removed from Supacode."),
icon: "trash",
iconColor: .red,
footerExample: "docker compose down"
Expand Down
10 changes: 6 additions & 4 deletions SupacodeSettingsShared/Domain/AutomatedActionPolicy.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

/// Controls when automated actions (CLI commands, deeplinks) bypass
/// user confirmation.
public enum AutomatedActionPolicy: String, Codable, Equatable, Sendable, CaseIterable {
Expand All @@ -13,10 +15,10 @@ public enum AutomatedActionPolicy: String, Codable, Equatable, Sendable, CaseIte
/// Human-readable label for the settings picker.
public var displayName: String {
switch self {
case .always: "Always"
case .cliOnly: "CLI Only"
case .deeplinksOnly: "Deeplinks Only"
case .never: "Never"
case .always: String(localized: "Always")
case .cliOnly: String(localized: "CLI Only")
case .deeplinksOnly: String(localized: "Deeplinks Only")
case .never: String(localized: "Never")
}
}

Expand Down
2 changes: 1 addition & 1 deletion SupacodeSettingsShared/Domain/OpenWorktreeAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public enum OpenWorktreeAction: CaseIterable, Identifiable {

public var title: String {
switch self {
case .finder: "Reveal in Finder"
case .finder: String(localized: "Reveal in Finder")
case .editor: "$EDITOR"
case .alacritty: "Alacritty"
case .androidStudio: "Android Studio"
Expand Down
6 changes: 3 additions & 3 deletions SupacodeSettingsShared/Models/AppearanceMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public enum AppearanceMode: String, CaseIterable, Identifiable, Codable, Sendabl
public var title: String {
switch self {
case .system:
return "Auto"
return String(localized: "Auto")
case .light:
return "Light"
return String(localized: "Light")
case .dark:
return "Dark"
return String(localized: "Dark")
}
}

Expand Down
12 changes: 6 additions & 6 deletions SupacodeSettingsShared/Models/ConfirmQuitMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ public nonisolated enum ConfirmQuitMode: String, Codable, CaseIterable, Sendable

public var label: String {
switch self {
case .auto: "Auto"
case .always: "Always"
case .never: "Never"
case .auto: String(localized: "Auto")
case .always: String(localized: "Always")
case .never: String(localized: "Never")
}
}

public var subtitle: String {
switch self {
case .auto:
return "Confirm only when scripts are running or a worktree is being set up, archived, or deleted."
return String(localized: "Confirm only when scripts are running or a worktree is being set up, archived, or deleted.")
case .always:
return "Always confirm before quitting."
return String(localized: "Always confirm before quitting.")
case .never:
return "Quit immediately without confirmation."
return String(localized: "Quit immediately without confirmation.")
}
}
}
14 changes: 8 additions & 6 deletions SupacodeSettingsShared/Models/GlobalSettings.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Foundation

public nonisolated enum AutoDeletePeriod: Int, Codable, CaseIterable, Comparable, Sendable {
#if DEBUG
case immediately = 0
Expand All @@ -11,13 +13,13 @@ public nonisolated enum AutoDeletePeriod: Int, Codable, CaseIterable, Comparable
public var label: String {
switch self {
#if DEBUG
case .immediately: "Immediately (debug)"
case .immediately: String(localized: "Immediately (debug)")
#endif
case .oneDay: "After 1 day"
case .threeDays: "After 3 days"
case .sevenDays: "After 7 days"
case .fourteenDays: "After 14 days"
case .thirtyDays: "After 30 days"
case .oneDay: String(localized: "After 1 day")
case .threeDays: String(localized: "After 3 days")
case .sevenDays: String(localized: "After 7 days")
case .fourteenDays: String(localized: "After 14 days")
case .thirtyDays: String(localized: "After 30 days")
}
}

Expand Down
4 changes: 2 additions & 2 deletions SupacodeSettingsShared/Models/MergedWorktreeAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public nonisolated enum MergedWorktreeAction: String, CaseIterable, Codable, Equ

public var title: String {
switch self {
case .archive: return "Archive"
case .delete: return "Delete"
case .archive: return String(localized: "Archive")
case .delete: return String(localized: "Delete")
}
}
}
2 changes: 1 addition & 1 deletion SupacodeSettingsShared/Models/NotificationSound.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public enum NotificationSound: String, CaseIterable, Identifiable, Codable, Send
public var displayName: String {
switch self {
case .never:
return "Never"
return String(localized: "Never")
case .supacodeClassic:
return "Supacode Classic"
default:
Expand Down
6 changes: 3 additions & 3 deletions SupacodeSettingsShared/Models/PullRequestMergeStrategy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ public nonisolated enum PullRequestMergeStrategy: String, CaseIterable, Codable,
public var title: String {
switch self {
case .merge:
return "Merge"
return String(localized: "Merge")
case .squash:
return "Squash"
return String(localized: "Squash")
case .rebase:
return "Rebase"
return String(localized: "Rebase")
}
}

Expand Down
14 changes: 7 additions & 7 deletions SupacodeSettingsShared/Models/RepositoryColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ public nonisolated enum RepositoryColor: Hashable, Sendable, Codable {
/// Tooltip label used by `ColorSwatchRow`'s predefined swatches.
public var displayName: String {
switch self {
case .red: "Red"
case .orange: "Orange"
case .yellow: "Yellow"
case .green: "Green"
case .teal: "Teal"
case .blue: "Blue"
case .purple: "Purple"
case .red: String(localized: "Red")
case .orange: String(localized: "Orange")
case .yellow: String(localized: "Yellow")
case .green: String(localized: "Green")
case .teal: String(localized: "Teal")
case .blue: String(localized: "Blue")
case .purple: String(localized: "Purple")
case .custom(let hex): hex
}
}
Expand Down
12 changes: 6 additions & 6 deletions SupacodeSettingsShared/Models/ScriptKind.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public enum ScriptKind: String, Codable, CaseIterable, Hashable, Sendable {
/// Default display name shown in UI when the user hasn't provided one.
public nonisolated var defaultName: String {
switch self {
case .run: "Run"
case .test: "Test"
case .deploy: "Deploy"
case .lint: "Lint"
case .format: "Format"
case .custom: "Custom"
case .run: String(localized: "Run")
case .test: String(localized: "Test")
case .deploy: String(localized: "Deploy")
case .lint: String(localized: "Lint")
case .format: String(localized: "Format")
case .custom: String(localized: "Custom")
}
}

Expand Down
Loading
Loading