多语言
This commit is contained in:
parent
fa0db110b6
commit
5f3deeb52d
@ -42,10 +42,10 @@ extension AppDelegate {
|
|||||||
view.show()
|
view.show()
|
||||||
|
|
||||||
// let alert = UIAlertController(title: nil, message: "kAlertMessage_03".localized, preferredStyle: .alert)
|
// let alert = UIAlertController(title: nil, message: "kAlertMessage_03".localized, preferredStyle: .alert)
|
||||||
// alert.addAction(UIAlertAction(title: "Affirm".localized, style: .default, handler: { _ in
|
// alert.addAction(UIAlertAction(title: "movia_affirm".localized, style: .default, handler: { _ in
|
||||||
// SPAPPTool.openApnsSetting()
|
// SPAPPTool.openApnsSetting()
|
||||||
// }))
|
// }))
|
||||||
// alert.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel))
|
// alert.addAction(UIAlertAction(title: "movia_Cancel".localized, style: .cancel))
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// SPAPPTool.topViewController()?.present(alert, animated: true)
|
// SPAPPTool.topViewController()?.present(alert, animated: true)
|
||||||
|
@ -21,7 +21,7 @@ extension AppDelegate {
|
|||||||
|
|
||||||
registAdjust()
|
registAdjust()
|
||||||
///设置刷新控件的语言
|
///设置刷新控件的语言
|
||||||
MJRefreshConfig.default.languageCode = "en"
|
MJRefreshConfig.default.languageCode = SPLocalizedManager.shared.mjLocalizedKey
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,6 +99,8 @@ extension SceneDelegate {
|
|||||||
|
|
||||||
///语言切换
|
///语言切换
|
||||||
@objc private func localizedDidChange() {
|
@objc private func localizedDidChange() {
|
||||||
|
MJRefreshConfig.default.languageCode = SPLocalizedManager.shared.mjLocalizedKey
|
||||||
|
|
||||||
let tabBarController = SPTabBarController()
|
let tabBarController = SPTabBarController()
|
||||||
SPAPPTool.mainTabBarController = tabBarController
|
SPAPPTool.mainTabBarController = tabBarController
|
||||||
|
|
||||||
|
@ -20,15 +20,15 @@ class SPTabBarController: UITabBarController {
|
|||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
self.view.backgroundColor = .backgroundColor()
|
self.view.backgroundColor = .backgroundColor()
|
||||||
|
|
||||||
let nav1 = createNavigationController(viewController: SPHomeViewController(), title: "Home".localized, image: UIImage(named: "tabbar_icon_01"), selectedImage: UIImage(named: "tabbar_icon_01_selected"))
|
let nav1 = createNavigationController(viewController: SPHomeViewController(), title: "movia_home".localized, image: UIImage(named: "tabbar_icon_01"), selectedImage: UIImage(named: "tabbar_icon_01_selected"))
|
||||||
|
|
||||||
let nav2 = createNavigationController(viewController: SPExplorePageController(), title: "For You".localized, image: UIImage(named: "tabbar_icon_02"), selectedImage: UIImage(named: "tabbar_icon_02_selected"))
|
let nav2 = createNavigationController(viewController: SPExplorePageController(), title: "movia_for_you".localized, image: UIImage(named: "tabbar_icon_02"), selectedImage: UIImage(named: "tabbar_icon_02_selected"))
|
||||||
|
|
||||||
let nav3 = createNavigationController(viewController: SPMyListViewController(), title: "My list".localized, image: UIImage(named: "tabbar_icon_04"), selectedImage: UIImage(named: "tabbar_icon_04_selected"))
|
let nav3 = createNavigationController(viewController: SPMyListViewController(), title: "movia_my_list".localized, image: UIImage(named: "tabbar_icon_04"), selectedImage: UIImage(named: "tabbar_icon_04_selected"))
|
||||||
|
|
||||||
let nav4 = createNavigationController(viewController: SPRewardsViewController(), title: "Rewards".localized, image: UIImage(named: "tabbar_icon_04"), selectedImage: UIImage(named: "tabbar_icon_04_selected"))
|
let nav4 = createNavigationController(viewController: SPRewardsViewController(), title: "Rewards".localized, image: UIImage(named: "tabbar_icon_04"), selectedImage: UIImage(named: "tabbar_icon_04_selected"))
|
||||||
|
|
||||||
let nav5 = createNavigationController(viewController: SPMineViewController(), title: "Profile".localized, image: UIImage(named: "tabbar_icon_05"), selectedImage: UIImage(named: "tabbar_icon_05_selected"))
|
let nav5 = createNavigationController(viewController: SPMineViewController(), title: "movia_profile".localized, image: UIImage(named: "tabbar_icon_05"), selectedImage: UIImage(named: "tabbar_icon_05_selected"))
|
||||||
|
|
||||||
self.viewControllers = [nav1, nav2, nav3, nav4, nav5]
|
self.viewControllers = [nav1, nav2, nav3, nav4, nav5]
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class SPNetwork: NSObject {
|
|||||||
var res = SPNetworkResponse<T>()
|
var res = SPNetworkResponse<T>()
|
||||||
res.code = -1
|
res.code = -1
|
||||||
if parameters.isToast {
|
if parameters.isToast {
|
||||||
SPToast.show(text: "Error".localized)
|
SPToast.show(text: "movia_error".localized)
|
||||||
}
|
}
|
||||||
completion?(res)
|
completion?(res)
|
||||||
} else {
|
} else {
|
||||||
@ -128,7 +128,7 @@ class SPNetwork: NSObject {
|
|||||||
var res = SPNetworkResponse<T>()
|
var res = SPNetworkResponse<T>()
|
||||||
res.code = -1
|
res.code = -1
|
||||||
if parameters.isToast {
|
if parameters.isToast {
|
||||||
SPToast.show(text: "Error".localized)
|
SPToast.show(text: "movia_error".localized)
|
||||||
}
|
}
|
||||||
completion?(res)
|
completion?(res)
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@ class SPNetwork: NSObject {
|
|||||||
} else {
|
} else {
|
||||||
var response = SPNetworkResponse<T>()
|
var response = SPNetworkResponse<T>()
|
||||||
response.code = -1
|
response.code = -1
|
||||||
response.msg = "Error".localized
|
response.msg = "movia_error".localized
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ class SPCampaignWebViewController: SPWebViewController {
|
|||||||
if urlStr == SPFeedBackListWebUrl {
|
if urlStr == SPFeedBackListWebUrl {
|
||||||
self.title = "Feedback History".localized
|
self.title = "Feedback History".localized
|
||||||
} else if urlStr == SPFeedBackHomeWebUrl {
|
} else if urlStr == SPFeedBackHomeWebUrl {
|
||||||
self.title = "Feedback".localized
|
self.title = "movia_profile_Feedback".localized
|
||||||
} else if urlStr == SPFeedBackDetailWebUrl {
|
} else if urlStr == SPFeedBackDetailWebUrl {
|
||||||
self.title = "Feedback Details".localized
|
self.title = "Feedback Details".localized
|
||||||
} else if urlStr == SPRewardsWebUrl {
|
} else if urlStr == SPRewardsWebUrl {
|
||||||
|
@ -52,7 +52,7 @@ class SPWebViewController: SPViewController {
|
|||||||
let str: String = urlString
|
let str: String = urlString
|
||||||
|
|
||||||
guard let url = URL(string: str) else { return }
|
guard let url = URL(string: str) else { return }
|
||||||
let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 30)
|
let request = URLRequest(url: url, timeoutInterval: 30)
|
||||||
|
|
||||||
self.webView.load(request)
|
self.webView.load(request)
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ class SPAllShortViewController: SPViewController {
|
|||||||
private lazy var allCategoryModel: SPCategoryModel = {
|
private lazy var allCategoryModel: SPCategoryModel = {
|
||||||
let model = SPCategoryModel()
|
let model = SPCategoryModel()
|
||||||
model.id = "0"
|
model.id = "0"
|
||||||
model.name = "All".localized
|
model.name = "movia_all".localized
|
||||||
return model
|
return model
|
||||||
}()
|
}()
|
||||||
private lazy var categoryArr: [SPCategoryModel] = [self.allCategoryModel]
|
private lazy var categoryArr: [SPCategoryModel] = [self.allCategoryModel]
|
||||||
|
@ -11,7 +11,7 @@ import UIKit
|
|||||||
class SPExplorePageController: SPViewController {
|
class SPExplorePageController: SPViewController {
|
||||||
|
|
||||||
private lazy var titles: [String] = {
|
private lazy var titles: [String] = {
|
||||||
let arr = ["Shorts".localized, "All".localized]
|
let arr = ["movia_shorts".localized, "movia_all".localized]
|
||||||
return arr
|
return arr
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class SPExplorePlayerControlView: SPPlayerControlView {
|
|||||||
|
|
||||||
private lazy var allEpisodeButton: UIButton = {
|
private lazy var allEpisodeButton: UIButton = {
|
||||||
let button = JXButton(type: .custom)
|
let button = JXButton(type: .custom)
|
||||||
button.setTitle("Full Episodes".localized, for: .normal)
|
button.setTitle("movia_full_episodes".localized, for: .normal)
|
||||||
button.setTitleColor(.colorEC3324(), for: .normal)
|
button.setTitleColor(.colorEC3324(), for: .normal)
|
||||||
button.setImage(UIImage(named: "arrow_right_icon_01"), for: .normal)
|
button.setImage(UIImage(named: "arrow_right_icon_01"), for: .normal)
|
||||||
button.jx_font = .fontMedium(ofSize: 12)
|
button.jx_font = .fontMedium(ofSize: 12)
|
||||||
@ -74,8 +74,9 @@ class SPExplorePlayerControlView: SPPlayerControlView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func updateEpisodeLabel() {
|
private func updateEpisodeLabel() {
|
||||||
let totalEpisode = String(format: "EP%@".localized, "\(self.shortModel?.episode_total ?? 0)")
|
// let totalEpisode = String(format: "movia_text_episcode_ios".localized, "\(self.shortModel?.episode_total ?? 0)")
|
||||||
let currentEpisode = String(format: "EP%@".localized, self.videoInfo?.episode ?? "0")
|
let totalEpisode = "\(self.shortModel?.episode_total ?? 0)"
|
||||||
|
let currentEpisode = String(format: "movia_text_episcode_ios".localized, self.videoInfo?.episode ?? "0")
|
||||||
let episodeStr = "\(currentEpisode)/\(totalEpisode)"
|
let episodeStr = "\(currentEpisode)/\(totalEpisode)"
|
||||||
let range = NSRange(location: episodeStr.length() - totalEpisode.length(), length: totalEpisode.length())
|
let range = NSRange(location: episodeStr.length() - totalEpisode.length(), length: totalEpisode.length())
|
||||||
|
|
||||||
|
@ -14,15 +14,16 @@ class SPHomePageController: SPViewController {
|
|||||||
///是否在请求中
|
///是否在请求中
|
||||||
private var isRequesting = false
|
private var isRequesting = false
|
||||||
|
|
||||||
private lazy var categoryArr: [SPHomeCategoryModel] = {
|
private lazy var categoryArr: [SPHomeCategoryModel] = []
|
||||||
let arr = [
|
// {
|
||||||
SPHomeCategoryModel(category_name: "Hot Picks".localized, category_id: nil, viewController: SPHomeViewController()),
|
// let arr = [
|
||||||
SPHomeCategoryModel(category_name: "Top 10".localized, category_id: nil, viewController: nil),
|
// SPHomeCategoryModel(category_name: "Hot Picks".localized, category_id: nil, viewController: SPHomeViewController()),
|
||||||
SPHomeCategoryModel(category_name: "Fresh Drops".localized, category_id: nil, viewController: nil),
|
// SPHomeCategoryModel(category_name: "Top 10".localized, category_id: nil, viewController: nil),
|
||||||
SPHomeCategoryModel(category_name: "Free".localized, category_id: nil, viewController: nil),
|
// SPHomeCategoryModel(category_name: "Fresh Drops".localized, category_id: nil, viewController: nil),
|
||||||
]
|
// SPHomeCategoryModel(category_name: "Free".localized, category_id: nil, viewController: nil),
|
||||||
return arr
|
// ]
|
||||||
}()
|
// return arr
|
||||||
|
// }()
|
||||||
|
|
||||||
private lazy var searchButton: SPHomeSearchButton = {
|
private lazy var searchButton: SPHomeSearchButton = {
|
||||||
let button = SPHomeSearchButton()
|
let button = SPHomeSearchButton()
|
||||||
|
@ -42,7 +42,7 @@ class SPHomeDataItemView: UIView {
|
|||||||
|
|
||||||
private lazy var moreButton: UIButton = {
|
private lazy var moreButton: UIButton = {
|
||||||
let button = UIButton(type: .custom)
|
let button = UIButton(type: .custom)
|
||||||
button.setTitle("More".localized, for: .normal)
|
button.setTitle("movia_more".localized, for: .normal)
|
||||||
button.setTitleColor(.colorF564B6(), for: .normal)
|
button.setTitleColor(.colorF564B6(), for: .normal)
|
||||||
button.titleLabel?.font = .fontLight(ofSize: 12)
|
button.titleLabel?.font = .fontLight(ofSize: 12)
|
||||||
return button
|
return button
|
||||||
|
@ -62,7 +62,7 @@ class SPHomeExploreView: SPHomeDataItemView {
|
|||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
titleLabel.text = "Explore For You".localized
|
titleLabel.text = "movia_explore_for_you".localized
|
||||||
iconImageView.image = UIImage(named: "mark_icon_01")
|
iconImageView.image = UIImage(named: "mark_icon_01")
|
||||||
|
|
||||||
_setupUI()
|
_setupUI()
|
||||||
|
@ -108,7 +108,7 @@ class SPHomeHeaderView: UICollectionReusableView {
|
|||||||
|
|
||||||
private lazy var titleView: SPHomeDataItemView = {
|
private lazy var titleView: SPHomeDataItemView = {
|
||||||
let view = SPHomeDataItemView()
|
let view = SPHomeDataItemView()
|
||||||
view.titleLabel.text = "More for you!".localized
|
view.titleLabel.text = "movia_more_for_you".localized
|
||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class SPHomeHotSearchView: UIView {
|
|||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.font = .fontMedium(ofSize: 16)
|
label.font = .fontMedium(ofSize: 16)
|
||||||
label.textColor = .colorFFFFFF()
|
label.textColor = .colorFFFFFF()
|
||||||
label.text = "Top Search".localized
|
label.text = "movia_top_search".localized
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class SPHomeHotView: SPHomeDataItemView {
|
|||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
self.titleLabel.text = "Editor's Hotlist".localized
|
self.titleLabel.text = "movia_editors_hotlist".localized
|
||||||
_setupUI()
|
_setupUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class SPHomePlayHistoryView: SPHomeDataItemView {
|
|||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
self.titleLabel.text = "Continue watching".localized
|
self.titleLabel.text = "movia_continue_watching".localized
|
||||||
|
|
||||||
_setupUI()
|
_setupUI()
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class SPHomeSearchButton: UIControl {
|
|||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.font = .fontRegular(ofSize: 12)
|
label.font = .fontRegular(ofSize: 12)
|
||||||
label.textColor = .colorFFFFFF(alpha: 0.52)
|
label.textColor = .colorFFFFFF(alpha: 0.52)
|
||||||
label.text = "Love Me Like You Do It".localized
|
label.text = "movia_search_tips".localized
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class SPHomeSearchHistoryView: UIView {
|
|||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.font = .fontBold(ofSize: 16)
|
label.font = .fontBold(ofSize: 16)
|
||||||
label.textColor = .colorE7F5FF()
|
label.textColor = .colorE7F5FF()
|
||||||
label.text = "Historical search".localized
|
label.text = "movia_Historical_search".localized
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class SPHomeShortsForYouView: SPHomeDataItemView {
|
|||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
self.titleLabel.text = "Shorts for You".localized
|
self.titleLabel.text = "movia_shorts_for_you".localized
|
||||||
|
|
||||||
_setupUI()
|
_setupUI()
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ class SPHomeTrendingView: SPHomeDataItemView {
|
|||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
self.titleLabel.text = "Trending Now".localized
|
self.titleLabel.text = "movia_trending_now".localized
|
||||||
|
|
||||||
_setupUI()
|
_setupUI()
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,8 @@ class SPLoginViewController: SPViewController {
|
|||||||
|
|
||||||
private lazy var agreementLabel: YYLabel = {
|
private lazy var agreementLabel: YYLabel = {
|
||||||
let agreementStr = "kLoginAgreementText".localized
|
let agreementStr = "kLoginAgreementText".localized
|
||||||
let userAgreementStr = "User Agreement".localized
|
let userAgreementStr = "movia_profile_User_Agreement".localized
|
||||||
let privacyPolicy = "Privacy Policy".localized
|
let privacyPolicy = "movia_profile_Privacy_Policy".localized
|
||||||
let range1 = agreementStr.ocString().range(of: userAgreementStr)
|
let range1 = agreementStr.ocString().range(of: userAgreementStr)
|
||||||
let range2 = agreementStr.ocString().range(of: privacyPolicy)
|
let range2 = agreementStr.ocString().range(of: privacyPolicy)
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ class SPAboutUsViewController: SPViewController {
|
|||||||
|
|
||||||
private lazy var dataArr: [SPMineItem] = {
|
private lazy var dataArr: [SPMineItem] = {
|
||||||
let arr = [
|
let arr = [
|
||||||
SPMineItem(type: .userAgreement, title: "User Agreement".localized),
|
SPMineItem(type: .userAgreement, title: "movia_profile_User_Agreement".localized),
|
||||||
SPMineItem(type: .privacyPolicy, title: "Privacy Policy".localized),
|
SPMineItem(type: .privacyPolicy, title: "movia_profile_Privacy_Policy".localized),
|
||||||
SPMineItem(type: .informationProtection, title: "Child Personal Information Protection Rules".localized),
|
SPMineItem(type: .informationProtection, title: "movia_child_protection_text".localized),
|
||||||
SPMineItem(type: .civizatioConvention, title: "Youth Civilization Convention".localized),
|
SPMineItem(type: .civizatioConvention, title: "Youth Civilization Convention".localized),
|
||||||
SPMineItem(type: .informationSharing, title: "List of Third-Party Sharing of Personal Information".localized),
|
SPMineItem(type: .informationSharing, title: "List of Third-Party Sharing of Personal Information".localized),
|
||||||
SPMineItem(type: .persoInforDisclosure, title: "Explicit List of Personal Information Collection".localized),
|
SPMineItem(type: .persoInforDisclosure, title: "Explicit List of Personal Information Collection".localized),
|
||||||
@ -37,7 +37,7 @@ class SPAboutUsViewController: SPViewController {
|
|||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
self.title = "About Us".localized
|
self.title = "movia_profile_About_Us".localized
|
||||||
setBackgroundView(isShowGradient: false, bgImage: nil)
|
setBackgroundView(isShowGradient: false, bgImage: nil)
|
||||||
_setupUI()
|
_setupUI()
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class SPLanguageViewController: SPViewController {
|
|||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
self.edgesForExtendedLayout = .top
|
self.edgesForExtendedLayout = .top
|
||||||
self.title = "Language".localized
|
self.title = "movia_profile_Language".localized
|
||||||
|
|
||||||
requestDataList()
|
requestDataList()
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@ class SPMineViewController: SPViewController {
|
|||||||
|
|
||||||
private lazy var dataArr: [SPMineItem] = {
|
private lazy var dataArr: [SPMineItem] = {
|
||||||
let arr = [
|
let arr = [
|
||||||
SPMineItem(type: .language, iconImage: UIImage(named: "language_icon_01"), title: "Language".localized),
|
SPMineItem(type: .language, iconImage: UIImage(named: "language_icon_01"), title: "movia_profile_Language".localized),
|
||||||
SPMineItem(type: .feedBack, iconImage: UIImage(named: "feed_back_icon_01"), title: "FeedBack".localized),
|
SPMineItem(type: .feedBack, iconImage: UIImage(named: "feed_back_icon_01"), title: "movia_profile_Feedback".localized),
|
||||||
SPMineItem(type: .privacyPolicy, iconImage: UIImage(named: "privacy_policy_icon_01"), title: "Privacy Policy".localized),
|
SPMineItem(type: .privacyPolicy, iconImage: UIImage(named: "privacy_policy_icon_01"), title: "movia_profile_Privacy_Policy".localized),
|
||||||
SPMineItem(type: .userAgreement, iconImage: UIImage(named: "user_agreement_icon_01"), title: "User Agreement".localized),
|
SPMineItem(type: .userAgreement, iconImage: UIImage(named: "user_agreement_icon_01"), title: "movia_profile_User_Agreement".localized),
|
||||||
SPMineItem(type: .aboutUs, iconImage: UIImage(named: "about_us_icon_01"), title: "About Us".localized),
|
SPMineItem(type: .aboutUs, iconImage: UIImage(named: "about_us_icon_01"), title: "movia_profile_About_Us".localized),
|
||||||
SPMineItem(type: .settings, iconImage: UIImage(named: "settings_icon_01"), title: "Settings".localized),
|
SPMineItem(type: .settings, iconImage: UIImage(named: "settings_icon_01"), title: "movia_profile_Setting".localized),
|
||||||
]
|
]
|
||||||
return arr
|
return arr
|
||||||
}()
|
}()
|
||||||
|
@ -32,7 +32,7 @@ class SPSettingsViewController: SPViewController {
|
|||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
self.setBackgroundView(isShowGradient: false, bgImage: nil)
|
self.setBackgroundView(isShowGradient: false, bgImage: nil)
|
||||||
self.title = "Settings".localized
|
self.title = "movia_profile_Setting".localized
|
||||||
|
|
||||||
SPAppCacheManager.manager.getAllCache { [weak self] value in
|
SPAppCacheManager.manager.getAllCache { [weak self] value in
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
@ -129,14 +129,14 @@ extension SPSettingsViewController {
|
|||||||
///退出登录
|
///退出登录
|
||||||
private func logout() {
|
private func logout() {
|
||||||
let alert = UIAlertController(title: nil, message: "Confirm logout?".localized, preferredStyle: .alert)
|
let alert = UIAlertController(title: nil, message: "Confirm logout?".localized, preferredStyle: .alert)
|
||||||
alert.addAction(UIAlertAction(title: "Affirm".localized, style: .default, handler: { _ in
|
alert.addAction(UIAlertAction(title: "movia_affirm".localized, style: .default, handler: { _ in
|
||||||
SPLoginManager.manager.logout { [weak self] isFinish in
|
SPLoginManager.manager.logout { [weak self] isFinish in
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
self.dataArr = self.createDataArr()
|
self.dataArr = self.createDataArr()
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
alert.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel))
|
alert.addAction(UIAlertAction(title: "movia_Cancel".localized, style: .cancel))
|
||||||
|
|
||||||
self.present(alert, animated: true)
|
self.present(alert, animated: true)
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ extension SPSettingsViewController {
|
|||||||
|
|
||||||
var arr = [
|
var arr = [
|
||||||
SPMineItem(type: .clearCache, title: "Clear Cache".localized, subtitle: SPAppCacheManager.cacheToString(cache: cache)),
|
SPMineItem(type: .clearCache, title: "Clear Cache".localized, subtitle: SPAppCacheManager.cacheToString(cache: cache)),
|
||||||
SPMineItem(type: .aboutUs, title: "About Us".localized),
|
SPMineItem(type: .aboutUs, title: "movia_profile_About_Us".localized),
|
||||||
]
|
]
|
||||||
|
|
||||||
if SPLoginManager.manager.isLogin {
|
if SPLoginManager.manager.isLogin {
|
||||||
|
@ -87,7 +87,7 @@ class SPMineHeaderView: UIView {
|
|||||||
|
|
||||||
private lazy var copyButton: UIButton = {
|
private lazy var copyButton: UIButton = {
|
||||||
let button = UIButton(type: .custom)
|
let button = UIButton(type: .custom)
|
||||||
button.setTitle("Copy".localized, for: .normal)
|
button.setTitle("movia_copy".localized, for: .normal)
|
||||||
button.setTitleColor(.colorFFFFFF(), for: .normal)
|
button.setTitleColor(.colorFFFFFF(), for: .normal)
|
||||||
button.titleLabel?.font = .fontRegular(ofSize: 12)
|
button.titleLabel?.font = .fontRegular(ofSize: 12)
|
||||||
button.setBackgroundImage(UIImage(color: .color58484B(alpha: 0.56)), for: .normal)
|
button.setBackgroundImage(UIImage(color: .color58484B(alpha: 0.56)), for: .normal)
|
||||||
|
@ -33,7 +33,7 @@ class SPMinePlayHistoryView: UIView {
|
|||||||
let label = UILabel()
|
let label = UILabel()
|
||||||
label.font = .fontMedium(ofSize: 16)
|
label.font = .fontMedium(ofSize: 16)
|
||||||
label.textColor = .colorFFFFFF()
|
label.textColor = .colorFFFFFF()
|
||||||
label.text = "Watch History".localized
|
label.text = "movia_watch_history".localized
|
||||||
return label
|
return label
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ class SPMyListChildViewController: SPViewController {
|
|||||||
let count = self.selectedCount
|
let count = self.selectedCount
|
||||||
|
|
||||||
deleteButton.isEnabled = count > 0
|
deleteButton.isEnabled = count > 0
|
||||||
let text = String(format: "Delet (%@)".localized, "\(selectedCount)")
|
// let text = String(format: "Delet (%@)".localized, "\(selectedCount)")
|
||||||
deleteButton.setTitle(text, for: .normal)
|
// deleteButton.setTitle(text, for: .normal)
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func handelDeleteButton() {
|
@objc func handelDeleteButton() {
|
||||||
|
@ -10,7 +10,7 @@ import UIKit
|
|||||||
class SPMyListViewController: SPViewController {
|
class SPMyListViewController: SPViewController {
|
||||||
|
|
||||||
|
|
||||||
private lazy var titles = ["Watch list".localized, "Recently viewed".localized]
|
private lazy var titles = ["movia_watch_list".localized, "movia_recently_viewed".localized]
|
||||||
|
|
||||||
private lazy var viewControllers: [SPMyListChildViewController] = {
|
private lazy var viewControllers: [SPMyListChildViewController] = {
|
||||||
let vc1 = SPCollectListViewController()
|
let vc1 = SPCollectListViewController()
|
||||||
@ -81,7 +81,7 @@ class SPMyListViewController: SPViewController {
|
|||||||
|
|
||||||
private lazy var cancelButton: UIButton = {
|
private lazy var cancelButton: UIButton = {
|
||||||
let button = UIButton(type: .custom)
|
let button = UIButton(type: .custom)
|
||||||
// button.setTitle("Cancel".localized, for: .normal)
|
// button.setTitle("movia_Cancel".localized, for: .normal)
|
||||||
button.setImage(UIImage(named: "cancel_icon_01"), for: .normal)
|
button.setImage(UIImage(named: "cancel_icon_01"), for: .normal)
|
||||||
// button.setTitleColor(.colorFFFFFF(alpha: 0.9), for: .normal)
|
// button.setTitleColor(.colorFFFFFF(alpha: 0.9), for: .normal)
|
||||||
// button.titleLabel?.font = .fontRegular(ofSize: 15)
|
// button.titleLabel?.font = .fontRegular(ofSize: 15)
|
||||||
@ -93,7 +93,7 @@ class SPMyListViewController: SPViewController {
|
|||||||
///全选按钮
|
///全选按钮
|
||||||
private lazy var allSelectedButton: UIButton = {
|
private lazy var allSelectedButton: UIButton = {
|
||||||
let button = JXButton(type: .custom)
|
let button = JXButton(type: .custom)
|
||||||
button.setTitle("Select All".localized, for: .normal)
|
// button.setTitle("Select All".localized, for: .normal)
|
||||||
button.setTitleColor(.colorFFFFFF(alpha: 0.9), for: .normal)
|
button.setTitleColor(.colorFFFFFF(alpha: 0.9), for: .normal)
|
||||||
button.setImage(UIImage(named: "check_icon_01"), for: .normal)
|
button.setImage(UIImage(named: "check_icon_01"), for: .normal)
|
||||||
button.setImage(UIImage(named: "check_icon_01_selected"), for: .selected)
|
button.setImage(UIImage(named: "check_icon_01_selected"), for: .selected)
|
||||||
|
@ -14,7 +14,7 @@ class SPPlayHistoryCell: SPCollectionViewCell {
|
|||||||
coverImageView.sp_setImage(url: model?.image_url)
|
coverImageView.sp_setImage(url: model?.image_url)
|
||||||
titleLabel.text = model?.name
|
titleLabel.text = model?.name
|
||||||
|
|
||||||
let episode = String(format: "EP.%@".localized, model?.current_episode ?? "")
|
let episode = String(format: "movia_text_episcode_ios".localized, model?.current_episode ?? "")
|
||||||
let totalEpisode = "/\(model?.episode_total ?? 0)"
|
let totalEpisode = "/\(model?.episode_total ?? 0)"
|
||||||
let range = NSRange(location: episode.length(), length: totalEpisode.length())
|
let range = NSRange(location: episode.length(), length: totalEpisode.length())
|
||||||
|
|
||||||
|
@ -102,13 +102,13 @@ class SPPlayerControlView: UIView {
|
|||||||
|
|
||||||
///收藏按钮
|
///收藏按钮
|
||||||
private lazy var collectButton: UIButton = {
|
private lazy var collectButton: UIButton = {
|
||||||
let button = createFeatureButton(title: "Save".localized, selectedTitle: "Added".localized, image: UIImage(named: "collect_icon_01"), selectedImage: UIImage(named: "collect_icon_01_selected"))
|
let button = createFeatureButton(title: "movia_save".localized, selectedTitle: "movia_added".localized, image: UIImage(named: "collect_icon_01"), selectedImage: UIImage(named: "collect_icon_01_selected"))
|
||||||
button.addTarget(self, action: #selector(handleCollectButton), for: .touchUpInside)
|
button.addTarget(self, action: #selector(handleCollectButton), for: .touchUpInside)
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
|
||||||
private lazy var episodeButton: UIButton = {
|
private lazy var episodeButton: UIButton = {
|
||||||
let button = createFeatureButton(title: "Series".localized, image: UIImage(named: "episode_icon_02"))
|
let button = createFeatureButton(title: "movia_series".localized, image: UIImage(named: "episode_icon_02"))
|
||||||
button.addTarget(self, action: #selector(handleEpisodeButton), for: .touchUpInside)
|
button.addTarget(self, action: #selector(handleEpisodeButton), for: .touchUpInside)
|
||||||
return button
|
return button
|
||||||
}()
|
}()
|
||||||
|
@ -55,9 +55,9 @@ class SPStoreViewController: SPViewController {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
private lazy var agreementLabel: YYLabel = {
|
private lazy var agreementLabel: YYLabel = {
|
||||||
let text1 = "Terms of Service".localized
|
let text1 = "movia_terms_of_service".localized
|
||||||
let text2 = "Privacy Policy".localized
|
let text2 = "movia_profile_Privacy_Policy".localized
|
||||||
let text3 = "Renewal Agreement".localized
|
let text3 = "movia_renewal_agreement".localized
|
||||||
let text = "\(text1) | \(text2)\n\(text3)"
|
let text = "\(text1) | \(text2)\n\(text3)"
|
||||||
let range1 = text.ocString().range(of: text1)
|
let range1 = text.ocString().range(of: text1)
|
||||||
let range2 = text.ocString().range(of: text2)
|
let range2 = text.ocString().range(of: text2)
|
||||||
|
@ -14,7 +14,7 @@ class SPWalletViewController: SPViewController {
|
|||||||
SPMineItem(type: .consumptionRecords, iconImage: UIImage(named: "records_icon_01"), title: "Consumption records".localized),
|
SPMineItem(type: .consumptionRecords, iconImage: UIImage(named: "records_icon_01"), title: "Consumption records".localized),
|
||||||
SPMineItem(type: .orderRecord, iconImage: UIImage(named: "records_icon_02"), title: "Purchase records".localized),
|
SPMineItem(type: .orderRecord, iconImage: UIImage(named: "records_icon_02"), title: "Purchase records".localized),
|
||||||
SPMineItem(type: .rewardCoins, iconImage: UIImage(named: "coin_icon_03"), title: "Reward Coins".localized),
|
SPMineItem(type: .rewardCoins, iconImage: UIImage(named: "coin_icon_03"), title: "Reward Coins".localized),
|
||||||
SPMineItem(type: .feedBack, iconImage: UIImage(named: "feed_back_icon_03"), title: "FeedBack".localized),
|
SPMineItem(type: .feedBack, iconImage: UIImage(named: "feed_back_icon_03"), title: "movia_profile_Feedback".localized),
|
||||||
]
|
]
|
||||||
return arr
|
return arr
|
||||||
}()
|
}()
|
||||||
|
@ -81,7 +81,7 @@ extension SPAPPTool {
|
|||||||
if let text = text {
|
if let text = text {
|
||||||
let copy = UIPasteboard.general
|
let copy = UIPasteboard.general
|
||||||
copy.string = text
|
copy.string = text
|
||||||
SPToast.show(text: "Succeed".localized)
|
SPToast.show(text: "movia_succeed".localized)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,14 +107,13 @@ class SPIAPManager: NSObject {
|
|||||||
SPLoginManager.manager.userInfo?.is_vip = true
|
SPLoginManager.manager.userInfo?.is_vip = true
|
||||||
|
|
||||||
if isLoding {
|
if isLoding {
|
||||||
SPToast.show(text: "success".localized)
|
SPToast.show(text: "movia_success".localized)
|
||||||
}
|
}
|
||||||
completer?(true)
|
completer?(true)
|
||||||
if buyType == .vip {
|
if buyType == .vip {
|
||||||
NotificationCenter.default.post(name: SPIAPManager.buyVipFinishNotification, object: nil)
|
NotificationCenter.default.post(name: SPIAPManager.buyVipFinishNotification, object: nil)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// SPToast.show(text: "failure".localized)
|
|
||||||
completer?(false)
|
completer?(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,7 +156,7 @@ extension SPIAPManager: JXIAPManagerDelegate {
|
|||||||
if model.status == "success" {
|
if model.status == "success" {
|
||||||
SPLoginManager.manager.userInfo?.is_vip = true
|
SPLoginManager.manager.userInfo?.is_vip = true
|
||||||
|
|
||||||
SPToast.show(text: "success".localized)
|
SPToast.show(text: "movia_success".localized)
|
||||||
self.completionHandler?(true)
|
self.completionHandler?(true)
|
||||||
if buyType == .vip {
|
if buyType == .vip {
|
||||||
NotificationCenter.default.post(name: SPIAPManager.buyVipFinishNotification, object: nil)
|
NotificationCenter.default.post(name: SPIAPManager.buyVipFinishNotification, object: nil)
|
||||||
|
@ -37,6 +37,16 @@ class SPLocalizedManager: NSObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var mjLocalizedKey: String {
|
||||||
|
let key = currentLocalizedKey
|
||||||
|
if key == "zh" {
|
||||||
|
return "zh-Hans"
|
||||||
|
} else if key == "zh_hk" {
|
||||||
|
return "zh-Hant"
|
||||||
|
}
|
||||||
|
return key
|
||||||
|
}
|
||||||
|
|
||||||
// 判断是否跟随系统
|
// 判断是否跟随系统
|
||||||
var isFollowingSystem: Bool {
|
var isFollowingSystem: Bool {
|
||||||
return UserDefaults.standard.string(forKey: LocalizedUserDefaultsKey) == nil
|
return UserDefaults.standard.string(forKey: LocalizedUserDefaultsKey) == nil
|
||||||
|
@ -6,53 +6,51 @@
|
|||||||
英语
|
英语
|
||||||
*/
|
*/
|
||||||
|
|
||||||
"Home" = "Home";
|
"movia_home" = "Home";
|
||||||
"success" = "success";
|
"movia_success" = "Success";
|
||||||
"failure" = "failure";
|
"movia_for_you" = "For You";
|
||||||
"For You" = "For You";
|
"movia_error" = "Error";
|
||||||
"Error" = "Error";
|
"movia_profile" = "Profile";
|
||||||
"Profile" = "Profile";
|
//"Hot Picks" = "Hot Picks";
|
||||||
"Hot Picks" = "Hot Picks";
|
//"Top 10" = "Top 10";
|
||||||
"Top 10" = "Top 10";
|
//"Fresh Drops" = "Fresh Drops";
|
||||||
"Fresh Drops" = "Fresh Drops";
|
//"Free" = "Free";
|
||||||
"Free" = "Free";
|
"movia_trending_now" = "Trending Now";
|
||||||
"Trending Now" = "Trending Now";
|
"movia_editors_hotlist" = "Editor's Hotlist";
|
||||||
"Editor's Hotlist" = "Editor's Hotlist";
|
"movia_shorts_for_you" = "Shorts for You";
|
||||||
"Shorts for You" = "Shorts for You";
|
"movia_series" = "Series";
|
||||||
"Series" = "Series";
|
"movia_save" = "Save";
|
||||||
"Save" = "Save";
|
"movia_added" = "Added";
|
||||||
"Added" = "Added";
|
"movia_profile_Feedback" = "Feedback";
|
||||||
"FeedBack" = "FeedBack";
|
"movia_profile_Setting" = "Settings";
|
||||||
"Settings" = "Settings";
|
"movia_profile_Language" = "Language";
|
||||||
"Language" = "Language";
|
"movia_profile_Privacy_Policy" = "Privacy Policy";
|
||||||
"Privacy Policy" = "Privacy Policy";
|
"movia_terms_of_service" = "Terms of Service";
|
||||||
"Terms of Service" = "Terms of Service";
|
"movia_renewal_agreement" = "Renewal Agreement";
|
||||||
"Renewal Agreement" = "Renewal Agreement";
|
"movia_profile_User_Agreement" = "User Agreement";
|
||||||
"User Agreement" = "User Agreement";
|
"movia_profile_About_Us" = "About Us";
|
||||||
"About Us" = "About Us";
|
"movia_my_list" = "My List";
|
||||||
"My list" = "My list";
|
"movia_watch_list" = "Watch list";
|
||||||
"Watch list" = "Watch list";
|
"movia_recently_viewed" = "Recently viewed";
|
||||||
"Recently viewed" = "Recently viewed";
|
"movia_affirm" = "Affirm";
|
||||||
"Affirm" = "Affirm";
|
"movia_Cancel" = "Cancel";
|
||||||
"Cancel" = "Cancel";
|
//"Select All" = "Select All";
|
||||||
"Select All" = "Select All";
|
//"Delet (%@)" = "Delet (%@)";
|
||||||
"Delet (%@)" = "Delet (%@)";
|
"movia_search_tips" = "Please enter keywords for search.";
|
||||||
"Love Me Like You Do It" = "Love Me Like You Do It";
|
"movia_explore_for_you" = "Explore For You";
|
||||||
"Explore For You" = "Explore For You";
|
"movia_continue_watching" = "Continue watching";
|
||||||
"Continue watching" = "Continue watching";
|
"movia_more_for_you" = "More for you!";
|
||||||
"More for you!" = "More for you!";
|
"movia_more" = "More";
|
||||||
"More" = "More";
|
"movia_Historical_search" = "Historical search";
|
||||||
"Historical search" = "Historical search";
|
"movia_top_search" = "Top Search";
|
||||||
"Top Search" = "Top Search";
|
"movia_text_episcode_ios" = "EP.%@";
|
||||||
"EP%@" = "EP%@";
|
"movia_full_episodes" = "Full Episodes";
|
||||||
"Full Episodes" = "Full Episodes";
|
"movia_all" = "All";
|
||||||
"All" = "All";
|
"movia_shorts" = "Shorts";
|
||||||
"Shorts" = "Shorts";
|
"movia_copy" = "Copy";
|
||||||
"EP.%@" = "EP.%@";
|
"movia_succeed" = "Succeed";
|
||||||
"Copy" = "Copy";
|
"movia_watch_history" = "Watch History";
|
||||||
"Succeed" = "Succeed";
|
"movia_child_protection_text" = "Child Personal Information Protection Rules";
|
||||||
"Watch History" = "Watch History";
|
|
||||||
"Child Personal Information Protection Rules" = "Child Personal Information Protection Rules";
|
|
||||||
"Youth Civilization Convention" = "Youth Civilization Convention";
|
"Youth Civilization Convention" = "Youth Civilization Convention";
|
||||||
"List of Third-Party Sharing of Personal Information" = "List of Third-Party Sharing of Personal Information";
|
"List of Third-Party Sharing of Personal Information" = "List of Third-Party Sharing of Personal Information";
|
||||||
"Explicit List of Personal Information Collection" = "Explicit List of Personal Information Collection";
|
"Explicit List of Personal Information Collection" = "Explicit List of Personal Information Collection";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user