diff --git a/PasscodeLock/Functions.swift b/PasscodeLock/Functions.swift index adb03903..df0b56bb 100644 --- a/PasscodeLock/Functions.swift +++ b/PasscodeLock/Functions.swift @@ -11,9 +11,9 @@ import Foundation func localizedStringFor(key: String, comment: String) -> String { let name = "PasscodeLock" - let bundle = bundleForResource(name, ofType: "strings") + let defaultString = NSLocalizedString(key, tableName: name, bundle: NSBundle(forClass: PasscodeLock.self), comment: comment) - return NSLocalizedString(key, tableName: name, bundle: bundle, comment: comment) + return NSLocalizedString(key, value: defaultString, tableName: name, bundle: NSBundle.mainBundle(), comment: comment) } func bundleForResource(name: String, ofType type: String) -> NSBundle { diff --git a/PasscodeLock/PasscodeLockViewController.swift b/PasscodeLock/PasscodeLockViewController.swift index 095f10f2..bfe6e701 100644 --- a/PasscodeLock/PasscodeLockViewController.swift +++ b/PasscodeLock/PasscodeLockViewController.swift @@ -84,6 +84,9 @@ public class PasscodeLockViewController: UIViewController, PasscodeLockTypeDeleg super.viewDidLoad() updatePasscodeView() + + cancelButton?.setTitle(localizedStringFor("PasscodeLockCancelButtonTitle", comment: "Cancel Button Title"), forState: .Normal) + deleteSignButton?.setTitle(localizedStringFor("PasscodeLockDeleteButtonTitle", comment: "Delete Button Title"), forState: .Normal) deleteSignButton?.enabled = false setupEvents() diff --git a/PasscodeLock/en.lproj/PasscodeLock.strings b/PasscodeLock/en.lproj/PasscodeLock.strings index f71ef86c..8ae4e796 100755 --- a/PasscodeLock/en.lproj/PasscodeLock.strings +++ b/PasscodeLock/en.lproj/PasscodeLock.strings @@ -26,6 +26,12 @@ "PasscodeLockMismatchTitle" = "Try again"; "PasscodeLockMismatchDescription" = "Passcodes didn\'t match."; +/* Cancel Button Title */ +"PasscodeLockCancelButtonTitle" = "Cancel"; + +/* Delete Button Title */ +"PasscodeLockDeleteButtonTitle" = "Delete"; + /* Touch ID Reason */ "PasscodeLockTouchIDReason" = "Authentication required to proceed";