Skip to content

Commit

Permalink
trans_buttonCallMe
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Aug 12, 2016
1 parent 552c968 commit f8e7c00
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
7 changes: 7 additions & 0 deletions Yep/Extensions/String+Trans.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions Yep/ViewControllers/Login/LoginVerifyMobileViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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()
}

Expand All @@ -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
}
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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()
}

Expand All @@ -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
}
Expand All @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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()
}

Expand All @@ -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
}
Expand All @@ -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()
}
}
Expand Down
2 changes: 1 addition & 1 deletion Yep/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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!";
Expand Down
2 changes: 1 addition & 1 deletion Yep/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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!" = "取消推荐话题失败!";
Expand Down

0 comments on commit f8e7c00

Please sign in to comment.