|
|
@@ -120,7 +120,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
private let findJobsButton = HoverableButton()
|
|
|
private let findJobsCTAPill = HoverableView()
|
|
|
private let sendIconView = NSImageView()
|
|
|
- private let sendLabel = NSTextField(labelWithString: "Send")
|
|
|
+ private let sendLabel = NSTextField(labelWithString: L("Send"))
|
|
|
private let sendContentStack = NSStackView()
|
|
|
private let findJobsCTAHost = NSView()
|
|
|
private let welcomeHeroHost = NSView()
|
|
|
@@ -129,7 +129,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
private let welcomeLogoView = IndeedLogoView(displayHeight: 40, variant: .compact)
|
|
|
private let featureCardsRow = NSStackView()
|
|
|
private enum FeatureShortcut: Int { case role = 0, company = 1, skill = 2 }
|
|
|
- private let clearChatButton = NSButton(title: "Clear chat", target: nil, action: nil)
|
|
|
+ private let clearChatButton = NSButton(title: L("Clear chat"), target: nil, action: nil)
|
|
|
private let chatScrollView = NSScrollView()
|
|
|
private let chatDocumentView = JobListingsDocumentView()
|
|
|
private let chatStack = NSStackView()
|
|
|
@@ -141,7 +141,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
private let nonHomeTitleLabel = NSTextField(labelWithString: "")
|
|
|
private let nonHomeSubtitleLabel = NSTextField(wrappingLabelWithString: "")
|
|
|
private let savedJobsPageContainer = NSView()
|
|
|
- private let savedJobsPageTitleLabel = NSTextField(labelWithString: "Saved Jobs")
|
|
|
+ private let savedJobsPageTitleLabel = NSTextField(labelWithString: L("Saved Jobs"))
|
|
|
private let savedJobsPageSubtitleLabel = NSTextField(wrappingLabelWithString: "")
|
|
|
private let savedJobsScrollView = NSScrollView()
|
|
|
private let savedJobsDocumentView = JobListingsDocumentView()
|
|
|
@@ -193,6 +193,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
private weak var sidebarUpgradeButton: HoverableButton?
|
|
|
private var subscriptionObserver: NSObjectProtocol?
|
|
|
private var appearanceObserver: NSObjectProtocol?
|
|
|
+ private var languageObserver: NSObjectProtocol?
|
|
|
/// Retains the system share picker until the user picks a destination or dismisses the menu.
|
|
|
private var appSharePicker: NSSharingServicePicker?
|
|
|
|
|
|
@@ -226,6 +227,9 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
if let appearanceObserver {
|
|
|
NotificationCenter.default.removeObserver(appearanceObserver)
|
|
|
}
|
|
|
+ if let languageObserver {
|
|
|
+ NotificationCenter.default.removeObserver(languageObserver)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override func viewDidChangeEffectiveAppearance() {
|
|
|
@@ -241,6 +245,103 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
) { [weak self] _ in
|
|
|
self?.applyCurrentAppearance()
|
|
|
}
|
|
|
+ languageObserver = NotificationCenter.default.addObserver(
|
|
|
+ forName: AppLanguageManager.didChangeNotification,
|
|
|
+ object: nil,
|
|
|
+ queue: .main
|
|
|
+ ) { [weak self] _ in
|
|
|
+ self?.refreshLocalizedStrings()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private func refreshLocalizedStrings() {
|
|
|
+ greetingLabel.stringValue = L("Welcome")
|
|
|
+ subtitleLabel.stringValue = L("Find your perfect job with the power of AI.")
|
|
|
+ sendLabel.stringValue = L("Send")
|
|
|
+ clearChatButton.title = L("Clear chat")
|
|
|
+ clearChatButton.toolTip = L("Remove all messages and start a new conversation")
|
|
|
+ savedJobsPageTitleLabel.stringValue = L("Saved Jobs")
|
|
|
+ nonHomeSubtitleLabel.stringValue = L("This area is not available in the preview build. Use Home to search jobs.")
|
|
|
+
|
|
|
+ jobKeywordsField.placeholderAttributedString = NSAttributedString(
|
|
|
+ string: L("Ask for roles, skills, salary, or job descriptions..."),
|
|
|
+ attributes: [
|
|
|
+ .foregroundColor: Theme.secondaryText,
|
|
|
+ .font: NSFont.systemFont(ofSize: 14, weight: .regular)
|
|
|
+ ]
|
|
|
+ )
|
|
|
+ jobSearchIcon.setAccessibilityLabel(L("Ask AI"))
|
|
|
+ findJobsButton.setAccessibilityLabel(L("Send"))
|
|
|
+
|
|
|
+ appearanceModeSegment?.setLabel(L("System"), forSegment: 0)
|
|
|
+ appearanceModeSegment?.setLabel(L("Light"), forSegment: 1)
|
|
|
+ appearanceModeSegment?.setLabel(L("Dark"), forSegment: 2)
|
|
|
+
|
|
|
+ refreshLanguagePopUp()
|
|
|
+ refreshSettingsLocalizedLabels()
|
|
|
+ refreshSidebarItemTitles()
|
|
|
+ updateFreeJobSearchQuotaLabel()
|
|
|
+ applyProSubscriptionToSidebar()
|
|
|
+ configureSidebar()
|
|
|
+ reloadSavedJobsListings()
|
|
|
+ rebuildFeatureShortcutCards()
|
|
|
+ trailingLoadMoreJobsButton?.title = L("Show more jobs")
|
|
|
+ }
|
|
|
+
|
|
|
+ private func refreshSidebarItemTitles() {
|
|
|
+ currentSidebarItems = currentSidebarItems.map { item in
|
|
|
+ SidebarItem(
|
|
|
+ title: localizedSidebarTitle(forSystemImage: item.systemImage),
|
|
|
+ systemImage: item.systemImage,
|
|
|
+ badge: item.badge
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private func localizedSidebarTitle(forSystemImage systemImage: String) -> String {
|
|
|
+ switch systemImage {
|
|
|
+ case "house.fill":
|
|
|
+ return L("Home")
|
|
|
+ case "heart":
|
|
|
+ return L("Saved Jobs")
|
|
|
+ case "doc.text":
|
|
|
+ return L("CV Maker")
|
|
|
+ case "person":
|
|
|
+ return L("Profile")
|
|
|
+ case "gearshape":
|
|
|
+ return L("Settings")
|
|
|
+ default:
|
|
|
+ return L("Home")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private func refreshLanguagePopUp() {
|
|
|
+ guard let popup = languagePopUp else { return }
|
|
|
+ let selectedCode = AppLanguageManager.shared.current.localeIdentifier
|
|
|
+ popup.removeAllItems()
|
|
|
+ for language in AppLanguage.allCases {
|
|
|
+ popup.addItem(withTitle: language.localizedDisplayName)
|
|
|
+ popup.lastItem?.representedObject = language.localeIdentifier
|
|
|
+ }
|
|
|
+ if let index = AppLanguage.allCases.firstIndex(where: { $0.localeIdentifier == selectedCode }) {
|
|
|
+ popup.selectItem(at: index)
|
|
|
+ }
|
|
|
+ popup.isEnabled = !AppLanguage.allCases.isEmpty
|
|
|
+ }
|
|
|
+
|
|
|
+ private func refreshSettingsLocalizedLabels() {
|
|
|
+ for view in settingsPageContainer.subviewsRecursive() {
|
|
|
+ guard let rawID = view.identifier?.rawValue else { continue }
|
|
|
+ let sectionPrefix = SettingsAppearanceID.sectionHeader + "."
|
|
|
+ let rowPrefix = SettingsAppearanceID.rowTitle + "."
|
|
|
+ if rawID.hasPrefix(sectionPrefix) {
|
|
|
+ let key = String(rawID.dropFirst(sectionPrefix.count))
|
|
|
+ (view as? NSTextField)?.stringValue = L(key)
|
|
|
+ } else if rawID.hasPrefix(rowPrefix) {
|
|
|
+ let key = String(rawID.dropFirst(rowPrefix.count))
|
|
|
+ (view as? NSTextField)?.stringValue = L(key)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override func viewDidMoveToWindow() {
|
|
|
@@ -262,7 +363,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
func render(_ data: DashboardData) {
|
|
|
dismissIndeedJobBrowserEmbedded()
|
|
|
- greetingLabel.stringValue = "Welcome"
|
|
|
+ greetingLabel.stringValue = L("Welcome")
|
|
|
subtitleLabel.stringValue = data.subtitle
|
|
|
currentSidebarItems = data.sidebarItems
|
|
|
if selectedSidebarIndex >= currentSidebarItems.count {
|
|
|
@@ -303,7 +404,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
searchCard.layer?.borderColor = (searchHovering ? Theme.searchBarBorderHover : Theme.searchBarBorder).cgColor
|
|
|
jobKeywordsField.textColor = Theme.primaryText
|
|
|
jobKeywordsField.placeholderAttributedString = NSAttributedString(
|
|
|
- string: "Ask for roles, skills, salary, or job descriptions...",
|
|
|
+ string: L("Ask for roles, skills, salary, or job descriptions..."),
|
|
|
attributes: [
|
|
|
.foregroundColor: Theme.secondaryText,
|
|
|
.font: NSFont.systemFont(ofSize: 14, weight: .regular)
|
|
|
@@ -318,11 +419,11 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
appearanceModeSegment?.selectedSegment = AppAppearanceManager.shared.mode.segmentIndex
|
|
|
if let langPopUp = languagePopUp {
|
|
|
- let saved = UserDefaults.standard.string(forKey: Self.languageUserDefaultsKey) ?? "en"
|
|
|
- if let index = Self.supportedLanguages.firstIndex(where: { $0.code == saved }) {
|
|
|
+ let saved = AppLanguageManager.shared.current.localeIdentifier
|
|
|
+ if let index = AppLanguage.allCases.firstIndex(where: { $0.localeIdentifier == saved }) {
|
|
|
langPopUp.selectItem(at: index)
|
|
|
}
|
|
|
- langPopUp.isEnabled = !Self.supportedLanguages.isEmpty
|
|
|
+ langPopUp.isEnabled = !AppLanguage.allCases.isEmpty
|
|
|
}
|
|
|
cvMakerPageView.applyCurrentAppearance()
|
|
|
profilesListPageView.applyCurrentAppearance()
|
|
|
@@ -340,7 +441,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
private func refreshSettingsPageAppearance(in root: NSView) {
|
|
|
for view in root.subviewsRecursive() {
|
|
|
- switch view.identifier?.rawValue {
|
|
|
+ guard let rawID = view.identifier?.rawValue else { continue }
|
|
|
+ switch rawID {
|
|
|
case SettingsAppearanceID.section:
|
|
|
view.layer?.backgroundColor = Theme.settingsGroupBackground.cgColor
|
|
|
view.layer?.borderColor = Theme.border.cgColor
|
|
|
@@ -351,12 +453,12 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
for case let icon as NSImageView in view.subviews {
|
|
|
icon.contentTintColor = Theme.brandBlue
|
|
|
}
|
|
|
- case SettingsAppearanceID.sectionHeader:
|
|
|
- (view as? NSTextField)?.textColor = Theme.secondaryText
|
|
|
- case SettingsAppearanceID.rowTitle:
|
|
|
- (view as? NSTextField)?.textColor = Theme.primaryText
|
|
|
default:
|
|
|
- break
|
|
|
+ if rawID.hasPrefix(SettingsAppearanceID.sectionHeader + ".") {
|
|
|
+ (view as? NSTextField)?.textColor = Theme.secondaryText
|
|
|
+ } else if rawID.hasPrefix(SettingsAppearanceID.rowTitle + ".") {
|
|
|
+ (view as? NSTextField)?.textColor = Theme.primaryText
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -524,7 +626,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
clearChatButton.font = .systemFont(ofSize: 12, weight: .medium)
|
|
|
clearChatButton.target = self
|
|
|
clearChatButton.action = #selector(didTapClearChat)
|
|
|
- clearChatButton.toolTip = "Remove all messages and start a new conversation"
|
|
|
+ clearChatButton.toolTip = L("Remove all messages and start a new conversation")
|
|
|
clearChatButton.setContentHuggingPriority(.required, for: .horizontal)
|
|
|
chatHeaderRow.addArrangedSubview(chatHeaderLeadingSpacer)
|
|
|
chatHeaderRow.addArrangedSubview(clearChatButton)
|
|
|
@@ -589,6 +691,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
welcomeHeroContent.widthAnchor.constraint(equalTo: mainOverlay.widthAnchor, constant: -32)
|
|
|
])
|
|
|
registerSubscriptionObserverOnce()
|
|
|
+ refreshLocalizedStrings()
|
|
|
}
|
|
|
|
|
|
private func registerSubscriptionObserverOnce() {
|
|
|
@@ -612,15 +715,15 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
let descriptionWidth: CGFloat = 158
|
|
|
if active {
|
|
|
- headline.stringValue = "You're on Pro"
|
|
|
- upgradeDescription.stringValue = "Manage billing, renewals, and plans in Premium."
|
|
|
+ headline.stringValue = L("You're on Pro")
|
|
|
+ upgradeDescription.stringValue = L("Manage billing, renewals, and plans in Premium.")
|
|
|
upgradeDescription.preferredMaxLayoutWidth = descriptionWidth
|
|
|
- upgradeButton.title = "Manage Subscription"
|
|
|
+ upgradeButton.title = L("Manage Subscription")
|
|
|
} else {
|
|
|
- headline.stringValue = "Upgrade to Pro"
|
|
|
- upgradeDescription.stringValue = "Unlimited AI matches, smart alerts, and interview prep—all in one place."
|
|
|
+ headline.stringValue = L("Upgrade to Pro")
|
|
|
+ upgradeDescription.stringValue = L("Unlimited AI matches, smart alerts, and interview prep—all in one place.")
|
|
|
upgradeDescription.preferredMaxLayoutWidth = descriptionWidth
|
|
|
- upgradeButton.title = "Try Pro"
|
|
|
+ upgradeButton.title = L("Try Pro")
|
|
|
}
|
|
|
updateFreeJobSearchQuotaLabel()
|
|
|
}
|
|
|
@@ -635,8 +738,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
let remaining = FreeTierJobSearchQuota.remainingUserMessages(isProActive: false)
|
|
|
freeJobSearchQuotaLabel.isHidden = false
|
|
|
freeJobSearchQuotaLabel.stringValue = remaining == 1
|
|
|
- ? "1 reply left"
|
|
|
- : "\(remaining) replies left"
|
|
|
+ ? L("1 reply left")
|
|
|
+ : String(format: L("%d replies left"), remaining)
|
|
|
}
|
|
|
|
|
|
/// 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
|
|
|
featureCardsRow.alignment = .top
|
|
|
featureCardsRow.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
|
- let specs: [(symbol: String, title: String, subtitle: String, action: Selector)] = [
|
|
|
+ let specs: [(symbol: String, titleKey: String, subtitleKey: String, action: Selector)] = [
|
|
|
("briefcase", "Role", "Explore similar or better job roles", #selector(didTapFeatureRole)),
|
|
|
("building.2", "Company", "Find opportunities at other companies", #selector(didTapFeatureCompany)),
|
|
|
("chevron.left.forwardslash.chevron.right", "Skill", "Match jobs that fit your skills", #selector(didTapFeatureSkill))
|
|
|
@@ -704,8 +807,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
for spec in specs {
|
|
|
let card = FeatureShortcutCardView(
|
|
|
symbolName: spec.symbol,
|
|
|
- title: spec.title,
|
|
|
- subtitle: spec.subtitle,
|
|
|
+ title: L(spec.titleKey),
|
|
|
+ subtitle: L(spec.subtitleKey),
|
|
|
target: self,
|
|
|
action: spec.action
|
|
|
)
|
|
|
@@ -841,7 +944,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
private func jobListingHostSubtitle(_ job: JobListing) -> String {
|
|
|
guard let raw = job.url, let url = URL(string: raw), let host = url.host?.lowercased() else {
|
|
|
- return "Indeed"
|
|
|
+ return L("Indeed")
|
|
|
}
|
|
|
if host.hasPrefix("www.") {
|
|
|
return String(host.dropFirst(4))
|
|
|
@@ -943,7 +1046,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
descriptionField.tag = 502
|
|
|
descriptionField.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
|
- let applyButton = JobPayloadButton(title: "Apply", target: self, action: #selector(didTapJobApply(_:)))
|
|
|
+ let applyButton = JobPayloadButton(title: L("Apply"), target: self, action: #selector(didTapJobApply(_:)))
|
|
|
applyButton.jobPayload = job
|
|
|
applyButton.cardContext = context
|
|
|
applyButton.isBordered = false
|
|
|
@@ -962,7 +1065,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
applyButton.setContentCompressionResistancePriority(.required, for: .horizontal)
|
|
|
|
|
|
let savedOn = isJobSaved(job)
|
|
|
- let savedButton = SaveJobPayloadButton(title: savedOn ? "Saved" : "Save", target: self, action: #selector(didTapJobSaved(_:)))
|
|
|
+ let savedButton = SaveJobPayloadButton(title: savedOn ? L("Saved") : L("Save"), target: self, action: #selector(didTapJobSaved(_:)))
|
|
|
savedButton.jobPayload = job
|
|
|
savedButton.cardContext = context
|
|
|
savedButton.setButtonType(.toggle)
|
|
|
@@ -986,7 +1089,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
let dismissButton = JobPayloadButton()
|
|
|
dismissButton.jobPayload = job
|
|
|
dismissButton.cardContext = context
|
|
|
- dismissButton.image = NSImage(systemSymbolName: "xmark", accessibilityDescription: "Dismiss")
|
|
|
+ dismissButton.image = NSImage(systemSymbolName: "xmark", accessibilityDescription: L("Dismiss"))
|
|
|
dismissButton.imagePosition = .imageOnly
|
|
|
dismissButton.imageScaling = .scaleProportionallyDown
|
|
|
dismissButton.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 12, weight: .semibold)
|
|
|
@@ -995,7 +1098,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
dismissButton.contentTintColor = Theme.secondaryText
|
|
|
dismissButton.target = self
|
|
|
dismissButton.action = #selector(didTapJobDismiss(_:))
|
|
|
- dismissButton.toolTip = context == .savedJobsPage ? "Remove from saved" : "Dismiss"
|
|
|
+ dismissButton.toolTip = context == .savedJobsPage ? L("Remove from saved") : L("Dismiss")
|
|
|
dismissButton.focusRingType = .none
|
|
|
dismissButton.wantsLayer = true
|
|
|
dismissButton.layer?.cornerRadius = 8
|
|
|
@@ -1199,7 +1302,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
let willSave = !isJobSaved(job)
|
|
|
applySavedState(willSave, for: job)
|
|
|
sender.state = willSave ? .on : .off
|
|
|
- sender.title = willSave ? "Saved" : "Save"
|
|
|
+ sender.title = willSave ? L("Saved") : L("Save")
|
|
|
sender.image = NSImage(systemSymbolName: willSave ? "heart.fill" : "heart", accessibilityDescription: nil)
|
|
|
styleJobSavedButton(sender)
|
|
|
if isSavedJobsSidebarIndex(selectedSidebarIndex) {
|
|
|
@@ -1313,10 +1416,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
jobSearchIcon.translatesAutoresizingMaskIntoConstraints = false
|
|
|
jobSearchIcon.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 16, weight: .semibold)
|
|
|
- jobSearchIcon.image = NSImage(systemSymbolName: "sparkles", accessibilityDescription: "Ask AI")
|
|
|
+ jobSearchIcon.image = NSImage(systemSymbolName: "sparkles", accessibilityDescription: L("Ask AI"))
|
|
|
jobSearchIcon.contentTintColor = Theme.brandBlue
|
|
|
|
|
|
- configureField(jobKeywordsField, placeholder: "Ask for roles, skills, salary, or job descriptions...")
|
|
|
+ configureField(jobKeywordsField, placeholder: L("Ask for roles, skills, salary, or job descriptions..."))
|
|
|
|
|
|
let ctaHeight: CGFloat = 42
|
|
|
let ctaCorner = ctaHeight / 2
|
|
|
@@ -1366,7 +1469,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
findJobsButton.pointerCursor = true
|
|
|
findJobsButton.target = self
|
|
|
findJobsButton.action = #selector(didSubmitSearch)
|
|
|
- findJobsButton.setAccessibilityLabel("Send")
|
|
|
+ findJobsButton.setAccessibilityLabel(L("Send"))
|
|
|
findJobsButton.hoverHandler = { [weak self] hovering in
|
|
|
self?.findJobsCTAPill.layer?.backgroundColor = (hovering ? Theme.brandBlueHover : Theme.brandBlue).cgColor
|
|
|
}
|
|
|
@@ -1503,7 +1606,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
nonHomeSubtitleLabel.textColor = Theme.secondaryText
|
|
|
nonHomeSubtitleLabel.alignment = .center
|
|
|
nonHomeSubtitleLabel.maximumNumberOfLines = 0
|
|
|
- nonHomeSubtitleLabel.stringValue = "This area is not available in the preview build. Use Home to search jobs."
|
|
|
+ nonHomeSubtitleLabel.stringValue = L("This area is not available in the preview build. Use Home to search jobs.")
|
|
|
|
|
|
let genericStack = NSStackView(views: [nonHomeTitleLabel, nonHomeSubtitleLabel])
|
|
|
genericStack.orientation = .vertical
|
|
|
@@ -1613,7 +1716,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
/// Switches the main panel to **Profile** so the user can pick a saved CV profile after choosing a template in CV Maker.
|
|
|
private func selectProfileSidebarForCVMakerFlow() {
|
|
|
- guard let index = currentSidebarItems.firstIndex(where: { $0.title == "Profile" }) else { return }
|
|
|
+ guard let index = currentSidebarItems.firstIndex(where: { $0.title == L("Profile") }) else { return }
|
|
|
selectSidebarItem(at: index)
|
|
|
}
|
|
|
|
|
|
@@ -1719,13 +1822,13 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
private func confirmDeleteProfile(id: UUID) {
|
|
|
let displayName = SavedProfilesStore.profile(id: id)?.profileDisplayName ?? ""
|
|
|
let alert = NSAlert()
|
|
|
- alert.messageText = "Delete this profile?"
|
|
|
+ alert.messageText = L("Delete this profile?")
|
|
|
alert.informativeText = displayName.isEmpty
|
|
|
- ? "This profile will be removed from this Mac."
|
|
|
- : "“\(displayName)” will be removed from this Mac."
|
|
|
+ ? L("This profile will be removed from this Mac.")
|
|
|
+ : String(format: L("“%@” will be removed from this Mac."), displayName)
|
|
|
alert.alertStyle = .warning
|
|
|
- alert.addButton(withTitle: "Cancel")
|
|
|
- alert.addButton(withTitle: "Delete")
|
|
|
+ alert.addButton(withTitle: L("Cancel"))
|
|
|
+ alert.addButton(withTitle: L("Delete"))
|
|
|
guard let window = window else {
|
|
|
let response = alert.runModal()
|
|
|
if response == .alertSecondButtonReturn {
|
|
|
@@ -1758,19 +1861,19 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
contentStack.alignment = .leading
|
|
|
contentStack.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
|
- let appearanceTitle = NSTextField(labelWithString: "Appearance")
|
|
|
+ let appearanceTitle = NSTextField(labelWithString: L("Appearance"))
|
|
|
appearanceTitle.font = .systemFont(ofSize: 12, weight: .semibold)
|
|
|
appearanceTitle.textColor = Theme.secondaryText
|
|
|
appearanceTitle.alignment = .left
|
|
|
- appearanceTitle.identifier = NSUserInterfaceItemIdentifier(SettingsAppearanceID.sectionHeader)
|
|
|
+ appearanceTitle.identifier = NSUserInterfaceItemIdentifier("\(SettingsAppearanceID.sectionHeader).Appearance")
|
|
|
|
|
|
let themeSegment = makeAppearanceModeSegment()
|
|
|
appearanceModeSegment = themeSegment
|
|
|
let langPopUp = makeLanguagePopUp()
|
|
|
languagePopUp = langPopUp
|
|
|
let appearanceSection = makeSettingsSection(rows: [
|
|
|
- makeSettingsRow(title: "Theme", systemImage: "circle.lefthalf.filled", accessory: themeSegment, tapAction: nil),
|
|
|
- makeSettingsRow(title: "Language", systemImage: "character.bubble", accessory: langPopUp, tapAction: nil)
|
|
|
+ makeSettingsRow(localizationKey: "Theme", systemImage: "circle.lefthalf.filled", accessory: themeSegment, tapAction: nil),
|
|
|
+ makeSettingsRow(localizationKey: "Language", systemImage: "character.bubble", accessory: langPopUp, tapAction: nil)
|
|
|
])
|
|
|
|
|
|
let appearanceStack = NSStackView(views: [appearanceTitle, appearanceSection])
|
|
|
@@ -1780,21 +1883,21 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
appearanceStack.translatesAutoresizingMaskIntoConstraints = false
|
|
|
|
|
|
let settingsSection = makeSettingsSection(rows: [
|
|
|
- makeSettingsRow(title: "Share App", systemImage: "square.and.arrow.up", accessory: nil, tapAction: #selector(didTapShareApp)),
|
|
|
- makeSettingsRow(title: "More Apps", systemImage: "square.grid.2x2", accessory: nil, tapAction: #selector(didTapMoreApps))
|
|
|
+ makeSettingsRow(localizationKey: "Share App", systemImage: "square.and.arrow.up", accessory: nil, tapAction: #selector(didTapShareApp)),
|
|
|
+ makeSettingsRow(localizationKey: "More Apps", systemImage: "square.grid.2x2", accessory: nil, tapAction: #selector(didTapMoreApps))
|
|
|
])
|
|
|
|
|
|
- let aboutTitle = NSTextField(labelWithString: "About")
|
|
|
+ let aboutTitle = NSTextField(labelWithString: L("About"))
|
|
|
aboutTitle.font = .systemFont(ofSize: 12, weight: .semibold)
|
|
|
aboutTitle.textColor = Theme.secondaryText
|
|
|
aboutTitle.alignment = .left
|
|
|
- aboutTitle.identifier = NSUserInterfaceItemIdentifier(SettingsAppearanceID.sectionHeader)
|
|
|
+ aboutTitle.identifier = NSUserInterfaceItemIdentifier("\(SettingsAppearanceID.sectionHeader).About")
|
|
|
|
|
|
let aboutSection = makeSettingsSection(rows: [
|
|
|
- makeSettingsRow(title: "Website", systemImage: "globe", accessory: nil, tapAction: #selector(didTapWebsite)),
|
|
|
- makeSettingsRow(title: "Support", systemImage: "questionmark.circle", accessory: nil, tapAction: #selector(didTapSupport)),
|
|
|
- makeSettingsRow(title: "Terms of Use", systemImage: "doc.text", accessory: nil, tapAction: #selector(didTapTermsOfUse)),
|
|
|
- makeSettingsRow(title: "Privacy Policy", systemImage: "shield", accessory: nil, tapAction: #selector(didTapPrivacyPolicy))
|
|
|
+ makeSettingsRow(localizationKey: "Website", systemImage: "globe", accessory: nil, tapAction: #selector(didTapWebsite)),
|
|
|
+ makeSettingsRow(localizationKey: "Support", systemImage: "questionmark.circle", accessory: nil, tapAction: #selector(didTapSupport)),
|
|
|
+ makeSettingsRow(localizationKey: "Terms of Use", systemImage: "doc.text", accessory: nil, tapAction: #selector(didTapTermsOfUse)),
|
|
|
+ makeSettingsRow(localizationKey: "Privacy Policy", systemImage: "shield", accessory: nil, tapAction: #selector(didTapPrivacyPolicy))
|
|
|
])
|
|
|
|
|
|
let aboutStack = NSStackView(views: [aboutTitle, aboutSection])
|
|
|
@@ -1823,7 +1926,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
private func makeAppearanceModeSegment() -> NSSegmentedControl {
|
|
|
let segment = NSSegmentedControl(
|
|
|
- labels: ["System", "Light", "Dark"],
|
|
|
+ labels: [L("System"), L("Light"), L("Dark")],
|
|
|
trackingMode: .selectOne,
|
|
|
target: self,
|
|
|
action: #selector(appearanceModeChanged(_:))
|
|
|
@@ -1841,30 +1944,24 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
AppAppearanceManager.shared.mode = mode
|
|
|
}
|
|
|
|
|
|
- private static let languageUserDefaultsKey = "com.appforindeed.preferredLanguage"
|
|
|
-
|
|
|
- private static let supportedLanguages: [(code: String, title: String)] = [
|
|
|
- ("en", "English")
|
|
|
- ]
|
|
|
-
|
|
|
private func makeLanguagePopUp() -> NSPopUpButton {
|
|
|
let popup = NSPopUpButton(frame: .zero, pullsDown: false)
|
|
|
popup.translatesAutoresizingMaskIntoConstraints = false
|
|
|
popup.removeAllItems()
|
|
|
|
|
|
- for lang in Self.supportedLanguages {
|
|
|
- popup.addItem(withTitle: lang.title)
|
|
|
- popup.lastItem?.representedObject = lang.code
|
|
|
+ for language in AppLanguage.allCases {
|
|
|
+ popup.addItem(withTitle: language.localizedDisplayName)
|
|
|
+ popup.lastItem?.representedObject = language.localeIdentifier
|
|
|
}
|
|
|
|
|
|
- let saved = UserDefaults.standard.string(forKey: Self.languageUserDefaultsKey) ?? "en"
|
|
|
- if let index = Self.supportedLanguages.firstIndex(where: { $0.code == saved }) {
|
|
|
+ let currentCode = AppLanguageManager.shared.current.localeIdentifier
|
|
|
+ if let index = AppLanguage.allCases.firstIndex(where: { $0.localeIdentifier == currentCode }) {
|
|
|
popup.selectItem(at: index)
|
|
|
}
|
|
|
|
|
|
popup.target = self
|
|
|
popup.action = #selector(languageChanged(_:))
|
|
|
- popup.isEnabled = !Self.supportedLanguages.isEmpty
|
|
|
+ popup.isEnabled = !AppLanguage.allCases.isEmpty
|
|
|
popup.setContentHuggingPriority(.required, for: .horizontal)
|
|
|
popup.setContentCompressionResistancePriority(.required, for: .horizontal)
|
|
|
return popup
|
|
|
@@ -1872,8 +1969,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
@objc private func languageChanged(_ sender: NSPopUpButton) {
|
|
|
guard let code = sender.selectedItem?.representedObject as? String else { return }
|
|
|
- UserDefaults.standard.set(code, forKey: Self.languageUserDefaultsKey)
|
|
|
- UserDefaults.standard.set([code], forKey: "AppleLanguages")
|
|
|
+ AppLanguageManager.shared.setLanguage(code: code)
|
|
|
}
|
|
|
|
|
|
private func makeSettingsSection(rows: [NSView]) -> NSView {
|
|
|
@@ -1912,7 +2008,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
return section
|
|
|
}
|
|
|
|
|
|
- private func makeSettingsRow(title: String, systemImage: String, accessory: NSView?, tapAction: Selector? = nil) -> NSView {
|
|
|
+ private func makeSettingsRow(localizationKey: String, systemImage: String, accessory: NSView?, tapAction: Selector? = nil) -> NSView {
|
|
|
let row = NSView()
|
|
|
row.translatesAutoresizingMaskIntoConstraints = false
|
|
|
row.wantsLayer = true
|
|
|
@@ -1927,14 +2023,14 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
let icon = NSImageView()
|
|
|
icon.translatesAutoresizingMaskIntoConstraints = false
|
|
|
icon.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 13, weight: .medium)
|
|
|
- icon.image = NSImage(systemSymbolName: systemImage, accessibilityDescription: title)
|
|
|
+ icon.image = NSImage(systemSymbolName: systemImage, accessibilityDescription: L(localizationKey))
|
|
|
icon.contentTintColor = Theme.brandBlue
|
|
|
|
|
|
- let titleLabel = NSTextField(labelWithString: title)
|
|
|
+ let titleLabel = NSTextField(labelWithString: L(localizationKey))
|
|
|
titleLabel.font = .systemFont(ofSize: 14, weight: .medium)
|
|
|
titleLabel.textColor = Theme.primaryText
|
|
|
titleLabel.alignment = .left
|
|
|
- titleLabel.identifier = NSUserInterfaceItemIdentifier(SettingsAppearanceID.rowTitle)
|
|
|
+ titleLabel.identifier = NSUserInterfaceItemIdentifier("\(SettingsAppearanceID.rowTitle).\(localizationKey)")
|
|
|
|
|
|
let rowStack = NSStackView()
|
|
|
rowStack.orientation = .horizontal
|
|
|
@@ -1997,8 +2093,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
$0.removeFromSuperview()
|
|
|
}
|
|
|
if savedJobOrder.isEmpty {
|
|
|
- savedJobsPageSubtitleLabel.stringValue = "Save jobs from Home to see them here."
|
|
|
- let empty = NSTextField(wrappingLabelWithString: "No saved jobs yet. Search on Home, then tap Save on a listing.")
|
|
|
+ savedJobsPageSubtitleLabel.stringValue = L("Save jobs from Home to see them here.")
|
|
|
+ let empty = NSTextField(wrappingLabelWithString: L("No saved jobs yet. Search on Home, then tap Save on a listing."))
|
|
|
empty.font = .systemFont(ofSize: 14, weight: .regular)
|
|
|
empty.textColor = Theme.secondaryText
|
|
|
empty.alignment = .left
|
|
|
@@ -2008,7 +2104,9 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
empty.widthAnchor.constraint(equalTo: savedJobsStack.widthAnchor).isActive = true
|
|
|
return
|
|
|
}
|
|
|
- savedJobsPageSubtitleLabel.stringValue = "\(savedJobOrder.count) saved \(savedJobOrder.count == 1 ? "position" : "positions")"
|
|
|
+ savedJobsPageSubtitleLabel.stringValue = savedJobOrder.count == 1
|
|
|
+ ? L("1 saved position")
|
|
|
+ : String(format: L("%d saved positions"), savedJobOrder.count)
|
|
|
for job in savedJobOrder {
|
|
|
let card = makeJobListingCard(job, context: .savedJobsPage)
|
|
|
savedJobsStack.addArrangedSubview(card)
|
|
|
@@ -2018,27 +2116,27 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
private func isSavedJobsSidebarIndex(_ index: Int) -> Bool {
|
|
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
|
- return currentSidebarItems[index].title == "Saved Jobs"
|
|
|
+ return currentSidebarItems[index].title == L("Saved Jobs")
|
|
|
}
|
|
|
|
|
|
private func isHomeSidebarIndex(_ index: Int) -> Bool {
|
|
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
|
- return currentSidebarItems[index].title == "Home"
|
|
|
+ return currentSidebarItems[index].title == L("Home")
|
|
|
}
|
|
|
|
|
|
private func isSettingsSidebarIndex(_ index: Int) -> Bool {
|
|
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
|
- return currentSidebarItems[index].title == "Settings"
|
|
|
+ return currentSidebarItems[index].title == L("Settings")
|
|
|
}
|
|
|
|
|
|
private func isCVMakerSidebarIndex(_ index: Int) -> Bool {
|
|
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
|
- return currentSidebarItems[index].title == "CV Maker"
|
|
|
+ return currentSidebarItems[index].title == L("CV Maker")
|
|
|
}
|
|
|
|
|
|
private func isProfileSidebarIndex(_ index: Int) -> Bool {
|
|
|
guard index >= 0, index < currentSidebarItems.count else { return false }
|
|
|
- return currentSidebarItems[index].title == "Profile"
|
|
|
+ return currentSidebarItems[index].title == L("Profile")
|
|
|
}
|
|
|
|
|
|
private func updateMainContentVisibility() {
|
|
|
@@ -2132,17 +2230,17 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
@objc private func didTapFeatureRole() {
|
|
|
selectFeatureShortcut(.role)
|
|
|
- focusSearchField(seed: "Find roles similar to: ")
|
|
|
+ focusSearchField(seed: L("Find roles similar to: "))
|
|
|
}
|
|
|
|
|
|
@objc private func didTapFeatureCompany() {
|
|
|
selectFeatureShortcut(.company)
|
|
|
- focusSearchField(seed: "Find jobs at company: ")
|
|
|
+ focusSearchField(seed: L("Find jobs at company: "))
|
|
|
}
|
|
|
|
|
|
@objc private func didTapFeatureSkill() {
|
|
|
selectFeatureShortcut(.skill)
|
|
|
- focusSearchField(seed: "Find jobs that require skill: ")
|
|
|
+ focusSearchField(seed: L("Find jobs that require skill: "))
|
|
|
}
|
|
|
|
|
|
private func selectFeatureShortcut(_ shortcut: FeatureShortcut) {
|
|
|
@@ -2196,7 +2294,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
@objc private func didTapMoreApps() {
|
|
|
guard let url = AppMarketingLinks.developerAppsURL else {
|
|
|
- presentAppMarketingConfigurationAlert(feature: "More Apps")
|
|
|
+ presentAppMarketingConfigurationAlert(feature: L("More Apps"))
|
|
|
return
|
|
|
}
|
|
|
NSWorkspace.shared.open(url)
|
|
|
@@ -2204,14 +2302,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
private func presentAppMarketingConfigurationAlert(feature: String) {
|
|
|
let alert = NSAlert()
|
|
|
- alert.messageText = "\(feature) isn’t available yet"
|
|
|
- alert.informativeText = """
|
|
|
- Add your Mac App Store IDs in the target’s build settings:
|
|
|
- • AppStoreAppID — numeric app ID from App Store Connect
|
|
|
- • AppStoreDeveloperID — numeric developer ID (for your other apps page)
|
|
|
- """
|
|
|
+ alert.messageText = String(format: L("%@ isn’t available yet"), feature)
|
|
|
+ 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)")
|
|
|
alert.alertStyle = .informational
|
|
|
- alert.addButton(withTitle: "OK")
|
|
|
+ alert.addButton(withTitle: L("OK"))
|
|
|
if let window {
|
|
|
alert.beginSheetModal(for: window)
|
|
|
} else {
|
|
|
@@ -2246,7 +2340,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
@objc private func didTapLoadMoreJobs() {
|
|
|
guard ensureProAccessForJobSearch() else { return }
|
|
|
- let prompt = "Show more jobs"
|
|
|
+ let prompt = L("Show more jobs")
|
|
|
guard !isAwaitingResponse, isContinuationPrompt(prompt) else { return }
|
|
|
if anchorUserJobQuery(excludingLatestUserMessage: prompt) == nil { return }
|
|
|
appendChatBubble(text: prompt, isUser: true)
|
|
|
@@ -2309,15 +2403,15 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
private func makeAssistantSearchReply(query: String, newJobsCount: Int, isContinuation: Bool) -> String {
|
|
|
if newJobsCount == 0 {
|
|
|
if isContinuation {
|
|
|
- return "I couldn't find new matches for \u{201C}\(query)\u{201D}. Try a different angle or a more specific keyword."
|
|
|
+ return String(format: L("I couldn't find new matches for “%@”. Try a different angle or a more specific keyword."), query)
|
|
|
}
|
|
|
- return "No jobs found for \u{201C}\(query)\u{201D}. Try another title, skill, company, or location."
|
|
|
+ return String(format: L("No jobs found for “%@”. Try another title, skill, company, or location."), query)
|
|
|
}
|
|
|
- let plural = newJobsCount == 1 ? "match" : "matches"
|
|
|
+ let matchWord = newJobsCount == 1 ? L("match") : L("matches")
|
|
|
if isContinuation {
|
|
|
- return "Here are \(newJobsCount) more \(plural) for \u{201C}\(query)\u{201D}."
|
|
|
+ return String(format: L("Here are %d more %@ for “%@”."), newJobsCount, matchWord, query)
|
|
|
}
|
|
|
- return "Found \(newJobsCount) \(plural) for \u{201C}\(query)\u{201D}. Tap Apply to open the listing or Save to revisit later."
|
|
|
+ return String(format: L("Found %d %@ for “%@”. Tap Apply to open the listing or Save to revisit later."), newJobsCount, matchWord, query)
|
|
|
}
|
|
|
|
|
|
private func resolvedSearchQuery(for prompt: String) -> String {
|
|
|
@@ -2347,6 +2441,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
|
|
|
private func isContinuationPrompt(_ prompt: String) -> Bool {
|
|
|
let normalized = prompt.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
|
|
|
+ let showMoreJobs = L("Show more jobs").trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
|
|
|
+ if normalized == showMoreJobs {
|
|
|
+ return true
|
|
|
+ }
|
|
|
let continuationPhrases: Set<String> = [
|
|
|
"more",
|
|
|
"show more",
|
|
|
@@ -2423,7 +2521,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
chatMessages.removeAll()
|
|
|
lastSearchResults.removeAll()
|
|
|
clearChatStack()
|
|
|
- let welcome = "Tell me what role you want and I will return job descriptions, key skills, and a quick fit summary."
|
|
|
+ let welcome = L("Tell me what role you want and I will return job descriptions, key skills, and a quick fit summary.")
|
|
|
chatMessages.append(ChatMessage(role: "assistant", content: welcome))
|
|
|
appendChatBubble(text: welcome, isUser: false)
|
|
|
}
|
|
|
@@ -2620,7 +2718,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
row.translatesAutoresizingMaskIntoConstraints = false
|
|
|
let button = HoverableButton()
|
|
|
button.pointerCursor = true
|
|
|
- button.title = "Show more jobs"
|
|
|
+ button.title = L("Show more jobs")
|
|
|
button.font = .systemFont(ofSize: 12, weight: .semibold)
|
|
|
button.bezelStyle = .rounded
|
|
|
button.controlSize = .regular
|
|
|
@@ -2730,10 +2828,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
rowHost.layer?.cornerRadius = 8
|
|
|
rowHost.restingBackgroundColor = isSelected ? Theme.selectionFill : nil
|
|
|
rowHost.hoverBackgroundColor = isSelected ? Theme.selectionFillHover : Theme.sidebarRowHoverFill
|
|
|
- rowHost.setAccessibilityLabel("Indeed")
|
|
|
+ rowHost.setAccessibilityLabel(L("Indeed"))
|
|
|
rowHost.setAccessibilityRole(.button)
|
|
|
rowHost.setAccessibilitySelected(isSelected)
|
|
|
- rowHost.setAccessibilityHelp("Open Indeed to search and apply for jobs")
|
|
|
+ rowHost.setAccessibilityHelp(L("Open Indeed to search and apply for jobs"))
|
|
|
|
|
|
let row = NSStackView()
|
|
|
row.orientation = .horizontal
|
|
|
@@ -2749,7 +2847,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
icon.widthAnchor.constraint(equalToConstant: Self.sidebarNavIconSize).isActive = true
|
|
|
icon.heightAnchor.constraint(equalToConstant: Self.sidebarNavIconSize).isActive = true
|
|
|
|
|
|
- let text = NSTextField(labelWithString: "Indeed")
|
|
|
+ let text = NSTextField(labelWithString: L("Indeed"))
|
|
|
text.font = .systemFont(ofSize: 14, weight: .medium)
|
|
|
text.textColor = isSelected ? Theme.brandBlue : Theme.secondaryText
|
|
|
text.refusesFirstResponder = true
|
|
|
@@ -2859,7 +2957,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
let sidebarHorizontalInset = sidebar.edgeInsets.left + sidebar.edgeInsets.right
|
|
|
rowHost.widthAnchor.constraint(equalTo: sidebar.widthAnchor, constant: -sidebarHorizontalInset).isActive = true
|
|
|
|
|
|
- if item.title == "Home" {
|
|
|
+ if item.title == L("Home") {
|
|
|
addIndeedSidebarLaunchRow()
|
|
|
}
|
|
|
}
|
|
|
@@ -2896,7 +2994,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
proIcon.image = NSImage(systemSymbolName: "sparkles", accessibilityDescription: nil)
|
|
|
proIcon.contentTintColor = Theme.proAccent
|
|
|
|
|
|
- let proEyebrow = NSTextField(labelWithString: "Premium")
|
|
|
+ let proEyebrow = NSTextField(labelWithString: L("Premium"))
|
|
|
proEyebrow.font = .systemFont(ofSize: 11, weight: .heavy)
|
|
|
proEyebrow.textColor = Theme.proAccent
|
|
|
proEyebrow.alignment = .center
|
|
|
@@ -2906,12 +3004,12 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
eyebrowRow.spacing = 6
|
|
|
eyebrowRow.alignment = .centerY
|
|
|
|
|
|
- let headline = NSTextField(labelWithString: "Upgrade to Pro")
|
|
|
+ let headline = NSTextField(labelWithString: L("Upgrade to Pro"))
|
|
|
headline.font = .systemFont(ofSize: 16, weight: .bold)
|
|
|
headline.textColor = Theme.primaryText
|
|
|
headline.alignment = .center
|
|
|
|
|
|
- let upgradeDescription = NSTextField(wrappingLabelWithString: "Unlimited AI matches, smart alerts, and interview prep—all in one place.")
|
|
|
+ let upgradeDescription = NSTextField(wrappingLabelWithString: L("Unlimited AI matches, smart alerts, and interview prep—all in one place."))
|
|
|
upgradeDescription.font = .systemFont(ofSize: 12, weight: .regular)
|
|
|
upgradeDescription.textColor = Theme.secondaryText
|
|
|
upgradeDescription.alignment = .center
|
|
|
@@ -2920,7 +3018,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
|
let innerContentWidth = cardWidth - 28
|
|
|
upgradeDescription.preferredMaxLayoutWidth = innerContentWidth
|
|
|
|
|
|
- let upgradeButton = HoverableButton(title: "Try Pro", target: self, action: #selector(didTapUpgradeToPro))
|
|
|
+ let upgradeButton = HoverableButton(title: L("Try Pro"), target: self, action: #selector(didTapUpgradeToPro))
|
|
|
upgradeButton.isBordered = false
|
|
|
upgradeButton.bezelStyle = .rounded
|
|
|
upgradeButton.font = .systemFont(ofSize: 13, weight: .bold)
|
|
|
@@ -3051,7 +3149,7 @@ private final class OpenAIJobSearchService {
|
|
|
completion(.failure(NSError(
|
|
|
domain: "OpenAIJobSearchService",
|
|
|
code: 1,
|
|
|
- userInfo: [NSLocalizedDescriptionKey: "Job search is unavailable."]
|
|
|
+ userInfo: [NSLocalizedDescriptionKey: L("Job search is unavailable.")]
|
|
|
)))
|
|
|
return
|
|
|
}
|