Browse Source

More info about localizing app!

pull/92/head
Abhishek 5 years ago
parent
commit
bedea4c5bd
  1. 4
      Clocker/AppDelegate.swift
  2. 3
      Clocker/Onboarding/FinalOnboardingViewController.swift
  3. 2
      Clocker/Onboarding/OnboardingParentViewController.swift
  4. 15
      Clocker/Preferences/About/AboutViewController.swift

4
Clocker/AppDelegate.swift

@ -41,8 +41,6 @@ open class AppDelegate: NSObject, NSApplicationDelegate {
} }
public func applicationDidFinishLaunching(_: Notification) { public func applicationDidFinishLaunching(_: Notification) {
UserDefaults.standard.wipe()
// Initializing the event store takes really long // Initializing the event store takes really long
EventCenter.sharedCenter() EventCenter.sharedCenter()
@ -108,7 +106,7 @@ open class AppDelegate: NSObject, NSApplicationDelegate {
let shouldLaunchOnboarding = (DataStore.shared().retrieve(key: CLShowOnboardingFlow) == nil && DataStore.shared().timezones().isEmpty) let shouldLaunchOnboarding = (DataStore.shared().retrieve(key: CLShowOnboardingFlow) == nil && DataStore.shared().timezones().isEmpty)
|| ProcessInfo.processInfo.arguments.contains(CLOnboaringTestsLaunchArgument) || ProcessInfo.processInfo.arguments.contains(CLOnboaringTestsLaunchArgument)
shouldLaunchOnboarding ? controller?.launch() : controller?.launch() shouldLaunchOnboarding ? controller?.launch() : continueUsually()
} }
func continueUsually() { func continueUsually() {

3
Clocker/Onboarding/FinalOnboardingViewController.swift

@ -78,6 +78,9 @@ class FinalOnboardingViewController: NSViewController {
// Log this // Log this
let custom: [String: Any] = ["Language": languageCode] let custom: [String: Any] = ["Language": languageCode]
Logger.log(object: custom, for: "Opened Localization Link") Logger.log(object: custom, for: "Opened Localization Link")
guard let parentVC = parent as? OnboardingParentViewController else { return }
parentVC.performFinalStepsBeforeFinishing()
} }
override func viewWillAppear() { override func viewWillAppear() {

2
Clocker/Onboarding/OnboardingParentViewController.swift

@ -186,7 +186,7 @@ class OnboardingParentViewController: NSViewController {
} }
} }
private func performFinalStepsBeforeFinishing() { func performFinalStepsBeforeFinishing() {
finalOnboardingVC?.sendUpEmailIfValid() finalOnboardingVC?.sendUpEmailIfValid()
positiveButton.tag = OnboardingType.complete.rawValue positiveButton.tag = OnboardingType.complete.rawValue

15
Clocker/Preferences/About/AboutViewController.swift

@ -50,7 +50,7 @@ class AboutViewController: ParentViewController {
let rangesInOrder = [NSRange(location: 3, length: 8), let rangesInOrder = [NSRange(location: 3, length: 8),
NSRange(location: 7, length: privateFeedback.attributedTitle.length - 7), NSRange(location: 7, length: privateFeedback.attributedTitle.length - 7),
NSRange(location: 27, length: 33), NSRange(location: 27, length: 33),
NSRange(location: 32, length: 30)] NSRange(location: 42, length: 14)]
let buttonsInOrder = [quickCommentAction, let buttonsInOrder = [quickCommentAction,
privateFeedback, privateFeedback,
@ -60,7 +60,7 @@ class AboutViewController: ParentViewController {
let localizedKeys = ["1. @n0shake on Twitter for quick comments", let localizedKeys = ["1. @n0shake on Twitter for quick comments",
"2. For Private Feedback", "2. For Private Feedback",
"You can support Clocker by leaving a review on the App Store! :)", "You can support Clocker by leaving a review on the App Store! :)",
"Clocker is Open Source. You can check out the source code here."] "Help localize Clocker in your language by clicking here!"]
zip(buttonsInOrder, localizedKeys).forEach { arg in zip(buttonsInOrder, localizedKeys).forEach { arg in
let (button, title) = arg let (button, title) = arg
@ -129,13 +129,14 @@ class AboutViewController: ParentViewController {
} }
@IBAction func openGitHub(_: Any) { @IBAction func openGitHub(_: Any) {
guard let githubURL = URL(string: AboutUsConstants.GitHubURL), guard let localizationURL = URL(string: AboutUsConstants.CrowdInLocalizationLink),
let countryCode = Locale.autoupdatingCurrent.regionCode else { return } let languageCode = Locale.preferredLanguages.first else { return }
NSWorkspace.shared.open(githubURL) NSWorkspace.shared.open(localizationURL)
let custom: [String: Any] = ["Country": countryCode] // Log this
Logger.log(object: custom, for: "Opened GitHub") let custom: [String: Any] = ["Language": languageCode]
Logger.log(object: custom, for: "Opened Localization Link")
} }
@IBOutlet var feedbackLabel: NSTextField! @IBOutlet var feedbackLabel: NSTextField!

Loading…
Cancel
Save