diff --git a/Yep/Extensions/String+Trans.swift b/Yep/Extensions/String+Trans.swift index 51de99fe9..1fcac366d 100644 --- a/Yep/Extensions/String+Trans.swift +++ b/Yep/Extensions/String+Trans.swift @@ -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: "") + } +} + diff --git a/Yep/Extensions/UIViewController+Yep.swift b/Yep/Extensions/UIViewController+Yep.swift index e6e6d8f43..d5c5e5409 100644 --- a/Yep/Extensions/UIViewController+Yep.swift +++ b/Yep/Extensions/UIViewController+Yep.swift @@ -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 { diff --git a/Yep/en.lproj/Localizable.strings b/Yep/en.lproj/Localizable.strings index 5871d77ea..3df17dd32 100644 --- a/Yep/en.lproj/Localizable.strings +++ b/Yep/en.lproj/Localizable.strings @@ -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?"; @@ -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"; @@ -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"; @@ -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"; diff --git a/Yep/zh-Hans.lproj/Localizable.strings b/Yep/zh-Hans.lproj/Localizable.strings index 14edfeab5..697fd90f0 100644 --- a/Yep/zh-Hans.lproj/Localizable.strings +++ b/Yep/zh-Hans.lproj/Localizable.strings @@ -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?" = "同时删除此话题?"; @@ -165,7 +165,7 @@ "Open Source of Yep" = "Yep 的开源"; "Open Source" = "开源"; "Other Reason" = "其它原因"; -"Other" = "其它"; +"report.other" = "其它"; "People with this skill" = "与此技能相关的用户"; "Pick Location" = "选择位置"; "Pick Photos" = "相册"; @@ -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" = "个人主页"; @@ -206,7 +206,7 @@ "Review Yep" = "评价 Yep"; "Review now" = "马上评价"; "Say Hi" = "打个招呼"; -"Scams" = "诈骗"; +"report.scams" = "诈骗"; "Search Feeds" = "搜索话题"; "Search Friend" = "搜索好友"; "Search User" = "用户名/昵称/手机号"; diff --git a/YepKit/Remote/YepService.swift b/YepKit/Remote/YepService.swift index 8a22e347c..09c6596ed 100644 --- a/YepKit/Remote/YepService.swift +++ b/YepKit/Remote/YepService.swift @@ -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) {