Skip to content

Commit

Permalink
big C
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Aug 15, 2016
1 parent ddfd942 commit 486d32a
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 33 deletions.
43 changes: 40 additions & 3 deletions Yep/Extensions/String+Trans.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,58 @@ extension String {
static var trans_titleChoosePhoto: String {
return NSLocalizedString("title.choose_photo", comment: "")
}
static var trans_titleChooseSkillSet: String {

static var trans_titleChooseSkillSet: String {
return NSLocalizedString("title.choose_skill_set", comment: "")
}
static var trans_titleChooseSource: String {

static var trans_titleChooseSource: String {
return NSLocalizedString("title.choose_source", comment: "")
}
static var trans_buttonChooseFromLibrary: String {

static var trans_buttonChooseFromLibrary: String {
return NSLocalizedString("button.choose_from_library", comment: "")
}

static var trans_promptChoose: String {
return NSLocalizedString("prompt.choose", comment: "")
}

static var trans_titleClearHistory: String {
return NSLocalizedString("title.clear_history", comment: "")
}

static var trans_confirm: String {
return NSLocalizedString("confirm", comment: "")
}

static var trans_titleContacts: String {
return NSLocalizedString("title.contacts", comment: "")
}

static var trans_titleCreateUsername: String {
return NSLocalizedString("title.create_username", comment: "")
}

static var trans_promptCreateFeedFailed: String {
return NSLocalizedString("prompt.create_feed_failed", comment: "")
}

static var trans_promptCreateUsernameFailed: String {
return NSLocalizedString("prompt.create_username_failed", comment: "")
}

static var trans_titleCreate: String {
return NSLocalizedString("title.create", comment: "")
}

static var trans_promptCreatorsOfBlockedFeeds: String {
return NSLocalizedString("prompt.creators_of_blocked_feeds", comment: "")
}

static var trans_promptCurrentNumber: String {
return NSLocalizedString("prompt.current_number", comment: "")
}
}

extension String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final class ChangeMobileViewController: UIViewController {

changeMobileNumberPromptLabel.text = NSLocalizedString("What's your new number?", comment: "")

currentMobileNumberPromptLabel.text = NSLocalizedString("Current number:", comment: "")
currentMobileNumberPromptLabel.text = String.trans_promptCurrentNumber
currentMobileNumberLabel.text = YepUserDefaults.fullPhoneNumber

areaCodeTextField.text = NSTimeZone.areaCode
Expand Down
4 changes: 2 additions & 2 deletions Yep/ViewControllers/Contacts/ContactsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ final class ContactsViewController: BaseViewController {
override func viewDidLoad() {
super.viewDidLoad()

navigationItem.title = NSLocalizedString("Contacts", comment: "")
navigationItem.title = String.trans_titleContacts

NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ContactsViewController.syncFriendships(_:)), name: FriendsInContactsViewController.Notification.NewFriends, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ContactsViewController.deactiveSearchController(_:)), name: YepConfig.Notification.switchedToOthersFromContactsTab, object: nil)
Expand Down Expand Up @@ -465,7 +465,7 @@ extension ContactsViewController: UITableViewDataSource, UITableViewDelegate {

tableView?.setEditing(false, animated: true)

YepAlert.confirmOrCancel(title: NSLocalizedString("Unfriend", comment: ""), message: String(format: NSLocalizedString("Do you want to unfriend with %@?", comment: ""), nickname), confirmTitle: NSLocalizedString("Confirm", comment: ""), cancelTitle: String.trans_cancel, inViewController: self, withConfirmAction: {
YepAlert.confirmOrCancel(title: NSLocalizedString("Unfriend", comment: ""), message: String(format: NSLocalizedString("Do you want to unfriend with %@?", comment: ""), nickname), confirmTitle: String.trans_confirm, cancelTitle: String.trans_cancel, inViewController: self, withConfirmAction: {

unfriend(withUserID: userID, failureHandler: { [weak self] (reason, errorMessage) in
let message = errorMessage ?? NSLocalizedString("Unfriend failed!", comment: "")
Expand Down
2 changes: 1 addition & 1 deletion Yep/ViewControllers/NewFeed/NewFeedViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ final class NewFeedViewController: SegueViewController {
defaultFailureHandler(reason: reason, errorMessage: errorMessage)

SafeDispatch.async { [weak self] in
let message = errorMessage ?? NSLocalizedString("Create feed failed!", comment: "")
let message = errorMessage ?? String.trans_promptCreateFeedFailed
self?.uploadState = .Failed(message: message)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ extension NotificationsViewController: UITableViewDataSource, UITableViewDelegat
case .CreatorsOfBlockedFeeds:

let cell: SettingsMoreCell = tableView.dequeueReusableCell()
cell.annotationLabel.text = NSLocalizedString("Creators of Blocked Feeds", comment: "")
cell.annotationLabel.text = String.trans_promptCreatorsOfBlockedFeeds
return cell
}

Expand Down
5 changes: 3 additions & 2 deletions Yep/ViewControllers/Profile/ProfileViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -691,14 +691,15 @@ final class ProfileViewController: SegueViewController {
tryShareProfile()

} else {
YepAlert.textInput(title: NSLocalizedString("Create a username", comment: ""), message: NSLocalizedString("In order to share your profile, create a unique username first.", comment: ""), placeholder: NSLocalizedString("use letters, numbers, and underscore", comment: ""), oldText: nil, confirmTitle: NSLocalizedString("Create", comment: ""), cancelTitle: String.trans_cancel, inViewController: self, withConfirmAction: { text in
YepAlert.textInput(title: String.trans_titleCreateUsername, message: NSLocalizedString("In order to share your profile, create a unique username first.", comment: ""), placeholder: NSLocalizedString("use letters, numbers, and underscore", comment: ""), oldText: nil, confirmTitle: String.trans_titleCreate, cancelTitle: String.trans_cancel, inViewController: self, withConfirmAction: { text in

let newUsername = text

updateMyselfWithInfo(["username": newUsername], failureHandler: { [weak self] reason, errorMessage in
defaultFailureHandler(reason: reason, errorMessage: errorMessage)

YepAlert.alertSorry(message: errorMessage ?? NSLocalizedString("Create username failed!", comment: ""), inViewController: self)
let message = errorMessage ?? String.trans_promptCreateUsernameFailed
YepAlert.alertSorry(message: message, inViewController: self)

}, completion: { success in
SafeDispatch.async { [weak self] in
Expand Down
2 changes: 1 addition & 1 deletion Yep/ViewControllers/TabBar/YepTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class YepTabBarController: UITabBarController {
case .Conversations:
return String.trans_titleChats
case .Contacts:
return NSLocalizedString("Contacts", comment: "")
return String.trans_titleContacts
case .Feeds:
return NSLocalizedString("Feeds", comment: "")
case .Discover:
Expand Down
20 changes: 9 additions & 11 deletions Yep/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@
"title.choose_source" = "Choose Source";
"button.choose_from_library" = "Choose from Library";
"prompt.choose" = "Choose...";
"Clear history" = "Clear history";
"Confirm" = "Confirm";
"Contacts" = "Contacts";
"Copy" = "Copy";
"Create a username" = "Create a username";
"Create feed failed!" = "Create feed failed!";
"Create username failed!" = "Create username failed!";
"Create" = "Create";
"Created by %@ at %@" = "Created by %@ at %@";
"Creators of Blocked Feeds" = "Creators of Blocked Feeds";
"Current number:" = "Current number:";
"title.clear_history" = "Clear History";
"confirm" = "Confirm";
"title.contacts" = "Contacts";
"title.create_username" = "Create a Username";
"prompt.create_feed_failed" = "Create feed failed!";
"prompt.create_username_failed" = "Create username failed!";
"title.create" = "Create";
"prompt.creators_of_blocked_feeds" = "Creators of Blocked Feeds";
"prompt.current_number" = "Current Number:";
"Default" = "Default";
"Delete" = "Delete";
"Didn't get it?" = "Didn't get it?";
Expand Down
18 changes: 8 additions & 10 deletions Yep/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@
"title.choose_source" = "选择";
"button.choose_from_library" = "从相册选取";
"prompt.choose" = "选择…";
"Clear history" = "清除历史记录";
"Confirm" = "确定";
"Contacts" = "联系人";
"Copy" = "复制";
"Create a username" = "创建用户名";
"Create feed failed!" = "创建话题失败!";
"Create username failed!" = "创建用户名失败!";
"Create" = "创建";
"Created by %@ at %@" = "%@ 创建于 %@";
"title.clear_history" = "清除历史记录";
"confirm" = "确定";
"title.contacts" = "联系人";
"title.create_username" = "创建用户名";
"prompt.create_feed_failed" = "创建话题失败!";
"prompt.create_username_failed" = "创建用户名失败!";
"title.create" = "创建";
"Creators of Blocked Feeds" = "被屏蔽的话题创建者";
"Current number:" = "当前号码";
"prompt.current_number" = "当前号码";
"Default" = "默认";
"Delete" = "删除";
"Didn't get it?" = "没有收到?";
Expand Down
2 changes: 1 addition & 1 deletion YepKit/Persistence/Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2068,7 +2068,7 @@ public func tryDeleteOrClearHistoryOfConversation(conversation: Conversation, in
let deleteAlertController = UIAlertController(title: nil, message: nil, preferredStyle: .ActionSheet)
let clearHistoryAction: UIAlertAction = UIAlertAction(title: NSLocalizedString("Clear history", comment: ""), style: .Default) { _ in
let clearHistoryAction: UIAlertAction = UIAlertAction(title: NSLocalizedString("title.clear_history", comment: ""), style: .Default) { _ in
clearMessages()
Expand Down

0 comments on commit 486d32a

Please sign in to comment.