Skip to content

Commit

Permalink
ReportReason trans
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Aug 12, 2016
1 parent 526d37a commit 9b3133a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
19 changes: 19 additions & 0 deletions Yep/Extensions/String+Trans.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,22 @@ extension String {
}
}

extension String {

static var trans_reportAdvertising: String {
return NSLocalizedString("report.advertising", comment: "")
}

static var trans_reportPorno: String {
return NSLocalizedString("report.porno", comment: "")
}

static var trans_reportScams: String {
return NSLocalizedString("report.scams", comment: "")
}

static var trans_reportOther: String {
return NSLocalizedString("report.other", comment: "")
}
}

16 changes: 16 additions & 0 deletions Yep/Extensions/UIViewController+Yep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ extension UIViewController {

// MAKR: - Report

extension ReportReason {

var description: String {
switch self {
case .Porno:
return String.trans_reportPorno
case .Advertising:
return String.trans_reportAdvertising
case .Scams:
return String.trans_reportScams
case .Other:
return String.trans_reportOther
}
}
}

extension UIViewController {

enum ReportObject {
Expand Down
8 changes: 4 additions & 4 deletions Yep/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"button.add_skill_to_me" = "Add to Me";
"button.add" = "Add";
"prompt.added_skill%@_to_set%@_successfully" = "Added %1$@ to %2$@ successfully!";
"Advertising" = "Advertising";
"report.advertising" = "Advertising";
"Albums" = "Albums";
"All messages read." = "All messages read.";
"Also delete this feed?" = "Also delete this feed?";
Expand Down Expand Up @@ -165,7 +165,7 @@
"Open Source of Yep" = "Open Source of Yep";
"Open Source" = "Open Source";
"Other Reason" = "Other Reason";
"Other" = "Other";
"report.other" = "Other";
"People with this skill" = "People with this skill";
"Pick Location" = "Pick Location";
"Pick Photos" = "Pick Photos";
Expand All @@ -177,7 +177,7 @@
"Please wait while the image is not ready!" = "Please wait while the image is not ready!";
"Please wait while the video is not ready!" = "Please wait while the video is not ready!";
"Popular in " = "Popular in ";
"Porno" = "Porno";
"report.porno" = "Porno";
"Post" = "Post";
"Preview" = "Preview";
"Profile" = "Profile";
Expand Down Expand Up @@ -206,7 +206,7 @@
"Review Yep" = "Review Yep";
"Review now" = "Review now";
"Say Hi" = "Say Hi";
"Scams" = "Scams";
"report.scams" = "Scams";
"Search Feeds" = "Search Feeds";
"Search Friend" = "Search Friend";
"Search User" = "Search User";
Expand Down
8 changes: 4 additions & 4 deletions Yep/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"button.add_skill_to_me" = "添加此技能";
"button.add" = "添加";
"prompt.added_skill%@_to_set%@_successfully" = "已成功将“%1$@”添加到“%2$@”!";
"Advertising" = "广告";
"report.advertising" = "广告";
"Albums" = "相册";
"All messages read." = "没有未读消息";
"Also delete this feed?" = "同时删除此话题?";
Expand Down Expand Up @@ -165,7 +165,7 @@
"Open Source of Yep" = "Yep 的开源";
"Open Source" = "开源";
"Other Reason" = "其它原因";
"Other" = "其它";
"report.other" = "其它";
"People with this skill" = "与此技能相关的用户";
"Pick Location" = "选择位置";
"Pick Photos" = "相册";
Expand All @@ -177,7 +177,7 @@
"Please wait while the image is not ready!" = "正在准备图片,请稍等!";
"Please wait while the video is not ready!" = "正在准备视频,请稍等!";
"Popular in " = "流行于";
"Porno" = "色情";
"report.porno" = "色情";
"Post" = "发布";
"Preview" = "查看";
"Profile" = "个人主页";
Expand Down Expand Up @@ -206,7 +206,7 @@
"Review Yep" = "评价 Yep";
"Review now" = "马上评价";
"Say Hi" = "打个招呼";
"Scams" = "诈骗";
"report.scams" = "诈骗";
"Search Feeds" = "搜索话题";
"Search Friend" = "搜索好友";
"Search User" = "用户名/昵称/手机号";
Expand Down
13 changes: 0 additions & 13 deletions YepKit/Remote/YepService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -888,19 +888,6 @@ public enum ReportReason {
return 3
}
}

public var description: String {
switch self {
case .Porno:
return NSLocalizedString("Porno", comment: "")
case .Advertising:
return NSLocalizedString("Advertising", comment: "")
case .Scams:
return NSLocalizedString("Scams", comment: "")
case .Other:
return NSLocalizedString("Other", comment: "")
}
}
}

public func reportProfileUser(profileUser: ProfileUser, forReason reason: ReportReason, failureHandler: FailureHandler?, completion: () -> Void) {
Expand Down

0 comments on commit 9b3133a

Please sign in to comment.