|
|
@@ -120,7 +120,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
120
|
120
|
private let findJobsButton = HoverableButton()
|
|
121
|
121
|
private let findJobsCTAPill = HoverableView()
|
|
122
|
122
|
private let sendIconView = NSImageView()
|
|
123
|
|
- private let sendLabel = NSTextField(labelWithString: "Send")
|
|
|
123
|
+ private let sendLabel = NSTextField(labelWithString: L("Send"))
|
|
124
|
124
|
private let sendContentStack = NSStackView()
|
|
125
|
125
|
private let findJobsCTAHost = NSView()
|
|
126
|
126
|
private let welcomeHeroHost = NSView()
|
|
|
@@ -129,7 +129,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
129
|
129
|
private let welcomeLogoView = IndeedLogoView(displayHeight: 40, variant: .compact)
|
|
130
|
130
|
private let featureCardsRow = NSStackView()
|
|
131
|
131
|
private enum FeatureShortcut: Int { case role = 0, company = 1, skill = 2 }
|
|
132
|
|
- private let clearChatButton = NSButton(title: "Clear chat", target: nil, action: nil)
|
|
|
132
|
+ private let clearChatButton = NSButton(title: L("Clear chat"), target: nil, action: nil)
|
|
133
|
133
|
private let chatScrollView = NSScrollView()
|
|
134
|
134
|
private let chatDocumentView = JobListingsDocumentView()
|
|
135
|
135
|
private let chatStack = NSStackView()
|
|
|
@@ -141,7 +141,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
141
|
141
|
private let nonHomeTitleLabel = NSTextField(labelWithString: "")
|
|
142
|
142
|
private let nonHomeSubtitleLabel = NSTextField(wrappingLabelWithString: "")
|
|
143
|
143
|
private let savedJobsPageContainer = NSView()
|
|
144
|
|
- private let savedJobsPageTitleLabel = NSTextField(labelWithString: "Saved Jobs")
|
|
|
144
|
+ private let savedJobsPageTitleLabel = NSTextField(labelWithString: L("Saved Jobs"))
|
|
145
|
145
|
private let savedJobsPageSubtitleLabel = NSTextField(wrappingLabelWithString: "")
|
|
146
|
146
|
private let savedJobsScrollView = NSScrollView()
|
|
147
|
147
|
private let savedJobsDocumentView = JobListingsDocumentView()
|
|
|
@@ -193,6 +193,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
193
|
193
|
private weak var sidebarUpgradeButton: HoverableButton?
|
|
194
|
194
|
private var subscriptionObserver: NSObjectProtocol?
|
|
195
|
195
|
private var appearanceObserver: NSObjectProtocol?
|
|
|
196
|
+ private var languageObserver: NSObjectProtocol?
|
|
196
|
197
|
/// Retains the system share picker until the user picks a destination or dismisses the menu.
|
|
197
|
198
|
private var appSharePicker: NSSharingServicePicker?
|
|
198
|
199
|
|
|
|
@@ -226,6 +227,9 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
226
|
227
|
if let appearanceObserver {
|
|
227
|
228
|
NotificationCenter.default.removeObserver(appearanceObserver)
|
|
228
|
229
|
}
|
|
|
230
|
+ if let languageObserver {
|
|
|
231
|
+ NotificationCenter.default.removeObserver(languageObserver)
|
|
|
232
|
+ }
|
|
229
|
233
|
}
|
|
230
|
234
|
|
|
231
|
235
|
override func viewDidChangeEffectiveAppearance() {
|
|
|
@@ -241,6 +245,103 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
241
|
245
|
) { [weak self] _ in
|
|
242
|
246
|
self?.applyCurrentAppearance()
|
|
243
|
247
|
}
|
|
|
248
|
+ languageObserver = NotificationCenter.default.addObserver(
|
|
|
249
|
+ forName: AppLanguageManager.didChangeNotification,
|
|
|
250
|
+ object: nil,
|
|
|
251
|
+ queue: .main
|
|
|
252
|
+ ) { [weak self] _ in
|
|
|
253
|
+ self?.refreshLocalizedStrings()
|
|
|
254
|
+ }
|
|
|
255
|
+ }
|
|
|
256
|
+
|
|
|
257
|
+ private func refreshLocalizedStrings() {
|
|
|
258
|
+ greetingLabel.stringValue = L("Welcome")
|
|
|
259
|
+ subtitleLabel.stringValue = L("Find your perfect job with the power of AI.")
|
|
|
260
|
+ sendLabel.stringValue = L("Send")
|
|
|
261
|
+ clearChatButton.title = L("Clear chat")
|
|
|
262
|
+ clearChatButton.toolTip = L("Remove all messages and start a new conversation")
|
|
|
263
|
+ savedJobsPageTitleLabel.stringValue = L("Saved Jobs")
|
|
|
264
|
+ nonHomeSubtitleLabel.stringValue = L("This area is not available in the preview build. Use Home to search jobs.")
|
|
|
265
|
+
|
|
|
266
|
+ jobKeywordsField.placeholderAttributedString = NSAttributedString(
|
|
|
267
|
+ string: L("Ask for roles, skills, salary, or job descriptions..."),
|
|
|
268
|
+ attributes: [
|
|
|
269
|
+ .foregroundColor: Theme.secondaryText,
|
|
|
270
|
+ .font: NSFont.systemFont(ofSize: 14, weight: .regular)
|
|
|
271
|
+ ]
|
|
|
272
|
+ )
|
|
|
273
|
+ jobSearchIcon.setAccessibilityLabel(L("Ask AI"))
|
|
|
274
|
+ findJobsButton.setAccessibilityLabel(L("Send"))
|
|
|
275
|
+
|
|
|
276
|
+ appearanceModeSegment?.setLabel(L("System"), forSegment: 0)
|
|
|
277
|
+ appearanceModeSegment?.setLabel(L("Light"), forSegment: 1)
|
|
|
278
|
+ appearanceModeSegment?.setLabel(L("Dark"), forSegment: 2)
|
|
|
279
|
+
|
|
|
280
|
+ refreshLanguagePopUp()
|
|
|
281
|
+ refreshSettingsLocalizedLabels()
|
|
|
282
|
+ refreshSidebarItemTitles()
|
|
|
283
|
+ updateFreeJobSearchQuotaLabel()
|
|
|
284
|
+ applyProSubscriptionToSidebar()
|
|
|
285
|
+ configureSidebar()
|
|
|
286
|
+ reloadSavedJobsListings()
|
|
|
287
|
+ rebuildFeatureShortcutCards()
|
|
|
288
|
+ trailingLoadMoreJobsButton?.title = L("Show more jobs")
|
|
|
289
|
+ }
|
|
|
290
|
+
|
|
|
291
|
+ private func refreshSidebarItemTitles() {
|
|
|
292
|
+ currentSidebarItems = currentSidebarItems.map { item in
|
|
|
293
|
+ SidebarItem(
|
|
|
294
|
+ title: localizedSidebarTitle(forSystemImage: item.systemImage),
|
|
|
295
|
+ systemImage: item.systemImage,
|
|
|
296
|
+ badge: item.badge
|
|
|
297
|
+ )
|
|
|
298
|
+ }
|
|
|
299
|
+ }
|
|
|
300
|
+
|
|
|
301
|
+ private func localizedSidebarTitle(forSystemImage systemImage: String) -> String {
|
|
|
302
|
+ switch systemImage {
|
|
|
303
|
+ case "house.fill":
|
|
|
304
|
+ return L("Home")
|
|
|
305
|
+ case "heart":
|
|
|
306
|
+ return L("Saved Jobs")
|
|
|
307
|
+ case "doc.text":
|
|
|
308
|
+ return L("CV Maker")
|
|
|
309
|
+ case "person":
|
|
|
310
|
+ return L("Profile")
|
|
|
311
|
+ case "gearshape":
|
|
|
312
|
+ return L("Settings")
|
|
|
313
|
+ default:
|
|
|
314
|
+ return L("Home")
|
|
|
315
|
+ }
|
|
|
316
|
+ }
|
|
|
317
|
+
|
|
|
318
|
+ private func refreshLanguagePopUp() {
|
|
|
319
|
+ guard let popup = languagePopUp else { return }
|
|
|
320
|
+ let selectedCode = AppLanguageManager.shared.current.localeIdentifier
|
|
|
321
|
+ popup.removeAllItems()
|
|
|
322
|
+ for language in AppLanguage.allCases {
|
|
|
323
|
+ popup.addItem(withTitle: language.localizedDisplayName)
|
|
|
324
|
+ popup.lastItem?.representedObject = language.localeIdentifier
|
|
|
325
|
+ }
|
|
|
326
|
+ if let index = AppLanguage.allCases.firstIndex(where: { $0.localeIdentifier == selectedCode }) {
|
|
|
327
|
+ popup.selectItem(at: index)
|
|
|
328
|
+ }
|
|
|
329
|
+ popup.isEnabled = !AppLanguage.allCases.isEmpty
|
|
|
330
|
+ }
|
|
|
331
|
+
|
|
|
332
|
+ private func refreshSettingsLocalizedLabels() {
|
|
|
333
|
+ for view in settingsPageContainer.subviewsRecursive() {
|
|
|
334
|
+ guard let rawID = view.identifier?.rawValue else { continue }
|
|
|
335
|
+ let sectionPrefix = SettingsAppearanceID.sectionHeader + "."
|
|
|
336
|
+ let rowPrefix = SettingsAppearanceID.rowTitle + "."
|
|
|
337
|
+ if rawID.hasPrefix(sectionPrefix) {
|
|
|
338
|
+ let key = String(rawID.dropFirst(sectionPrefix.count))
|
|
|
339
|
+ (view as? NSTextField)?.stringValue = L(key)
|
|
|
340
|
+ } else if rawID.hasPrefix(rowPrefix) {
|
|
|
341
|
+ let key = String(rawID.dropFirst(rowPrefix.count))
|
|
|
342
|
+ (view as? NSTextField)?.stringValue = L(key)
|
|
|
343
|
+ }
|
|
|
344
|
+ }
|
|
244
|
345
|
}
|
|
245
|
346
|
|
|
246
|
347
|
override func viewDidMoveToWindow() {
|
|
|
@@ -262,7 +363,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
262
|
363
|
|
|
263
|
364
|
func render(_ data: DashboardData) {
|
|
264
|
365
|
dismissIndeedJobBrowserEmbedded()
|
|
265
|
|
- greetingLabel.stringValue = "Welcome"
|
|
|
366
|
+ greetingLabel.stringValue = L("Welcome")
|
|
266
|
367
|
subtitleLabel.stringValue = data.subtitle
|
|
267
|
368
|
currentSidebarItems = data.sidebarItems
|
|
268
|
369
|
if selectedSidebarIndex >= currentSidebarItems.count {
|
|
|
@@ -303,7 +404,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
303
|
404
|
searchCard.layer?.borderColor = (searchHovering ? Theme.searchBarBorderHover : Theme.searchBarBorder).cgColor
|
|
304
|
405
|
jobKeywordsField.textColor = Theme.primaryText
|
|
305
|
406
|
jobKeywordsField.placeholderAttributedString = NSAttributedString(
|
|
306
|
|
- string: "Ask for roles, skills, salary, or job descriptions...",
|
|
|
407
|
+ string: L("Ask for roles, skills, salary, or job descriptions..."),
|
|
307
|
408
|
attributes: [
|
|
308
|
409
|
.foregroundColor: Theme.secondaryText,
|
|
309
|
410
|
.font: NSFont.systemFont(ofSize: 14, weight: .regular)
|
|
|
@@ -318,11 +419,11 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
318
|
419
|
|
|
319
|
420
|
appearanceModeSegment?.selectedSegment = AppAppearanceManager.shared.mode.segmentIndex
|
|
320
|
421
|
if let langPopUp = languagePopUp {
|
|
321
|
|
- let saved = UserDefaults.standard.string(forKey: Self.languageUserDefaultsKey) ?? "en"
|
|
322
|
|
- if let index = Self.supportedLanguages.firstIndex(where: { $0.code == saved }) {
|
|
|
422
|
+ let saved = AppLanguageManager.shared.current.localeIdentifier
|
|
|
423
|
+ if let index = AppLanguage.allCases.firstIndex(where: { $0.localeIdentifier == saved }) {
|
|
323
|
424
|
langPopUp.selectItem(at: index)
|
|
324
|
425
|
}
|
|
325
|
|
- langPopUp.isEnabled = !Self.supportedLanguages.isEmpty
|
|
|
426
|
+ langPopUp.isEnabled = !AppLanguage.allCases.isEmpty
|
|
326
|
427
|
}
|
|
327
|
428
|
cvMakerPageView.applyCurrentAppearance()
|
|
328
|
429
|
profilesListPageView.applyCurrentAppearance()
|
|
|
@@ -340,7 +441,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
340
|
441
|
|
|
341
|
442
|
private func refreshSettingsPageAppearance(in root: NSView) {
|
|
342
|
443
|
for view in root.subviewsRecursive() {
|
|
343
|
|
- switch view.identifier?.rawValue {
|
|
|
444
|
+ guard let rawID = view.identifier?.rawValue else { continue }
|
|
|
445
|
+ switch rawID {
|
|
344
|
446
|
case SettingsAppearanceID.section:
|
|
345
|
447
|
view.layer?.backgroundColor = Theme.settingsGroupBackground.cgColor
|
|
346
|
448
|
view.layer?.borderColor = Theme.border.cgColor
|
|
|
@@ -351,12 +453,12 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
351
|
453
|
for case let icon as NSImageView in view.subviews {
|
|
352
|
454
|
icon.contentTintColor = Theme.brandBlue
|
|
353
|
455
|
}
|
|
354
|
|
- case SettingsAppearanceID.sectionHeader:
|
|
355
|
|
- (view as? NSTextField)?.textColor = Theme.secondaryText
|
|
356
|
|
- case SettingsAppearanceID.rowTitle:
|
|
357
|
|
- (view as? NSTextField)?.textColor = Theme.primaryText
|
|
358
|
456
|
default:
|
|
359
|
|
- break
|
|
|
457
|
+ if rawID.hasPrefix(SettingsAppearanceID.sectionHeader + ".") {
|
|
|
458
|
+ (view as? NSTextField)?.textColor = Theme.secondaryText
|
|
|
459
|
+ } else if rawID.hasPrefix(SettingsAppearanceID.rowTitle + ".") {
|
|
|
460
|
+ (view as? NSTextField)?.textColor = Theme.primaryText
|
|
|
461
|
+ }
|
|
360
|
462
|
}
|
|
361
|
463
|
}
|
|
362
|
464
|
}
|
|
|
@@ -524,7 +626,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
524
|
626
|
clearChatButton.font = .systemFont(ofSize: 12, weight: .medium)
|
|
525
|
627
|
clearChatButton.target = self
|
|
526
|
628
|
clearChatButton.action = #selector(didTapClearChat)
|
|
527
|
|
- clearChatButton.toolTip = "Remove all messages and start a new conversation"
|
|
|
629
|
+ clearChatButton.toolTip = L("Remove all messages and start a new conversation")
|
|
528
|
630
|
clearChatButton.setContentHuggingPriority(.required, for: .horizontal)
|
|
529
|
631
|
chatHeaderRow.addArrangedSubview(chatHeaderLeadingSpacer)
|
|
530
|
632
|
chatHeaderRow.addArrangedSubview(clearChatButton)
|
|
|
@@ -589,6 +691,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
589
|
691
|
welcomeHeroContent.widthAnchor.constraint(equalTo: mainOverlay.widthAnchor, constant: -32)
|
|
590
|
692
|
])
|
|
591
|
693
|
registerSubscriptionObserverOnce()
|
|
|
694
|
+ refreshLocalizedStrings()
|
|
592
|
695
|
}
|
|
593
|
696
|
|
|
594
|
697
|
private func registerSubscriptionObserverOnce() {
|
|
|
@@ -612,15 +715,15 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
612
|
715
|
|
|
613
|
716
|
let descriptionWidth: CGFloat = 158
|
|
614
|
717
|
if active {
|
|
615
|
|
- headline.stringValue = "You're on Pro"
|
|
616
|
|
- upgradeDescription.stringValue = "Manage billing, renewals, and plans in Premium."
|
|
|
718
|
+ headline.stringValue = L("You're on Pro")
|
|
|
719
|
+ upgradeDescription.stringValue = L("Manage billing, renewals, and plans in Premium.")
|
|
617
|
720
|
upgradeDescription.preferredMaxLayoutWidth = descriptionWidth
|
|
618
|
|
- upgradeButton.title = "Manage Subscription"
|
|
|
721
|
+ upgradeButton.title = L("Manage Subscription")
|
|
619
|
722
|
} else {
|
|
620
|
|
- headline.stringValue = "Upgrade to Pro"
|
|
621
|
|
- upgradeDescription.stringValue = "Unlimited AI matches, smart alerts, and interview prep—all in one place."
|
|
|
723
|
+ headline.stringValue = L("Upgrade to Pro")
|
|
|
724
|
+ upgradeDescription.stringValue = L("Unlimited AI matches, smart alerts, and interview prep—all in one place.")
|
|
622
|
725
|
upgradeDescription.preferredMaxLayoutWidth = descriptionWidth
|
|
623
|
|
- upgradeButton.title = "Try Pro"
|
|
|
726
|
+ upgradeButton.title = L("Try Pro")
|
|
624
|
727
|
}
|
|
625
|
728
|
updateFreeJobSearchQuotaLabel()
|
|
626
|
729
|
}
|
|
|
@@ -635,8 +738,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
635
|
738
|
let remaining = FreeTierJobSearchQuota.remainingUserMessages(isProActive: false)
|
|
636
|
739
|
freeJobSearchQuotaLabel.isHidden = false
|
|
637
|
740
|
freeJobSearchQuotaLabel.stringValue = remaining == 1
|
|
638
|
|
- ? "1 reply left"
|
|
639
|
|
- : "\(remaining) replies left"
|
|
|
741
|
+ ? L("1 reply left")
|
|
|
742
|
+ : String(format: L("%d replies left"), remaining)
|
|
640
|
743
|
}
|
|
641
|
744
|
|
|
642
|
745
|
/// Returns `false` and presents the paywall when the user does not have an active Pro subscription.
|
|
|
@@ -696,7 +799,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
696
|
799
|
featureCardsRow.alignment = .top
|
|
697
|
800
|
featureCardsRow.translatesAutoresizingMaskIntoConstraints = false
|
|
698
|
801
|
|
|
699
|
|
- let specs: [(symbol: String, title: String, subtitle: String, action: Selector)] = [
|
|
|
802
|
+ let specs: [(symbol: String, titleKey: String, subtitleKey: String, action: Selector)] = [
|
|
700
|
803
|
("briefcase", "Role", "Explore similar or better job roles", #selector(didTapFeatureRole)),
|
|
701
|
804
|
("building.2", "Company", "Find opportunities at other companies", #selector(didTapFeatureCompany)),
|
|
702
|
805
|
("chevron.left.forwardslash.chevron.right", "Skill", "Match jobs that fit your skills", #selector(didTapFeatureSkill))
|
|
|
@@ -704,8 +807,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
704
|
807
|
for spec in specs {
|
|
705
|
808
|
let card = FeatureShortcutCardView(
|
|
706
|
809
|
symbolName: spec.symbol,
|
|
707
|
|
- title: spec.title,
|
|
708
|
|
- subtitle: spec.subtitle,
|
|
|
810
|
+ title: L(spec.titleKey),
|
|
|
811
|
+ subtitle: L(spec.subtitleKey),
|
|
709
|
812
|
target: self,
|
|
710
|
813
|
action: spec.action
|
|
711
|
814
|
)
|
|
|
@@ -841,7 +944,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
841
|
944
|
|
|
842
|
945
|
private func jobListingHostSubtitle(_ job: JobListing) -> String {
|
|
843
|
946
|
guard let raw = job.url, let url = URL(string: raw), let host = url.host?.lowercased() else {
|
|
844
|
|
- return "Indeed"
|
|
|
947
|
+ return L("Indeed")
|
|
845
|
948
|
}
|
|
846
|
949
|
if host.hasPrefix("www.") {
|
|
847
|
950
|
return String(host.dropFirst(4))
|
|
|
@@ -943,7 +1046,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
943
|
1046
|
descriptionField.tag = 502
|
|
944
|
1047
|
descriptionField.translatesAutoresizingMaskIntoConstraints = false
|
|
945
|
1048
|
|
|
946
|
|
- let applyButton = JobPayloadButton(title: "Apply", target: self, action: #selector(didTapJobApply(_:)))
|
|
|
1049
|
+ let applyButton = JobPayloadButton(title: L("Apply"), target: self, action: #selector(didTapJobApply(_:)))
|
|
947
|
1050
|
applyButton.jobPayload = job
|
|
948
|
1051
|
applyButton.cardContext = context
|
|
949
|
1052
|
applyButton.isBordered = false
|
|
|
@@ -962,7 +1065,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
962
|
1065
|
applyButton.setContentCompressionResistancePriority(.required, for: .horizontal)
|
|
963
|
1066
|
|
|
964
|
1067
|
let savedOn = isJobSaved(job)
|
|
965
|
|
- let savedButton = SaveJobPayloadButton(title: savedOn ? "Saved" : "Save", target: self, action: #selector(didTapJobSaved(_:)))
|
|
|
1068
|
+ let savedButton = SaveJobPayloadButton(title: savedOn ? L("Saved") : L("Save"), target: self, action: #selector(didTapJobSaved(_:)))
|
|
966
|
1069
|
savedButton.jobPayload = job
|
|
967
|
1070
|
savedButton.cardContext = context
|
|
968
|
1071
|
savedButton.setButtonType(.toggle)
|
|
|
@@ -986,7 +1089,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
986
|
1089
|
let dismissButton = JobPayloadButton()
|
|
987
|
1090
|
dismissButton.jobPayload = job
|
|
988
|
1091
|
dismissButton.cardContext = context
|
|
989
|
|
- dismissButton.image = NSImage(systemSymbolName: "xmark", accessibilityDescription: "Dismiss")
|
|
|
1092
|
+ dismissButton.image = NSImage(systemSymbolName: "xmark", accessibilityDescription: L("Dismiss"))
|
|
990
|
1093
|
dismissButton.imagePosition = .imageOnly
|
|
991
|
1094
|
dismissButton.imageScaling = .scaleProportionallyDown
|
|
992
|
1095
|
dismissButton.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 12, weight: .semibold)
|
|
|
@@ -995,7 +1098,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
995
|
1098
|
dismissButton.contentTintColor = Theme.secondaryText
|
|
996
|
1099
|
dismissButton.target = self
|
|
997
|
1100
|
dismissButton.action = #selector(didTapJobDismiss(_:))
|
|
998
|
|
- dismissButton.toolTip = context == .savedJobsPage ? "Remove from saved" : "Dismiss"
|
|
|
1101
|
+ dismissButton.toolTip = context == .savedJobsPage ? L("Remove from saved") : L("Dismiss")
|
|
999
|
1102
|
dismissButton.focusRingType = .none
|
|
1000
|
1103
|
dismissButton.wantsLayer = true
|
|
1001
|
1104
|
dismissButton.layer?.cornerRadius = 8
|
|
|
@@ -1199,7 +1302,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1199
|
1302
|
let willSave = !isJobSaved(job)
|
|
1200
|
1303
|
applySavedState(willSave, for: job)
|
|
1201
|
1304
|
sender.state = willSave ? .on : .off
|
|
1202
|
|
- sender.title = willSave ? "Saved" : "Save"
|
|
|
1305
|
+ sender.title = willSave ? L("Saved") : L("Save")
|
|
1203
|
1306
|
sender.image = NSImage(systemSymbolName: willSave ? "heart.fill" : "heart", accessibilityDescription: nil)
|
|
1204
|
1307
|
styleJobSavedButton(sender)
|
|
1205
|
1308
|
if isSavedJobsSidebarIndex(selectedSidebarIndex) {
|
|
|
@@ -1313,10 +1416,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1313
|
1416
|
|
|
1314
|
1417
|
jobSearchIcon.translatesAutoresizingMaskIntoConstraints = false
|
|
1315
|
1418
|
jobSearchIcon.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 16, weight: .semibold)
|
|
1316
|
|
- jobSearchIcon.image = NSImage(systemSymbolName: "sparkles", accessibilityDescription: "Ask AI")
|
|
|
1419
|
+ jobSearchIcon.image = NSImage(systemSymbolName: "sparkles", accessibilityDescription: L("Ask AI"))
|
|
1317
|
1420
|
jobSearchIcon.contentTintColor = Theme.brandBlue
|
|
1318
|
1421
|
|
|
1319
|
|
- configureField(jobKeywordsField, placeholder: "Ask for roles, skills, salary, or job descriptions...")
|
|
|
1422
|
+ configureField(jobKeywordsField, placeholder: L("Ask for roles, skills, salary, or job descriptions..."))
|
|
1320
|
1423
|
|
|
1321
|
1424
|
let ctaHeight: CGFloat = 42
|
|
1322
|
1425
|
let ctaCorner = ctaHeight / 2
|
|
|
@@ -1366,7 +1469,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1366
|
1469
|
findJobsButton.pointerCursor = true
|
|
1367
|
1470
|
findJobsButton.target = self
|
|
1368
|
1471
|
findJobsButton.action = #selector(didSubmitSearch)
|
|
1369
|
|
- findJobsButton.setAccessibilityLabel("Send")
|
|
|
1472
|
+ findJobsButton.setAccessibilityLabel(L("Send"))
|
|
1370
|
1473
|
findJobsButton.hoverHandler = { [weak self] hovering in
|
|
1371
|
1474
|
self?.findJobsCTAPill.layer?.backgroundColor = (hovering ? Theme.brandBlueHover : Theme.brandBlue).cgColor
|
|
1372
|
1475
|
}
|
|
|
@@ -1503,7 +1606,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1503
|
1606
|
nonHomeSubtitleLabel.textColor = Theme.secondaryText
|
|
1504
|
1607
|
nonHomeSubtitleLabel.alignment = .center
|
|
1505
|
1608
|
nonHomeSubtitleLabel.maximumNumberOfLines = 0
|
|
1506
|
|
- nonHomeSubtitleLabel.stringValue = "This area is not available in the preview build. Use Home to search jobs."
|
|
|
1609
|
+ nonHomeSubtitleLabel.stringValue = L("This area is not available in the preview build. Use Home to search jobs.")
|
|
1507
|
1610
|
|
|
1508
|
1611
|
let genericStack = NSStackView(views: [nonHomeTitleLabel, nonHomeSubtitleLabel])
|
|
1509
|
1612
|
genericStack.orientation = .vertical
|
|
|
@@ -1613,7 +1716,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1613
|
1716
|
|
|
1614
|
1717
|
/// Switches the main panel to **Profile** so the user can pick a saved CV profile after choosing a template in CV Maker.
|
|
1615
|
1718
|
private func selectProfileSidebarForCVMakerFlow() {
|
|
1616
|
|
- guard let index = currentSidebarItems.firstIndex(where: { $0.title == "Profile" }) else { return }
|
|
|
1719
|
+ guard let index = currentSidebarItems.firstIndex(where: { $0.title == L("Profile") }) else { return }
|
|
1617
|
1720
|
selectSidebarItem(at: index)
|
|
1618
|
1721
|
}
|
|
1619
|
1722
|
|
|
|
@@ -1719,13 +1822,13 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1719
|
1822
|
private func confirmDeleteProfile(id: UUID) {
|
|
1720
|
1823
|
let displayName = SavedProfilesStore.profile(id: id)?.profileDisplayName ?? ""
|
|
1721
|
1824
|
let alert = NSAlert()
|
|
1722
|
|
- alert.messageText = "Delete this profile?"
|
|
|
1825
|
+ alert.messageText = L("Delete this profile?")
|
|
1723
|
1826
|
alert.informativeText = displayName.isEmpty
|
|
1724
|
|
- ? "This profile will be removed from this Mac."
|
|
1725
|
|
- : "“\(displayName)” will be removed from this Mac."
|
|
|
1827
|
+ ? L("This profile will be removed from this Mac.")
|
|
|
1828
|
+ : String(format: L("“%@” will be removed from this Mac."), displayName)
|
|
1726
|
1829
|
alert.alertStyle = .warning
|
|
1727
|
|
- alert.addButton(withTitle: "Cancel")
|
|
1728
|
|
- alert.addButton(withTitle: "Delete")
|
|
|
1830
|
+ alert.addButton(withTitle: L("Cancel"))
|
|
|
1831
|
+ alert.addButton(withTitle: L("Delete"))
|
|
1729
|
1832
|
guard let window = window else {
|
|
1730
|
1833
|
let response = alert.runModal()
|
|
1731
|
1834
|
if response == .alertSecondButtonReturn {
|
|
|
@@ -1758,19 +1861,19 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1758
|
1861
|
contentStack.alignment = .leading
|
|
1759
|
1862
|
contentStack.translatesAutoresizingMaskIntoConstraints = false
|
|
1760
|
1863
|
|
|
1761
|
|
- let appearanceTitle = NSTextField(labelWithString: "Appearance")
|
|
|
1864
|
+ let appearanceTitle = NSTextField(labelWithString: L("Appearance"))
|
|
1762
|
1865
|
appearanceTitle.font = .systemFont(ofSize: 12, weight: .semibold)
|
|
1763
|
1866
|
appearanceTitle.textColor = Theme.secondaryText
|
|
1764
|
1867
|
appearanceTitle.alignment = .left
|
|
1765
|
|
- appearanceTitle.identifier = NSUserInterfaceItemIdentifier(SettingsAppearanceID.sectionHeader)
|
|
|
1868
|
+ appearanceTitle.identifier = NSUserInterfaceItemIdentifier("\(SettingsAppearanceID.sectionHeader).Appearance")
|
|
1766
|
1869
|
|
|
1767
|
1870
|
let themeSegment = makeAppearanceModeSegment()
|
|
1768
|
1871
|
appearanceModeSegment = themeSegment
|
|
1769
|
1872
|
let langPopUp = makeLanguagePopUp()
|
|
1770
|
1873
|
languagePopUp = langPopUp
|
|
1771
|
1874
|
let appearanceSection = makeSettingsSection(rows: [
|
|
1772
|
|
- makeSettingsRow(title: "Theme", systemImage: "circle.lefthalf.filled", accessory: themeSegment, tapAction: nil),
|
|
1773
|
|
- makeSettingsRow(title: "Language", systemImage: "character.bubble", accessory: langPopUp, tapAction: nil)
|
|
|
1875
|
+ makeSettingsRow(localizationKey: "Theme", systemImage: "circle.lefthalf.filled", accessory: themeSegment, tapAction: nil),
|
|
|
1876
|
+ makeSettingsRow(localizationKey: "Language", systemImage: "character.bubble", accessory: langPopUp, tapAction: nil)
|
|
1774
|
1877
|
])
|
|
1775
|
1878
|
|
|
1776
|
1879
|
let appearanceStack = NSStackView(views: [appearanceTitle, appearanceSection])
|
|
|
@@ -1780,21 +1883,21 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1780
|
1883
|
appearanceStack.translatesAutoresizingMaskIntoConstraints = false
|
|
1781
|
1884
|
|
|
1782
|
1885
|
let settingsSection = makeSettingsSection(rows: [
|
|
1783
|
|
- makeSettingsRow(title: "Share App", systemImage: "square.and.arrow.up", accessory: nil, tapAction: #selector(didTapShareApp)),
|
|
1784
|
|
- makeSettingsRow(title: "More Apps", systemImage: "square.grid.2x2", accessory: nil, tapAction: #selector(didTapMoreApps))
|
|
|
1886
|
+ makeSettingsRow(localizationKey: "Share App", systemImage: "square.and.arrow.up", accessory: nil, tapAction: #selector(didTapShareApp)),
|
|
|
1887
|
+ makeSettingsRow(localizationKey: "More Apps", systemImage: "square.grid.2x2", accessory: nil, tapAction: #selector(didTapMoreApps))
|
|
1785
|
1888
|
])
|
|
1786
|
1889
|
|
|
1787
|
|
- let aboutTitle = NSTextField(labelWithString: "About")
|
|
|
1890
|
+ let aboutTitle = NSTextField(labelWithString: L("About"))
|
|
1788
|
1891
|
aboutTitle.font = .systemFont(ofSize: 12, weight: .semibold)
|
|
1789
|
1892
|
aboutTitle.textColor = Theme.secondaryText
|
|
1790
|
1893
|
aboutTitle.alignment = .left
|
|
1791
|
|
- aboutTitle.identifier = NSUserInterfaceItemIdentifier(SettingsAppearanceID.sectionHeader)
|
|
|
1894
|
+ aboutTitle.identifier = NSUserInterfaceItemIdentifier("\(SettingsAppearanceID.sectionHeader).About")
|
|
1792
|
1895
|
|
|
1793
|
1896
|
let aboutSection = makeSettingsSection(rows: [
|
|
1794
|
|
- makeSettingsRow(title: "Website", systemImage: "globe", accessory: nil, tapAction: #selector(didTapWebsite)),
|
|
1795
|
|
- makeSettingsRow(title: "Support", systemImage: "questionmark.circle", accessory: nil, tapAction: #selector(didTapSupport)),
|
|
1796
|
|
- makeSettingsRow(title: "Terms of Use", systemImage: "doc.text", accessory: nil, tapAction: #selector(didTapTermsOfUse)),
|
|
1797
|
|
- makeSettingsRow(title: "Privacy Policy", systemImage: "shield", accessory: nil, tapAction: #selector(didTapPrivacyPolicy))
|
|
|
1897
|
+ makeSettingsRow(localizationKey: "Website", systemImage: "globe", accessory: nil, tapAction: #selector(didTapWebsite)),
|
|
|
1898
|
+ makeSettingsRow(localizationKey: "Support", systemImage: "questionmark.circle", accessory: nil, tapAction: #selector(didTapSupport)),
|
|
|
1899
|
+ makeSettingsRow(localizationKey: "Terms of Use", systemImage: "doc.text", accessory: nil, tapAction: #selector(didTapTermsOfUse)),
|
|
|
1900
|
+ makeSettingsRow(localizationKey: "Privacy Policy", systemImage: "shield", accessory: nil, tapAction: #selector(didTapPrivacyPolicy))
|
|
1798
|
1901
|
])
|
|
1799
|
1902
|
|
|
1800
|
1903
|
let aboutStack = NSStackView(views: [aboutTitle, aboutSection])
|
|
|
@@ -1823,7 +1926,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1823
|
1926
|
|
|
1824
|
1927
|
private func makeAppearanceModeSegment() -> NSSegmentedControl {
|
|
1825
|
1928
|
let segment = NSSegmentedControl(
|
|
1826
|
|
- labels: ["System", "Light", "Dark"],
|
|
|
1929
|
+ labels: [L("System"), L("Light"), L("Dark")],
|
|
1827
|
1930
|
trackingMode: .selectOne,
|
|
1828
|
1931
|
target: self,
|
|
1829
|
1932
|
action: #selector(appearanceModeChanged(_:))
|
|
|
@@ -1841,30 +1944,24 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1841
|
1944
|
AppAppearanceManager.shared.mode = mode
|
|
1842
|
1945
|
}
|
|
1843
|
1946
|
|
|
1844
|
|
- private static let languageUserDefaultsKey = "com.appforindeed.preferredLanguage"
|
|
1845
|
|
-
|
|
1846
|
|
- private static let supportedLanguages: [(code: String, title: String)] = [
|
|
1847
|
|
- ("en", "English")
|
|
1848
|
|
- ]
|
|
1849
|
|
-
|
|
1850
|
1947
|
private func makeLanguagePopUp() -> NSPopUpButton {
|
|
1851
|
1948
|
let popup = NSPopUpButton(frame: .zero, pullsDown: false)
|
|
1852
|
1949
|
popup.translatesAutoresizingMaskIntoConstraints = false
|
|
1853
|
1950
|
popup.removeAllItems()
|
|
1854
|
1951
|
|
|
1855
|
|
- for lang in Self.supportedLanguages {
|
|
1856
|
|
- popup.addItem(withTitle: lang.title)
|
|
1857
|
|
- popup.lastItem?.representedObject = lang.code
|
|
|
1952
|
+ for language in AppLanguage.allCases {
|
|
|
1953
|
+ popup.addItem(withTitle: language.localizedDisplayName)
|
|
|
1954
|
+ popup.lastItem?.representedObject = language.localeIdentifier
|
|
1858
|
1955
|
}
|
|
1859
|
1956
|
|
|
1860
|
|
- let saved = UserDefaults.standard.string(forKey: Self.languageUserDefaultsKey) ?? "en"
|
|
1861
|
|
- if let index = Self.supportedLanguages.firstIndex(where: { $0.code == saved }) {
|
|
|
1957
|
+ let currentCode = AppLanguageManager.shared.current.localeIdentifier
|
|
|
1958
|
+ if let index = AppLanguage.allCases.firstIndex(where: { $0.localeIdentifier == currentCode }) {
|
|
1862
|
1959
|
popup.selectItem(at: index)
|
|
1863
|
1960
|
}
|
|
1864
|
1961
|
|
|
1865
|
1962
|
popup.target = self
|
|
1866
|
1963
|
popup.action = #selector(languageChanged(_:))
|
|
1867
|
|
- popup.isEnabled = !Self.supportedLanguages.isEmpty
|
|
|
1964
|
+ popup.isEnabled = !AppLanguage.allCases.isEmpty
|
|
1868
|
1965
|
popup.setContentHuggingPriority(.required, for: .horizontal)
|
|
1869
|
1966
|
popup.setContentCompressionResistancePriority(.required, for: .horizontal)
|
|
1870
|
1967
|
return popup
|
|
|
@@ -1872,8 +1969,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1872
|
1969
|
|
|
1873
|
1970
|
@objc private func languageChanged(_ sender: NSPopUpButton) {
|
|
1874
|
1971
|
guard let code = sender.selectedItem?.representedObject as? String else { return }
|
|
1875
|
|
- UserDefaults.standard.set(code, forKey: Self.languageUserDefaultsKey)
|
|
1876
|
|
- UserDefaults.standard.set([code], forKey: "AppleLanguages")
|
|
|
1972
|
+ AppLanguageManager.shared.setLanguage(code: code)
|
|
1877
|
1973
|
}
|
|
1878
|
1974
|
|
|
1879
|
1975
|
private func makeSettingsSection(rows: [NSView]) -> NSView {
|
|
|
@@ -1912,7 +2008,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1912
|
2008
|
return section
|
|
1913
|
2009
|
}
|
|
1914
|
2010
|
|
|
1915
|
|
- private func makeSettingsRow(title: String, systemImage: String, accessory: NSView?, tapAction: Selector? = nil) -> NSView {
|
|
|
2011
|
+ private func makeSettingsRow(localizationKey: String, systemImage: String, accessory: NSView?, tapAction: Selector? = nil) -> NSView {
|
|
1916
|
2012
|
let row = NSView()
|
|
1917
|
2013
|
row.translatesAutoresizingMaskIntoConstraints = false
|
|
1918
|
2014
|
row.wantsLayer = true
|
|
|
@@ -1927,14 +2023,14 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1927
|
2023
|
let icon = NSImageView()
|
|
1928
|
2024
|
icon.translatesAutoresizingMaskIntoConstraints = false
|
|
1929
|
2025
|
icon.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 13, weight: .medium)
|
|
1930
|
|
- icon.image = NSImage(systemSymbolName: systemImage, accessibilityDescription: title)
|
|
|
2026
|
+ icon.image = NSImage(systemSymbolName: systemImage, accessibilityDescription: L(localizationKey))
|
|
1931
|
2027
|
icon.contentTintColor = Theme.brandBlue
|
|
1932
|
2028
|
|
|
1933
|
|
- let titleLabel = NSTextField(labelWithString: title)
|
|
|
2029
|
+ let titleLabel = NSTextField(labelWithString: L(localizationKey))
|
|
1934
|
2030
|
titleLabel.font = .systemFont(ofSize: 14, weight: .medium)
|
|
1935
|
2031
|
titleLabel.textColor = Theme.primaryText
|
|
1936
|
2032
|
titleLabel.alignment = .left
|
|
1937
|
|
- titleLabel.identifier = NSUserInterfaceItemIdentifier(SettingsAppearanceID.rowTitle)
|
|
|
2033
|
+ titleLabel.identifier = NSUserInterfaceItemIdentifier("\(SettingsAppearanceID.rowTitle).\(localizationKey)")
|
|
1938
|
2034
|
|
|
1939
|
2035
|
let rowStack = NSStackView()
|
|
1940
|
2036
|
rowStack.orientation = .horizontal
|
|
|
@@ -1997,8 +2093,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
1997
|
2093
|
$0.removeFromSuperview()
|
|
1998
|
2094
|
}
|
|
1999
|
2095
|
if savedJobOrder.isEmpty {
|
|
2000
|
|
- savedJobsPageSubtitleLabel.stringValue = "Save jobs from Home to see them here."
|
|
2001
|
|
- let empty = NSTextField(wrappingLabelWithString: "No saved jobs yet. Search on Home, then tap Save on a listing.")
|
|
|
2096
|
+ savedJobsPageSubtitleLabel.stringValue = L("Save jobs from Home to see them here.")
|
|
|
2097
|
+ let empty = NSTextField(wrappingLabelWithString: L("No saved jobs yet. Search on Home, then tap Save on a listing."))
|
|
2002
|
2098
|
empty.font = .systemFont(ofSize: 14, weight: .regular)
|
|
2003
|
2099
|
empty.textColor = Theme.secondaryText
|
|
2004
|
2100
|
empty.alignment = .left
|
|
|
@@ -2008,7 +2104,9 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2008
|
2104
|
empty.widthAnchor.constraint(equalTo: savedJobsStack.widthAnchor).isActive = true
|
|
2009
|
2105
|
return
|
|
2010
|
2106
|
}
|
|
2011
|
|
- savedJobsPageSubtitleLabel.stringValue = "\(savedJobOrder.count) saved \(savedJobOrder.count == 1 ? "position" : "positions")"
|
|
|
2107
|
+ savedJobsPageSubtitleLabel.stringValue = savedJobOrder.count == 1
|
|
|
2108
|
+ ? L("1 saved position")
|
|
|
2109
|
+ : String(format: L("%d saved positions"), savedJobOrder.count)
|
|
2012
|
2110
|
for job in savedJobOrder {
|
|
2013
|
2111
|
let card = makeJobListingCard(job, context: .savedJobsPage)
|
|
2014
|
2112
|
savedJobsStack.addArrangedSubview(card)
|
|
|
@@ -2018,27 +2116,27 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2018
|
2116
|
|
|
2019
|
2117
|
private func isSavedJobsSidebarIndex(_ index: Int) -> Bool {
|
|
2020
|
2118
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
2021
|
|
- return currentSidebarItems[index].title == "Saved Jobs"
|
|
|
2119
|
+ return currentSidebarItems[index].title == L("Saved Jobs")
|
|
2022
|
2120
|
}
|
|
2023
|
2121
|
|
|
2024
|
2122
|
private func isHomeSidebarIndex(_ index: Int) -> Bool {
|
|
2025
|
2123
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
2026
|
|
- return currentSidebarItems[index].title == "Home"
|
|
|
2124
|
+ return currentSidebarItems[index].title == L("Home")
|
|
2027
|
2125
|
}
|
|
2028
|
2126
|
|
|
2029
|
2127
|
private func isSettingsSidebarIndex(_ index: Int) -> Bool {
|
|
2030
|
2128
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
2031
|
|
- return currentSidebarItems[index].title == "Settings"
|
|
|
2129
|
+ return currentSidebarItems[index].title == L("Settings")
|
|
2032
|
2130
|
}
|
|
2033
|
2131
|
|
|
2034
|
2132
|
private func isCVMakerSidebarIndex(_ index: Int) -> Bool {
|
|
2035
|
2133
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
2036
|
|
- return currentSidebarItems[index].title == "CV Maker"
|
|
|
2134
|
+ return currentSidebarItems[index].title == L("CV Maker")
|
|
2037
|
2135
|
}
|
|
2038
|
2136
|
|
|
2039
|
2137
|
private func isProfileSidebarIndex(_ index: Int) -> Bool {
|
|
2040
|
2138
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
2041
|
|
- return currentSidebarItems[index].title == "Profile"
|
|
|
2139
|
+ return currentSidebarItems[index].title == L("Profile")
|
|
2042
|
2140
|
}
|
|
2043
|
2141
|
|
|
2044
|
2142
|
private func updateMainContentVisibility() {
|
|
|
@@ -2132,17 +2230,17 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2132
|
2230
|
|
|
2133
|
2231
|
@objc private func didTapFeatureRole() {
|
|
2134
|
2232
|
selectFeatureShortcut(.role)
|
|
2135
|
|
- focusSearchField(seed: "Find roles similar to: ")
|
|
|
2233
|
+ focusSearchField(seed: L("Find roles similar to: "))
|
|
2136
|
2234
|
}
|
|
2137
|
2235
|
|
|
2138
|
2236
|
@objc private func didTapFeatureCompany() {
|
|
2139
|
2237
|
selectFeatureShortcut(.company)
|
|
2140
|
|
- focusSearchField(seed: "Find jobs at company: ")
|
|
|
2238
|
+ focusSearchField(seed: L("Find jobs at company: "))
|
|
2141
|
2239
|
}
|
|
2142
|
2240
|
|
|
2143
|
2241
|
@objc private func didTapFeatureSkill() {
|
|
2144
|
2242
|
selectFeatureShortcut(.skill)
|
|
2145
|
|
- focusSearchField(seed: "Find jobs that require skill: ")
|
|
|
2243
|
+ focusSearchField(seed: L("Find jobs that require skill: "))
|
|
2146
|
2244
|
}
|
|
2147
|
2245
|
|
|
2148
|
2246
|
private func selectFeatureShortcut(_ shortcut: FeatureShortcut) {
|
|
|
@@ -2196,7 +2294,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2196
|
2294
|
|
|
2197
|
2295
|
@objc private func didTapMoreApps() {
|
|
2198
|
2296
|
guard let url = AppMarketingLinks.developerAppsURL else {
|
|
2199
|
|
- presentAppMarketingConfigurationAlert(feature: "More Apps")
|
|
|
2297
|
+ presentAppMarketingConfigurationAlert(feature: L("More Apps"))
|
|
2200
|
2298
|
return
|
|
2201
|
2299
|
}
|
|
2202
|
2300
|
NSWorkspace.shared.open(url)
|
|
|
@@ -2204,14 +2302,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2204
|
2302
|
|
|
2205
|
2303
|
private func presentAppMarketingConfigurationAlert(feature: String) {
|
|
2206
|
2304
|
let alert = NSAlert()
|
|
2207
|
|
- alert.messageText = "\(feature) isn’t available yet"
|
|
2208
|
|
- alert.informativeText = """
|
|
2209
|
|
- Add your Mac App Store IDs in the target’s build settings:
|
|
2210
|
|
- • AppStoreAppID — numeric app ID from App Store Connect
|
|
2211
|
|
- • AppStoreDeveloperID — numeric developer ID (for your other apps page)
|
|
2212
|
|
- """
|
|
|
2305
|
+ alert.messageText = String(format: L("%@ isn’t available yet"), feature)
|
|
|
2306
|
+ alert.informativeText = L("Add your Mac App Store IDs in the target’s build settings:\n• AppStoreAppID — numeric app ID from App Store Connect\n• AppStoreDeveloperID — numeric developer ID (for your other apps page)")
|
|
2213
|
2307
|
alert.alertStyle = .informational
|
|
2214
|
|
- alert.addButton(withTitle: "OK")
|
|
|
2308
|
+ alert.addButton(withTitle: L("OK"))
|
|
2215
|
2309
|
if let window {
|
|
2216
|
2310
|
alert.beginSheetModal(for: window)
|
|
2217
|
2311
|
} else {
|
|
|
@@ -2246,7 +2340,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2246
|
2340
|
|
|
2247
|
2341
|
@objc private func didTapLoadMoreJobs() {
|
|
2248
|
2342
|
guard ensureProAccessForJobSearch() else { return }
|
|
2249
|
|
- let prompt = "Show more jobs"
|
|
|
2343
|
+ let prompt = L("Show more jobs")
|
|
2250
|
2344
|
guard !isAwaitingResponse, isContinuationPrompt(prompt) else { return }
|
|
2251
|
2345
|
if anchorUserJobQuery(excludingLatestUserMessage: prompt) == nil { return }
|
|
2252
|
2346
|
appendChatBubble(text: prompt, isUser: true)
|
|
|
@@ -2309,15 +2403,15 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2309
|
2403
|
private func makeAssistantSearchReply(query: String, newJobsCount: Int, isContinuation: Bool) -> String {
|
|
2310
|
2404
|
if newJobsCount == 0 {
|
|
2311
|
2405
|
if isContinuation {
|
|
2312
|
|
- return "I couldn't find new matches for \u{201C}\(query)\u{201D}. Try a different angle or a more specific keyword."
|
|
|
2406
|
+ return String(format: L("I couldn't find new matches for “%@”. Try a different angle or a more specific keyword."), query)
|
|
2313
|
2407
|
}
|
|
2314
|
|
- return "No jobs found for \u{201C}\(query)\u{201D}. Try another title, skill, company, or location."
|
|
|
2408
|
+ return String(format: L("No jobs found for “%@”. Try another title, skill, company, or location."), query)
|
|
2315
|
2409
|
}
|
|
2316
|
|
- let plural = newJobsCount == 1 ? "match" : "matches"
|
|
|
2410
|
+ let matchWord = newJobsCount == 1 ? L("match") : L("matches")
|
|
2317
|
2411
|
if isContinuation {
|
|
2318
|
|
- return "Here are \(newJobsCount) more \(plural) for \u{201C}\(query)\u{201D}."
|
|
|
2412
|
+ return String(format: L("Here are %d more %@ for “%@”."), newJobsCount, matchWord, query)
|
|
2319
|
2413
|
}
|
|
2320
|
|
- return "Found \(newJobsCount) \(plural) for \u{201C}\(query)\u{201D}. Tap Apply to open the listing or Save to revisit later."
|
|
|
2414
|
+ return String(format: L("Found %d %@ for “%@”. Tap Apply to open the listing or Save to revisit later."), newJobsCount, matchWord, query)
|
|
2321
|
2415
|
}
|
|
2322
|
2416
|
|
|
2323
|
2417
|
private func resolvedSearchQuery(for prompt: String) -> String {
|
|
|
@@ -2347,6 +2441,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2347
|
2441
|
|
|
2348
|
2442
|
private func isContinuationPrompt(_ prompt: String) -> Bool {
|
|
2349
|
2443
|
let normalized = prompt.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
|
|
|
2444
|
+ let showMoreJobs = L("Show more jobs").trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
|
|
|
2445
|
+ if normalized == showMoreJobs {
|
|
|
2446
|
+ return true
|
|
|
2447
|
+ }
|
|
2350
|
2448
|
let continuationPhrases: Set<String> = [
|
|
2351
|
2449
|
"more",
|
|
2352
|
2450
|
"show more",
|
|
|
@@ -2423,7 +2521,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2423
|
2521
|
chatMessages.removeAll()
|
|
2424
|
2522
|
lastSearchResults.removeAll()
|
|
2425
|
2523
|
clearChatStack()
|
|
2426
|
|
- let welcome = "Tell me what role you want and I will return job descriptions, key skills, and a quick fit summary."
|
|
|
2524
|
+ let welcome = L("Tell me what role you want and I will return job descriptions, key skills, and a quick fit summary.")
|
|
2427
|
2525
|
chatMessages.append(ChatMessage(role: "assistant", content: welcome))
|
|
2428
|
2526
|
appendChatBubble(text: welcome, isUser: false)
|
|
2429
|
2527
|
}
|
|
|
@@ -2620,7 +2718,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2620
|
2718
|
row.translatesAutoresizingMaskIntoConstraints = false
|
|
2621
|
2719
|
let button = HoverableButton()
|
|
2622
|
2720
|
button.pointerCursor = true
|
|
2623
|
|
- button.title = "Show more jobs"
|
|
|
2721
|
+ button.title = L("Show more jobs")
|
|
2624
|
2722
|
button.font = .systemFont(ofSize: 12, weight: .semibold)
|
|
2625
|
2723
|
button.bezelStyle = .rounded
|
|
2626
|
2724
|
button.controlSize = .regular
|
|
|
@@ -2730,10 +2828,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2730
|
2828
|
rowHost.layer?.cornerRadius = 8
|
|
2731
|
2829
|
rowHost.restingBackgroundColor = isSelected ? Theme.selectionFill : nil
|
|
2732
|
2830
|
rowHost.hoverBackgroundColor = isSelected ? Theme.selectionFillHover : Theme.sidebarRowHoverFill
|
|
2733
|
|
- rowHost.setAccessibilityLabel("Indeed")
|
|
|
2831
|
+ rowHost.setAccessibilityLabel(L("Indeed"))
|
|
2734
|
2832
|
rowHost.setAccessibilityRole(.button)
|
|
2735
|
2833
|
rowHost.setAccessibilitySelected(isSelected)
|
|
2736
|
|
- rowHost.setAccessibilityHelp("Open Indeed to search and apply for jobs")
|
|
|
2834
|
+ rowHost.setAccessibilityHelp(L("Open Indeed to search and apply for jobs"))
|
|
2737
|
2835
|
|
|
2738
|
2836
|
let row = NSStackView()
|
|
2739
|
2837
|
row.orientation = .horizontal
|
|
|
@@ -2749,7 +2847,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2749
|
2847
|
icon.widthAnchor.constraint(equalToConstant: Self.sidebarNavIconSize).isActive = true
|
|
2750
|
2848
|
icon.heightAnchor.constraint(equalToConstant: Self.sidebarNavIconSize).isActive = true
|
|
2751
|
2849
|
|
|
2752
|
|
- let text = NSTextField(labelWithString: "Indeed")
|
|
|
2850
|
+ let text = NSTextField(labelWithString: L("Indeed"))
|
|
2753
|
2851
|
text.font = .systemFont(ofSize: 14, weight: .medium)
|
|
2754
|
2852
|
text.textColor = isSelected ? Theme.brandBlue : Theme.secondaryText
|
|
2755
|
2853
|
text.refusesFirstResponder = true
|
|
|
@@ -2859,7 +2957,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2859
|
2957
|
let sidebarHorizontalInset = sidebar.edgeInsets.left + sidebar.edgeInsets.right
|
|
2860
|
2958
|
rowHost.widthAnchor.constraint(equalTo: sidebar.widthAnchor, constant: -sidebarHorizontalInset).isActive = true
|
|
2861
|
2959
|
|
|
2862
|
|
- if item.title == "Home" {
|
|
|
2960
|
+ if item.title == L("Home") {
|
|
2863
|
2961
|
addIndeedSidebarLaunchRow()
|
|
2864
|
2962
|
}
|
|
2865
|
2963
|
}
|
|
|
@@ -2896,7 +2994,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2896
|
2994
|
proIcon.image = NSImage(systemSymbolName: "sparkles", accessibilityDescription: nil)
|
|
2897
|
2995
|
proIcon.contentTintColor = Theme.proAccent
|
|
2898
|
2996
|
|
|
2899
|
|
- let proEyebrow = NSTextField(labelWithString: "Premium")
|
|
|
2997
|
+ let proEyebrow = NSTextField(labelWithString: L("Premium"))
|
|
2900
|
2998
|
proEyebrow.font = .systemFont(ofSize: 11, weight: .heavy)
|
|
2901
|
2999
|
proEyebrow.textColor = Theme.proAccent
|
|
2902
|
3000
|
proEyebrow.alignment = .center
|
|
|
@@ -2906,12 +3004,12 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2906
|
3004
|
eyebrowRow.spacing = 6
|
|
2907
|
3005
|
eyebrowRow.alignment = .centerY
|
|
2908
|
3006
|
|
|
2909
|
|
- let headline = NSTextField(labelWithString: "Upgrade to Pro")
|
|
|
3007
|
+ let headline = NSTextField(labelWithString: L("Upgrade to Pro"))
|
|
2910
|
3008
|
headline.font = .systemFont(ofSize: 16, weight: .bold)
|
|
2911
|
3009
|
headline.textColor = Theme.primaryText
|
|
2912
|
3010
|
headline.alignment = .center
|
|
2913
|
3011
|
|
|
2914
|
|
- let upgradeDescription = NSTextField(wrappingLabelWithString: "Unlimited AI matches, smart alerts, and interview prep—all in one place.")
|
|
|
3012
|
+ let upgradeDescription = NSTextField(wrappingLabelWithString: L("Unlimited AI matches, smart alerts, and interview prep—all in one place."))
|
|
2915
|
3013
|
upgradeDescription.font = .systemFont(ofSize: 12, weight: .regular)
|
|
2916
|
3014
|
upgradeDescription.textColor = Theme.secondaryText
|
|
2917
|
3015
|
upgradeDescription.alignment = .center
|
|
|
@@ -2920,7 +3018,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2920
|
3018
|
let innerContentWidth = cardWidth - 28
|
|
2921
|
3019
|
upgradeDescription.preferredMaxLayoutWidth = innerContentWidth
|
|
2922
|
3020
|
|
|
2923
|
|
- let upgradeButton = HoverableButton(title: "Try Pro", target: self, action: #selector(didTapUpgradeToPro))
|
|
|
3021
|
+ let upgradeButton = HoverableButton(title: L("Try Pro"), target: self, action: #selector(didTapUpgradeToPro))
|
|
2924
|
3022
|
upgradeButton.isBordered = false
|
|
2925
|
3023
|
upgradeButton.bezelStyle = .rounded
|
|
2926
|
3024
|
upgradeButton.font = .systemFont(ofSize: 13, weight: .bold)
|
|
|
@@ -3051,7 +3149,7 @@ private final class OpenAIJobSearchService {
|
|
3051
|
3149
|
completion(.failure(NSError(
|
|
3052
|
3150
|
domain: "OpenAIJobSearchService",
|
|
3053
|
3151
|
code: 1,
|
|
3054
|
|
- userInfo: [NSLocalizedDescriptionKey: "Job search is unavailable."]
|
|
|
3152
|
+ userInfo: [NSLocalizedDescriptionKey: L("Job search is unavailable.")]
|
|
3055
|
3153
|
)))
|
|
3056
|
3154
|
return
|
|
3057
|
3155
|
}
|