From 4e5c7ce37a647dda0c7629695074774d04dff893 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sat, 21 Sep 2019 12:44:01 -0700 Subject: [PATCH] Localization! --- Clocker/Clocker/en.lproj/Localizable.strings | 93 +++++++++++++++++++ .../FinalOnboardingViewController.swift | 8 +- .../OnboardingParentViewController.swift | 6 +- .../OnboardingPermissionsViewController.swift | 30 +++--- .../OnboardingSearchController.swift | 9 +- .../StartAtLoginViewController.swift | 6 +- Clocker/Overall App/AppDefaults.swift | 6 ++ .../Panel/Notes Popover/NotesPopover.swift | 4 +- Clocker/Panel/ParentPanelController.swift | 9 +- Clocker/Panel/UI/NoTimezoneView.swift | 6 +- .../About/AboutViewController.swift | 2 +- .../AppFeedbackWindowController.swift | 6 +- .../Appearance/AppearanceViewController.swift | 31 +++---- .../Calendar/CalendarViewController.swift | 24 ++--- .../General/PreferencesViewController.swift | 6 +- .../PermissionsViewController.swift | 4 +- 16 files changed, 177 insertions(+), 73 deletions(-) diff --git a/Clocker/Clocker/en.lproj/Localizable.strings b/Clocker/Clocker/en.lproj/Localizable.strings index 37f68a0..a3ad658 100644 --- a/Clocker/Clocker/en.lproj/Localizable.strings +++ b/Clocker/Clocker/en.lproj/Localizable.strings @@ -56,3 +56,96 @@ "Add Button Title" = "Add"; "Close Button Title" = "Close"; +// Onboarding +"Open Clocker At Login" = "Open Clocker At Login"; +"Launch Clocker" = "Launch Clocker"; + +// Welcome Onboarding +"It only takes 3 steps to set up Clocker." = "It only takes 3 steps to setup Clocker."; +"Get Started" = "Get Started"; + +// Permissions +"Calendar Access Title" = "Calendar Access"; +"Reminders Access Title" = "Reminders Access"; +"Later Config Description" = "These can be configured later in System Preferences."; +"Back" = "Back"; +"Continue" = "Continue"; +"Clocker is more useful when it can display events from your calendars." = "Clocker is more useful when it can display events from your calendars."; +"Clocker is more useful when it can display events from your calendars. You can change this setting in System Preferences › Security & Privacy › Privacy." = "Clocker is more useful when it can display events from your calendars. You can change this setting in System Preferences › Security & Privacy › Privacy."; +"Launch Preferences" = "Launch Preferences"; +"Grant Access" = "Grant Access"; +"Upcoming events from your personal and shared calendars can be shown in the menubar and the panel." = "Upcoming events from your personal and shared calendars can be shown in the menubar and the panel."; +"Granted" = "Granted"; +"Denied" = "Denied"; +"Grant" = "Grant"; +"Unexpected" = "Unexpected"; + +// Onboarding Search +"Quick Add Locations" = "Quick Add Locations"; +"More search options in Clocker Preferences." = "More search options in Clocker Preferences."; +"Search Locations" = "Search Locations"; + +// Start at Login +"Launch at Login" = "Launch at Login"; +"This can be configured later in Clocker Preferences." = "This can be configured later in Clocker Preferences."; +"Should Clocker open automatically on startup?" = "Should Clocker open automatically on startup?"; + +// Final Onboarding Screen +"You're all set!" = "You're all set!"; +"Thank you for the details." = "Thank you for the details."; +"You'll see a clock icon in your Menu Bar when you launch the app. If you'd like to see a dock icon, go to Preferences." = "You'll see a clock icon in your Menu Bar when you launch the app. If you'd like to see a dock icon, go to Preferences."; +"If you'd like to help us localize the app in your language or receive infrequent app-related updates, please enter your email!" = "If you'd like to help us localize the app in your language or receive infrequent app-related updates, please enter your email!"; + +// Appearance Tab +"Panel Theme" = "Panel Theme"; +"Favourite a timezone to enable menubar display options." = "Favourite a timezone to enable menubar display options."; +"Main Panel Options" = "Main Panel Options"; +"Time Format" = "Time Format"; +"Day Display Options" = "Day Display Options"; +"Show Future Slider" = "Show Future Slider"; +"Show Sunrise/Sunset" = "Show Sunrise/Sunset"; +"Display the time in seconds" = "Display the time in seconds"; +"Larger Text" = "Larger Text"; +"Future Slider Range" = "Future Slider Range"; +"Include Date" = "Include Date"; +"Include Day" = "Include Day"; +"Include Place Name" = "Include Place Name"; +"Menubar Display Options" = "Menubar Display Options"; +"Menubar Mode" = "Menubar Mode"; + +// Empty View +"No places added" = "No places added"; + +// Panel +"No upcoming event." = "No upcoming event."; +"You have no events scheduled for tomorrow." = "You have no events scheduled for tomorrow."; + +// Review +"Enjoy using Clocker?" = "Enjoy using Clocker?"; + +// App Feedback +"Tell us what you think!" = "Tell us what you think!"; +"Contact Information (Optional)" = "Contact Information (Optional)"; +"Contact fields are optional! Your contact information will let us contact you in case we need more information or can help!" = "Contact fields are optional! Your contact information will let us contact you in case we need more information or can help!"; + +// About View Screen +"Feedback is always welcome:" = "Feedback is always welcome:"; + +// Calendars View +"Upcoming Event View Options" = "Upcoming Event View Options"; +"Show Upcoming Event View" = "Show Upcoming Event View"; +"Show All Day Meetings" = "Show All Day Meetings"; +"Show Next Meeting Title in Menubar" = "Show Next Meeting Title in Menubar"; +"Truncate menubar text longer than" = "Truncate menubar text longer than"; +"characters" = "characters"; +"Show events from" = "Show events from"; +"If meeting title is \"Meeting with Neel\" and truncate length is set to 5, text in menubar will appear as \"Meeti...\"" = "If meeting title is \"Meeting with Neel\" and truncate length is set to 5, text in menubar will appear as \"Meeti...\""; + +// Notes Popover +"Reminder Set" = "Reminder Set"; +"Successfully set." = "Successfully set."; + +// Errors +"You're offline, maybe?" = "You're offline, maybe?"; +"Try again, maybe?" = "Try again, maybe?"; +"The Internet connection appears to be offline." = "The Internet connection appears to be offline."; diff --git a/Clocker/Onboarding/FinalOnboardingViewController.swift b/Clocker/Onboarding/FinalOnboardingViewController.swift index 8a8a328..5746887 100644 --- a/Clocker/Onboarding/FinalOnboardingViewController.swift +++ b/Clocker/Onboarding/FinalOnboardingViewController.swift @@ -39,11 +39,11 @@ class FinalOnboardingViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() - titleLabel.stringValue = "You're all set!" - subtitleLabel.stringValue = "Thank you for the details." - accesoryLabel.stringValue = "You'll see a clock icon in your Menu Bar when you launch the app. If you'd like to see a dock icon, go to Preferences." + titleLabel.stringValue = "You're all set!".localized() + subtitleLabel.stringValue = "Thank you for the details.".localized() + accesoryLabel.stringValue = "You'll see a clock icon in your Menu Bar when you launch the app. If you'd like to see a dock icon, go to Preferences.".localized() accessoryImageView.image = Themer.shared().menubarOnboardingImage() - emailExplanationLabel.stringValue = "If you'd like to help us localize the app in your language or receive infrequent app-related updates, please enter your email!" + emailExplanationLabel.stringValue = "If you'd like to help us localize the app in your language or receive infrequent app-related updates, please enter your email!".localized() } override func viewWillAppear() { diff --git a/Clocker/Onboarding/OnboardingParentViewController.swift b/Clocker/Onboarding/OnboardingParentViewController.swift index 654ce8d..cf7bf17 100644 --- a/Clocker/Onboarding/OnboardingParentViewController.swift +++ b/Clocker/Onboarding/OnboardingParentViewController.swift @@ -143,7 +143,7 @@ class OnboardingParentViewController: NSViewController { options: .slideLeft) { self.backButton.tag = OnboardingType.permissions.rawValue self.positiveButton.tag = OnboardingType.launchAtLogin.rawValue - self.positiveButton.title = "Open Clocker At Login" + self.positiveButton.title = "Open Clocker At Login".localized() self.negativeButton.isHidden = false } } @@ -182,7 +182,7 @@ class OnboardingParentViewController: NSViewController { options: .slideLeft) { self.backButton.tag = OnboardingType.search.rawValue self.positiveButton.tag = OnboardingType.final.rawValue - self.positiveButton.title = "Launch Clocker" + self.positiveButton.title = "Launch Clocker".localized() } } @@ -248,7 +248,7 @@ class OnboardingParentViewController: NSViewController { options: .slideRight) { self.positiveButton.tag = OnboardingType.launchAtLogin.rawValue self.backButton.tag = OnboardingType.permissions.rawValue - self.positiveButton.title = "Open Clocker At Login" + self.positiveButton.title = "Open Clocker At Login".localized() self.negativeButton.isHidden = false } } diff --git a/Clocker/Onboarding/OnboardingPermissionsViewController.swift b/Clocker/Onboarding/OnboardingPermissionsViewController.swift index b59d760..6d0820e 100644 --- a/Clocker/Onboarding/OnboardingPermissionsViewController.swift +++ b/Clocker/Onboarding/OnboardingPermissionsViewController.swift @@ -46,7 +46,7 @@ class OnboardingPermissionsViewController: NSViewController { calendarHeaderLabel.stringValue = NSLocalizedString("Calendar Access Title", comment: "Title for Calendar access label") - calendarDetailLabel.stringValue = "Upcoming events from your personal and shared calendars can be shown in the menubar and the panel." + calendarDetailLabel.stringValue = "Upcoming events from your personal and shared calendars can be shown in the menubar and the panel.".localized() privacyLabel.stringValue = CLEmptyString @@ -67,23 +67,23 @@ class OnboardingPermissionsViewController: NSViewController { } */ if EventCenter.sharedCenter().calendarAccessGranted() { - calendarGrantButton.title = "Granted" + calendarGrantButton.title = "Granted".localized() } else if EventCenter.sharedCenter().calendarAccessDenied() { - calendarGrantButton.title = "Denied" + calendarGrantButton.title = "Denied".localized() } else if EventCenter.sharedCenter().calendarAccessNotDetermined() { - calendarGrantButton.title = "Grant" + calendarGrantButton.title = "Grant".localized() } else { - calendarGrantButton.title = "Unexpected" + calendarGrantButton.title = "Unexpected".localized() } if EventCenter.sharedCenter().reminderAccessGranted() { - reminderGrantButton.title = "Granted" + reminderGrantButton.title = "Granted".localized() } else if EventCenter.sharedCenter().reminderAccessDenied() { - reminderGrantButton.title = "Denied" + reminderGrantButton.title = "Denied".localized() } else if EventCenter.sharedCenter().reminderAccessNotDetermined() { - reminderGrantButton.title = "Grant" + reminderGrantButton.title = "Grant".localized() } else { - reminderGrantButton.title = "Unexpected" + reminderGrantButton.title = "Unexpected".localized() } } @@ -100,7 +100,7 @@ class OnboardingPermissionsViewController: NSViewController { self.calendarActivityIndicator.stopAnimation(nil) if granted { - self.calendarGrantButton.title = "Granted" + self.calendarGrantButton.title = "Granted".localized() self.view.window?.orderBack(nil) NSApp.activate(ignoringOtherApps: true) @@ -114,9 +114,9 @@ class OnboardingPermissionsViewController: NSViewController { } }) } else if eventCenter.calendarAccessGranted() { - calendarGrantButton.title = "Granted" + calendarGrantButton.title = "Granted".localized() } else { - calendarGrantButton.title = "Denied" + calendarGrantButton.title = "Denied".localized() } } @@ -137,16 +137,16 @@ class OnboardingPermissionsViewController: NSViewController { self.view.window?.orderBack(nil) NSApp.activate(ignoringOtherApps: true) - self.reminderGrantButton.title = "Granted" + self.reminderGrantButton.title = "Granted".localized() } } else { Logger.log(object: ["Reminder Access Not Granted": "YES"], for: "Reminder Access Not Granted") } }) } else if eventCenter.reminderAccessGranted() { - reminderGrantButton.title = "Granted" + reminderGrantButton.title = "Granted".localized() } else { - reminderGrantButton.title = "Denied" + reminderGrantButton.title = "Denied".localized() } } } diff --git a/Clocker/Onboarding/OnboardingSearchController.swift b/Clocker/Onboarding/OnboardingSearchController.swift index 60fd0f5..553a549 100644 --- a/Clocker/Onboarding/OnboardingSearchController.swift +++ b/Clocker/Onboarding/OnboardingSearchController.swift @@ -180,7 +180,8 @@ class OnboardingSearchController: NSViewController { self.accessoryLabel.stringValue = "Added \(filteredAddress)." self.undoButton.isHidden = false - Logger.log(object: ["Place Name": filteredAddress], for: "Added Timezone while Onboarding") + Logger.log(object: ["Place Name": filteredAddress], + for: "Added Timezone while Onboarding") } // Cleanup. @@ -207,10 +208,10 @@ class OnboardingSearchController: NSViewController { "Sydney NSW", "Berlin"] private func setup() { - appName.stringValue = "Quick Add Locations" - onboardingTypeLabel.stringValue = "More search options in Clocker Preferences." + appName.stringValue = "Quick Add Locations".localized() + onboardingTypeLabel.stringValue = "More search options in Clocker Preferences.".localized() setInfoLabel(CLEmptyString) - searchBar.placeholderString = "Search Locations" + searchBar.placeholderString = "Search Locations".localized() resultsTableView.backgroundColor = Themer.shared().mainBackgroundColor() resultsTableView.enclosingScrollView?.backgroundColor = Themer.shared().mainBackgroundColor() diff --git a/Clocker/Onboarding/StartAtLoginViewController.swift b/Clocker/Onboarding/StartAtLoginViewController.swift index f61d954..1e6c4ad 100644 --- a/Clocker/Onboarding/StartAtLoginViewController.swift +++ b/Clocker/Onboarding/StartAtLoginViewController.swift @@ -14,11 +14,11 @@ class StartAtLoginViewController: NSViewController { } private func setup() { - appName.stringValue = "Launch at Login" - onboardingType.stringValue = "This can be configured later in Clocker Preferences." + appName.stringValue = "Launch at Login".localized() + onboardingType.stringValue = "This can be configured later in Clocker Preferences.".localized() // स्टार्टअप पर स्वचालित रूप से ऐप खोलना चाहिए - accessoryLabel.stringValue = "Should Clocker open automatically on startup?" + accessoryLabel.stringValue = "Should Clocker open automatically on startup?".localized() privacyLabel.stringValue = " " [privacyLabel, accessoryLabel, onboardingType, appName].forEach { $0?.textColor = Themer.shared().mainTextColor() } diff --git a/Clocker/Overall App/AppDefaults.swift b/Clocker/Overall App/AppDefaults.swift index 0814054..d7505a3 100644 --- a/Clocker/Overall App/AppDefaults.swift +++ b/Clocker/Overall App/AppDefaults.swift @@ -135,6 +135,12 @@ class AppDefaults { } } +extension String { + func localized() -> String { + return NSLocalizedString(self, comment: "Title for \(self)") + } +} + extension UserDefaults { // Use this with caution. Exposing this for debugging purposes only. func wipe() { diff --git a/Clocker/Panel/Notes Popover/NotesPopover.swift b/Clocker/Panel/Notes Popover/NotesPopover.swift index 4f9de6b..2c88784 100644 --- a/Clocker/Panel/Notes Popover/NotesPopover.swift +++ b/Clocker/Panel/Notes Popover/NotesPopover.swift @@ -422,8 +422,8 @@ class NotesPopover: NSViewController { private func showSuccessMessage() { let reminderNotification = NSUserNotification() - reminderNotification.title = "Reminder Set" - reminderNotification.subtitle = "Successfully set." + reminderNotification.title = "Reminder Set".localized() + reminderNotification.subtitle = "Successfully set.".localized() NSUserNotificationCenter.default.scheduleNotification(reminderNotification) } diff --git a/Clocker/Panel/ParentPanelController.swift b/Clocker/Panel/ParentPanelController.swift index 09f7950..f3f74e8 100644 --- a/Clocker/Panel/ParentPanelController.swift +++ b/Clocker/Panel/ParentPanelController.swift @@ -788,7 +788,8 @@ class ParentPanelController: NSWindowController { return } - nextEventLabel.stringValue = "No upcoming event." + nextEventLabel.stringValue = NSLocalizedString("No upcoming event.", + comment: "Title when there's no upcoming event") calendarColorView.layer?.backgroundColor = NSColor(red: 97 / 255.0, green: 194 / 255.0, blue: 80 / 255.0, alpha: 1.0).cgColor let events = eventCenter.filteredEvents[NSCalendar.autoupdatingCurrent.startOfDay(for: tomorrowDate)] @@ -799,7 +800,8 @@ class ParentPanelController: NSWindowController { } else if let first = events?.first?.event.title { setCalendarButtonTitle(buttonTitle: "\(first) coming up.") } else { - setCalendarButtonTitle(buttonTitle: "You have no events scheduled for tomorrow.") + setCalendarButtonTitle(buttonTitle: NSLocalizedString("You have no events scheduled for tomorrow.", + comment: "Title when there's no event scheduled for tomorrow")) } } @@ -856,7 +858,8 @@ class ParentPanelController: NSWindowController { private func updateReviewView() { reviewView.isHidden = true showReviewCell = false - leftField.stringValue = "Enjoy using Clocker?" + leftField.stringValue = NSLocalizedString("Enjoy using Clocker", + comment: "Title asking users if they like the app") let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .center diff --git a/Clocker/Panel/UI/NoTimezoneView.swift b/Clocker/Panel/UI/NoTimezoneView.swift index 83b1d66..e75ef83 100644 --- a/Clocker/Panel/UI/NoTimezoneView.swift +++ b/Clocker/Panel/UI/NoTimezoneView.swift @@ -28,8 +28,10 @@ class NoTimezoneView: NSView { height: 200)) messageField.wantsLayer = true messageField.setAccessibilityIdentifier("NoTimezoneMessage") - messageField.placeholderString = "No places added" - messageField.stringValue = "No places added" + messageField.placeholderString = NSLocalizedString("No places added", + comment: "Subtitle for no places added") + messageField.stringValue = NSLocalizedString("No places added", + comment: "Subtitle for no places added") messageField.isBordered = false messageField.isEditable = false messageField.maximumNumberOfLines = 2 diff --git a/Clocker/Preferences/About/AboutViewController.swift b/Clocker/Preferences/About/AboutViewController.swift index 1a6d7a0..24cda8b 100644 --- a/Clocker/Preferences/About/AboutViewController.swift +++ b/Clocker/Preferences/About/AboutViewController.swift @@ -140,7 +140,7 @@ class AboutViewController: ParentViewController { @IBOutlet var feedbackLabel: NSTextField! private func setup() { - feedbackLabel.stringValue = "Feedback is always welcome:" + feedbackLabel.stringValue = "Feedback is always welcome:".localized() feedbackLabel.textColor = Themer.shared().mainTextColor() versionField.textColor = Themer.shared().mainTextColor() underlineTextForActionButton() diff --git a/Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift b/Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift index 417e24c..55fb716 100644 --- a/Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift +++ b/Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift @@ -209,9 +209,9 @@ class AppFeedbackWindowController: NSWindowController { @IBOutlet var accessoryInfo: NSTextField! private func setup() { - headerLabel.stringValue = "Tell us what you think!" - contactBox.title = "Contact Information (Optional)" - accessoryInfo.stringValue = "Contact fields are optional! Your contact information will let us contact you in case we need more information or can help!" + headerLabel.stringValue = "Tell us what you think!".localized() + contactBox.title = "Contact Information (Optional)".localized() + accessoryInfo.stringValue = "Contact fields are optional! Your contact information will let us contact you in case we need more information or can help!".localized() [headerLabel, accessoryInfo].forEach { $0?.textColor = Themer.shared().mainTextColor() } diff --git a/Clocker/Preferences/Appearance/AppearanceViewController.swift b/Clocker/Preferences/Appearance/AppearanceViewController.swift index d047a5f..727f31e 100644 --- a/Clocker/Preferences/Appearance/AppearanceViewController.swift +++ b/Clocker/Preferences/Appearance/AppearanceViewController.swift @@ -18,7 +18,7 @@ class AppearanceViewController: ParentViewController { override func viewDidLoad() { super.viewDidLoad() - informationLabel.stringValue = "Favourite a timezone to enable menubar display options." + informationLabel.stringValue = "Favourite a timezone to enable menubar display options.".localized() informationLabel.textColor = NSColor.secondaryLabelColor informationLabel.setAccessibilityIdentifier("InformationLabel") @@ -97,21 +97,20 @@ class AppearanceViewController: ParentViewController { @IBOutlet var menubarModeLabel: NSTextField! private func setup() { - headerLabel.stringValue = "Main Panel Options" - timeFormatLabel.stringValue = "Time Format" - panelTheme.stringValue = NSLocalizedString("Panel Theme", - comment: "String for theme") - dayDisplayOptionsLabel.stringValue = "Day Display Options" - showSliderLabel.stringValue = "Show Future Slider" - showSunriseLabel.stringValue = "Show Sunrise/Sunset" - showSecondsLabel.stringValue = "Display the time in seconds" - largerTextLabel.stringValue = "Larger Text" - futureSliderRangeLabel.stringValue = "Future Slider Range" - includeDateLabel.stringValue = "Include Date" - includeDayLabel.stringValue = "Include Day" - includePlaceLabel.stringValue = "Include Place Name" - menubarDisplayOptionsLabel.stringValue = "Menubar Display Options" - menubarModeLabel.stringValue = "Menubar Mode" + headerLabel.stringValue = "Main Panel Options".localized() + timeFormatLabel.stringValue = "Time Format".localized() + panelTheme.stringValue = "Panel Theme".localized() + dayDisplayOptionsLabel.stringValue = "Day Display Options".localized() + showSliderLabel.stringValue = "Show Future Slider".localized() + showSunriseLabel.stringValue = "Show Sunrise/Sunset".localized() + showSecondsLabel.stringValue = "Display the time in seconds".localized() + largerTextLabel.stringValue = "Larger Text".localized() + futureSliderRangeLabel.stringValue = "Future Slider Range".localized() + includeDateLabel.stringValue = "Include Date".localized() + includeDayLabel.stringValue = "Include Day".localized() + includePlaceLabel.stringValue = "Include Place Name".localized() + menubarDisplayOptionsLabel.stringValue = "Menubar Display Options".localized() + menubarModeLabel.stringValue = "Menubar Mode".localized() [headerLabel, timeFormatLabel, panelTheme, dayDisplayOptionsLabel, showSliderLabel, showSecondsLabel, diff --git a/Clocker/Preferences/Calendar/CalendarViewController.swift b/Clocker/Preferences/Calendar/CalendarViewController.swift index cc8920f..a8ff8c4 100644 --- a/Clocker/Preferences/Calendar/CalendarViewController.swift +++ b/Clocker/Preferences/Calendar/CalendarViewController.swift @@ -100,8 +100,8 @@ class CalendarViewController: ParentViewController { noAccessView.isHidden = hasCalendarAccess if hasNotDeterminedCalendarAccess { - informationField.stringValue = "Clocker is more useful when it can display events from your calendars." - setGrantAccess(title: "Grant Access") + informationField.stringValue = "Clocker is more useful when it can display events from your calendars.".localized() + setGrantAccess(title: "Grant Access".localized()) } else if hasDeniedCalendarAccess { // The informationField text is taken care off in the XIB. Just set the grant button to empty because we can't do anything. setGrantAccess(title: CLEmptyString) @@ -127,8 +127,8 @@ class CalendarViewController: ParentViewController { } private func onCalendarAccessDenial() { - informationField.stringValue = "Clocker is more useful when it can display events from your calendars. You can change this setting in System Preferences › Security & Privacy › Privacy." - setGrantAccess(title: "Launch Preferences") + informationField.stringValue = "Clocker is more useful when it can display events from your calendars. You can change this setting in System Preferences › Security & Privacy › Privacy.".localized() + setGrantAccess(title: "Launch Preferences".localized()) // Remove upcoming event view if possible UserDefaults.standard.set("NO", forKey: CLShowUpcomingEventView) @@ -209,14 +209,14 @@ class CalendarViewController: ParentViewController { private func setup() { // Grant access button's text color is taken care above. - headerLabel.stringValue = "Upcoming Event View Options" - upcomingEventView.stringValue = "Show Upcoming Event View" - allDayMeetingsLabel.stringValue = "Show All Day Meetings" - showNextMeetingLabel.stringValue = "Show Next Meeting Title in Menubar" - truncateTextLabel.stringValue = "Truncate menubar text longer than" - charactersField.stringValue = "characters" - showEventsFromLabel.stringValue = "Show events from" - truncateAccessoryLabel.stringValue = "If meeting title is \"Meeting with Neel\" and truncate length is set to 5, text in menubar will appear as \"Meeti...\"" + headerLabel.stringValue = "Upcoming Event View Options".localized() + upcomingEventView.stringValue = "Show Upcoming Event View".localized() + allDayMeetingsLabel.stringValue = "Show All Day Meetings".localized() + showNextMeetingLabel.stringValue = "Show Next Meeting Title in Menubar".localized() + truncateTextLabel.stringValue = "Truncate menubar text longer than".localized() + charactersField.stringValue = "characters".localized() + showEventsFromLabel.stringValue = "Show events from".localized() + truncateAccessoryLabel.stringValue = "If meeting title is \"Meeting with Neel\" and truncate length is set to 5, text in menubar will appear as \"Meeti...\"".localized() [headerLabel, upcomingEventView, allDayMeetingsLabel, showNextMeetingLabel, nextMeetingAccessoryLabel, truncateTextLabel, diff --git a/Clocker/Preferences/General/PreferencesViewController.swift b/Clocker/Preferences/General/PreferencesViewController.swift index 6903295..f559da3 100644 --- a/Clocker/Preferences/General/PreferencesViewController.swift +++ b/Clocker/Preferences/General/PreferencesViewController.swift @@ -9,9 +9,9 @@ struct PreferencesConstants { comment: "Max Timezones Error Message") static let maxCharactersAllowed = NSLocalizedString("Max Search Characters", comment: "Max Character Count Allowed Error Message") - static let noInternetConnectivityError = "You're offline, maybe?" - static let tryAgainMessage = "Try again, maybe?" - static let offlineErrorMessage = "The Internet connection appears to be offline." + static let noInternetConnectivityError = "You're offline, maybe?".localized() + static let tryAgainMessage = "Try again, maybe?".localized() + static let offlineErrorMessage = "The Internet connection appears to be offline.".localized() static let hotKeyPathIdentifier = "values.globalPing" } diff --git a/Clocker/Preferences/Permissions/PermissionsViewController.swift b/Clocker/Preferences/Permissions/PermissionsViewController.swift index 3f62ce9..5e8794b 100644 --- a/Clocker/Preferences/Permissions/PermissionsViewController.swift +++ b/Clocker/Preferences/Permissions/PermissionsViewController.swift @@ -90,7 +90,7 @@ class PermissionsViewController: ParentViewController { calendarButton.title = NSLocalizedString("Grant Button Text", comment: "Grant Button Text") } else { - calendarButton.title = "Unexpected" + calendarButton.title = "Unexpected".localized() } if EventCenter.sharedCenter().reminderAccessGranted() { @@ -103,7 +103,7 @@ class PermissionsViewController: ParentViewController { remindersButton.title = NSLocalizedString("Grant Button Text", comment: "Grant Button Text") } else { - remindersButton.title = "Unexpected" + remindersButton.title = "Unexpected".localized() } }