diff --git a/Yep/Extensions/String+Trans.swift b/Yep/Extensions/String+Trans.swift index e3dd141d1..833ec7c66 100644 --- a/Yep/Extensions/String+Trans.swift +++ b/Yep/Extensions/String+Trans.swift @@ -57,6 +57,13 @@ extension String { static var trans_promptTapNextAgreeTerms: String { return NSLocalizedString("prompt.tap_next_agree_terms", comment: "") } + + static var trans_buttonCallMe: String { + return NSLocalizedString("button.call_me", comment: "") + } + + + } extension String { diff --git a/Yep/ViewControllers/Login/LoginVerifyMobileViewController.swift b/Yep/ViewControllers/Login/LoginVerifyMobileViewController.swift index 9c79099f9..8cba0adc8 100644 --- a/Yep/ViewControllers/Login/LoginVerifyMobileViewController.swift +++ b/Yep/ViewControllers/Login/LoginVerifyMobileViewController.swift @@ -93,7 +93,7 @@ final class LoginVerifyMobileViewController: UIViewController { .addDisposableTo(disposeBag) callMePromptLabel.text = NSLocalizedString("Didn't get it?", comment: "") - callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) verifyMobileNumberPromptLabelTopConstraint.constant = Ruler.iPhoneVertical(30, 50, 60, 60).value verifyCodeTextFieldTopConstraint.constant = Ruler.iPhoneVertical(30, 40, 50, 50).value @@ -120,7 +120,7 @@ final class LoginVerifyMobileViewController: UIViewController { @objc private func tryCallMe(timer: NSTimer) { if !haveAppropriateInput { if callMeInSeconds > 1 { - let callMeInSecondsString = NSLocalizedString("Call me", comment: "") + " (\(callMeInSeconds))" + let callMeInSecondsString = String.trans_buttonCallMe + " (\(callMeInSeconds))" UIView.performWithoutAnimation { [weak self] in self?.callMeButton.setTitle(callMeInSecondsString, forState: .Normal) @@ -129,7 +129,7 @@ final class LoginVerifyMobileViewController: UIViewController { } else { UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() } @@ -154,7 +154,7 @@ final class LoginVerifyMobileViewController: UIViewController { delay(10) { UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() self?.callMeButton.enabled = true } @@ -169,7 +169,7 @@ final class LoginVerifyMobileViewController: UIViewController { SafeDispatch.async { UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() self?.callMeButton.enabled = true } diff --git a/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift b/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift index 8b01708b4..1d51dfd22 100644 --- a/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift +++ b/Yep/ViewControllers/Register/RegisterVerifyMobileViewController.swift @@ -89,7 +89,7 @@ final class RegisterVerifyMobileViewController: SegueViewController { .addDisposableTo(disposeBag) callMePromptLabel.text = NSLocalizedString("Didn't get it?", comment: "") - callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) verifyMobileNumberPromptLabelTopConstraint.constant = Ruler.iPhoneVertical(30, 50, 60, 60).value verifyCodeTextFieldTopConstraint.constant = Ruler.iPhoneVertical(30, 40, 50, 50).value @@ -118,7 +118,7 @@ final class RegisterVerifyMobileViewController: SegueViewController { @objc private func tryCallMe(timer: NSTimer) { if !haveAppropriateInput { if callMeInSeconds > 1 { - let callMeInSecondsString = NSLocalizedString("Call me", comment: "") + " (\(callMeInSeconds))" + let callMeInSecondsString = String.trans_buttonCallMe + " (\(callMeInSeconds))" UIView.performWithoutAnimation { [weak self] in self?.callMeButton.setTitle(callMeInSecondsString, forState: .Normal) @@ -127,7 +127,7 @@ final class RegisterVerifyMobileViewController: SegueViewController { } else { UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() } @@ -152,7 +152,7 @@ final class RegisterVerifyMobileViewController: SegueViewController { delay(10) { UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() self?.callMeButton.enabled = true } @@ -166,7 +166,7 @@ final class RegisterVerifyMobileViewController: SegueViewController { YepAlert.alertSorry(message: errorMessage, inViewController: self) UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() } } diff --git a/Yep/ViewControllers/VerifyChangedMobile/VerifyChangedMobileViewController.swift b/Yep/ViewControllers/VerifyChangedMobile/VerifyChangedMobileViewController.swift index f3f639a89..eb537ec8b 100644 --- a/Yep/ViewControllers/VerifyChangedMobile/VerifyChangedMobileViewController.swift +++ b/Yep/ViewControllers/VerifyChangedMobile/VerifyChangedMobileViewController.swift @@ -81,7 +81,7 @@ final class VerifyChangedMobileViewController: UIViewController { .addDisposableTo(disposeBag) callMePromptLabel.text = NSLocalizedString("Didn't get it?", comment: "") - callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) verifyMobileNumberPromptLabelTopConstraint.constant = Ruler.iPhoneVertical(30, 50, 60, 60).value verifyCodeTextFieldTopConstraint.constant = Ruler.iPhoneVertical(30, 40, 50, 50).value @@ -118,7 +118,7 @@ final class VerifyChangedMobileViewController: UIViewController { @objc private func tryCallMe(timer: NSTimer) { if !haveAppropriateInput { if callMeInSeconds > 1 { - let callMeInSecondsString = NSLocalizedString("Call me", comment: "") + " (\(callMeInSeconds))" + let callMeInSecondsString = String.trans_buttonCallMe + " (\(callMeInSeconds))" UIView.performWithoutAnimation { [weak self] in self?.callMeButton.setTitle(callMeInSecondsString, forState: .Normal) @@ -127,7 +127,7 @@ final class VerifyChangedMobileViewController: UIViewController { } else { UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() } @@ -152,7 +152,7 @@ final class VerifyChangedMobileViewController: UIViewController { delay(10) { UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() self?.callMeButton.enabled = true } @@ -167,7 +167,7 @@ final class VerifyChangedMobileViewController: UIViewController { SafeDispatch.async { UIView.performWithoutAnimation { [weak self] in - self?.callMeButton.setTitle(NSLocalizedString("Call me", comment: ""), forState: .Normal) + self?.callMeButton.setTitle(String.trans_buttonCallMe, forState: .Normal) self?.callMeButton.layoutIfNeeded() } } diff --git a/Yep/en.lproj/Localizable.strings b/Yep/en.lproj/Localizable.strings index cc0d4d63c..df27cb7ac 100644 --- a/Yep/en.lproj/Localizable.strings +++ b/Yep/en.lproj/Localizable.strings @@ -21,7 +21,7 @@ "title.blocked_users" = "Blocked Users"; "subtitle.build_world_together" = "Build world together"; "prompt.tap_next_agree_terms" = "By tapping Next you agree to our terms."; -"Call me" = "Call me"; +"button.call_me" = "Call me"; "Calling" = "Calling"; "Camera" = "Camera"; "Cancel recommended feed failed!" = "Cancel recommended feed failed!"; diff --git a/Yep/zh-Hans.lproj/Localizable.strings b/Yep/zh-Hans.lproj/Localizable.strings index 9c035ca03..061679a43 100644 --- a/Yep/zh-Hans.lproj/Localizable.strings +++ b/Yep/zh-Hans.lproj/Localizable.strings @@ -21,7 +21,7 @@ "title.blocked_users" = "被屏蔽的用户"; "subtitle.build_world_together" = "共建世界"; "prompt.tap_next_agree_terms" = "点击下一步表示您同意我们的条款。"; -"Call me" = "呼叫我"; +"button.call_me" = "呼叫我"; "Calling" = "正在呼叫"; "Camera" = "拍摄"; "Cancel recommended feed failed!" = "取消推荐话题失败!";