diff --git a/MoviaBox/AppDelegate/AppDelegate+APNS.swift b/MoviaBox/AppDelegate/AppDelegate+APNS.swift index da5db8a..f54010a 100644 --- a/MoviaBox/AppDelegate/AppDelegate+APNS.swift +++ b/MoviaBox/AppDelegate/AppDelegate+APNS.swift @@ -42,10 +42,10 @@ extension AppDelegate { view.show() // 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() // })) -// alert.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel)) +// alert.addAction(UIAlertAction(title: "movia_Cancel".localized, style: .cancel)) // // // SPAPPTool.topViewController()?.present(alert, animated: true) diff --git a/MoviaBox/AppDelegate/AppDelegate+Thirdparty.swift b/MoviaBox/AppDelegate/AppDelegate+Thirdparty.swift index 52609db..4c326c9 100644 --- a/MoviaBox/AppDelegate/AppDelegate+Thirdparty.swift +++ b/MoviaBox/AppDelegate/AppDelegate+Thirdparty.swift @@ -21,7 +21,7 @@ extension AppDelegate { registAdjust() ///设置刷新控件的语言 - MJRefreshConfig.default.languageCode = "en" + MJRefreshConfig.default.languageCode = SPLocalizedManager.shared.mjLocalizedKey } diff --git a/MoviaBox/AppDelegate/SceneDelegate.swift b/MoviaBox/AppDelegate/SceneDelegate.swift index 0f87d3b..85f0838 100644 --- a/MoviaBox/AppDelegate/SceneDelegate.swift +++ b/MoviaBox/AppDelegate/SceneDelegate.swift @@ -99,6 +99,8 @@ extension SceneDelegate { ///语言切换 @objc private func localizedDidChange() { + MJRefreshConfig.default.languageCode = SPLocalizedManager.shared.mjLocalizedKey + let tabBarController = SPTabBarController() SPAPPTool.mainTabBarController = tabBarController diff --git a/MoviaBox/Base/Controller/SPTabBarController.swift b/MoviaBox/Base/Controller/SPTabBarController.swift index 8199375..e0d5529 100644 --- a/MoviaBox/Base/Controller/SPTabBarController.swift +++ b/MoviaBox/Base/Controller/SPTabBarController.swift @@ -20,15 +20,15 @@ class SPTabBarController: UITabBarController { super.viewDidLoad() 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 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] diff --git a/MoviaBox/Base/Networking/Base/SPNetwork.swift b/MoviaBox/Base/Networking/Base/SPNetwork.swift index a8d866e..65937ab 100644 --- a/MoviaBox/Base/Networking/Base/SPNetwork.swift +++ b/MoviaBox/Base/Networking/Base/SPNetwork.swift @@ -76,7 +76,7 @@ class SPNetwork: NSObject { var res = SPNetworkResponse() res.code = -1 if parameters.isToast { - SPToast.show(text: "Error".localized) + SPToast.show(text: "movia_error".localized) } completion?(res) } else { @@ -128,7 +128,7 @@ class SPNetwork: NSObject { var res = SPNetworkResponse() res.code = -1 if parameters.isToast { - SPToast.show(text: "Error".localized) + SPToast.show(text: "movia_error".localized) } completion?(res) } @@ -162,7 +162,7 @@ class SPNetwork: NSObject { } else { var response = SPNetworkResponse() response.code = -1 - response.msg = "Error".localized + response.msg = "movia_error".localized return response } } diff --git a/MoviaBox/Base/WebView/SPCampaignWebViewController.swift b/MoviaBox/Base/WebView/SPCampaignWebViewController.swift index 460603c..189e342 100644 --- a/MoviaBox/Base/WebView/SPCampaignWebViewController.swift +++ b/MoviaBox/Base/WebView/SPCampaignWebViewController.swift @@ -17,7 +17,7 @@ class SPCampaignWebViewController: SPWebViewController { if urlStr == SPFeedBackListWebUrl { self.title = "Feedback History".localized } else if urlStr == SPFeedBackHomeWebUrl { - self.title = "Feedback".localized + self.title = "movia_profile_Feedback".localized } else if urlStr == SPFeedBackDetailWebUrl { self.title = "Feedback Details".localized } else if urlStr == SPRewardsWebUrl { diff --git a/MoviaBox/Base/WebView/SPWebViewController.swift b/MoviaBox/Base/WebView/SPWebViewController.swift index 6247812..e099da2 100644 --- a/MoviaBox/Base/WebView/SPWebViewController.swift +++ b/MoviaBox/Base/WebView/SPWebViewController.swift @@ -52,7 +52,7 @@ class SPWebViewController: SPViewController { let str: String = urlString 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) } diff --git a/MoviaBox/Class/Explore/Controller/SPAllShortViewController.swift b/MoviaBox/Class/Explore/Controller/SPAllShortViewController.swift index c71bb27..8b78611 100644 --- a/MoviaBox/Class/Explore/Controller/SPAllShortViewController.swift +++ b/MoviaBox/Class/Explore/Controller/SPAllShortViewController.swift @@ -13,7 +13,7 @@ class SPAllShortViewController: SPViewController { private lazy var allCategoryModel: SPCategoryModel = { let model = SPCategoryModel() model.id = "0" - model.name = "All".localized + model.name = "movia_all".localized return model }() private lazy var categoryArr: [SPCategoryModel] = [self.allCategoryModel] diff --git a/MoviaBox/Class/Explore/Controller/SPExplorePageController.swift b/MoviaBox/Class/Explore/Controller/SPExplorePageController.swift index 1f94f57..85bda48 100644 --- a/MoviaBox/Class/Explore/Controller/SPExplorePageController.swift +++ b/MoviaBox/Class/Explore/Controller/SPExplorePageController.swift @@ -11,7 +11,7 @@ import UIKit class SPExplorePageController: SPViewController { private lazy var titles: [String] = { - let arr = ["Shorts".localized, "All".localized] + let arr = ["movia_shorts".localized, "movia_all".localized] return arr }() diff --git a/MoviaBox/Class/Explore/View/SPExplorePlayerControlView.swift b/MoviaBox/Class/Explore/View/SPExplorePlayerControlView.swift index faaef93..38a02bd 100644 --- a/MoviaBox/Class/Explore/View/SPExplorePlayerControlView.swift +++ b/MoviaBox/Class/Explore/View/SPExplorePlayerControlView.swift @@ -52,7 +52,7 @@ class SPExplorePlayerControlView: SPPlayerControlView { private lazy var allEpisodeButton: UIButton = { 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.setImage(UIImage(named: "arrow_right_icon_01"), for: .normal) button.jx_font = .fontMedium(ofSize: 12) @@ -74,8 +74,9 @@ class SPExplorePlayerControlView: SPPlayerControlView { } private func updateEpisodeLabel() { - let totalEpisode = String(format: "EP%@".localized, "\(self.shortModel?.episode_total ?? 0)") - let currentEpisode = String(format: "EP%@".localized, self.videoInfo?.episode ?? "0") +// let totalEpisode = String(format: "movia_text_episcode_ios".localized, "\(self.shortModel?.episode_total ?? 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 range = NSRange(location: episodeStr.length() - totalEpisode.length(), length: totalEpisode.length()) diff --git a/MoviaBox/Class/Home/Controller/SPHomePageController.swift b/MoviaBox/Class/Home/Controller/SPHomePageController.swift index e5de6be..44d85b6 100644 --- a/MoviaBox/Class/Home/Controller/SPHomePageController.swift +++ b/MoviaBox/Class/Home/Controller/SPHomePageController.swift @@ -14,15 +14,16 @@ class SPHomePageController: SPViewController { ///是否在请求中 private var isRequesting = false - private lazy var categoryArr: [SPHomeCategoryModel] = { - let arr = [ - SPHomeCategoryModel(category_name: "Hot Picks".localized, category_id: nil, viewController: SPHomeViewController()), - SPHomeCategoryModel(category_name: "Top 10".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 - }() + private lazy var categoryArr: [SPHomeCategoryModel] = [] +// { +// let arr = [ +// SPHomeCategoryModel(category_name: "Hot Picks".localized, category_id: nil, viewController: SPHomeViewController()), +// SPHomeCategoryModel(category_name: "Top 10".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 +// }() private lazy var searchButton: SPHomeSearchButton = { let button = SPHomeSearchButton() diff --git a/MoviaBox/Class/Home/View/SPHomeDataItemView.swift b/MoviaBox/Class/Home/View/SPHomeDataItemView.swift index a40ccd5..7ed5d89 100644 --- a/MoviaBox/Class/Home/View/SPHomeDataItemView.swift +++ b/MoviaBox/Class/Home/View/SPHomeDataItemView.swift @@ -42,7 +42,7 @@ class SPHomeDataItemView: UIView { private lazy var moreButton: UIButton = { let button = UIButton(type: .custom) - button.setTitle("More".localized, for: .normal) + button.setTitle("movia_more".localized, for: .normal) button.setTitleColor(.colorF564B6(), for: .normal) button.titleLabel?.font = .fontLight(ofSize: 12) return button diff --git a/MoviaBox/Class/Home/View/SPHomeExploreView.swift b/MoviaBox/Class/Home/View/SPHomeExploreView.swift index d01d319..41e3c6a 100644 --- a/MoviaBox/Class/Home/View/SPHomeExploreView.swift +++ b/MoviaBox/Class/Home/View/SPHomeExploreView.swift @@ -62,7 +62,7 @@ class SPHomeExploreView: SPHomeDataItemView { override init(frame: CGRect) { super.init(frame: frame) - titleLabel.text = "Explore For You".localized + titleLabel.text = "movia_explore_for_you".localized iconImageView.image = UIImage(named: "mark_icon_01") _setupUI() diff --git a/MoviaBox/Class/Home/View/SPHomeHeaderView.swift b/MoviaBox/Class/Home/View/SPHomeHeaderView.swift index f56cd87..6083bda 100644 --- a/MoviaBox/Class/Home/View/SPHomeHeaderView.swift +++ b/MoviaBox/Class/Home/View/SPHomeHeaderView.swift @@ -108,7 +108,7 @@ class SPHomeHeaderView: UICollectionReusableView { private lazy var titleView: SPHomeDataItemView = { let view = SPHomeDataItemView() - view.titleLabel.text = "More for you!".localized + view.titleLabel.text = "movia_more_for_you".localized return view }() diff --git a/MoviaBox/Class/Home/View/SPHomeHotSearchView.swift b/MoviaBox/Class/Home/View/SPHomeHotSearchView.swift index d86abda..ab63e70 100644 --- a/MoviaBox/Class/Home/View/SPHomeHotSearchView.swift +++ b/MoviaBox/Class/Home/View/SPHomeHotSearchView.swift @@ -25,7 +25,7 @@ class SPHomeHotSearchView: UIView { let label = UILabel() label.font = .fontMedium(ofSize: 16) label.textColor = .colorFFFFFF() - label.text = "Top Search".localized + label.text = "movia_top_search".localized return label }() diff --git a/MoviaBox/Class/Home/View/SPHomeHotView.swift b/MoviaBox/Class/Home/View/SPHomeHotView.swift index 055684a..cfcac6e 100644 --- a/MoviaBox/Class/Home/View/SPHomeHotView.swift +++ b/MoviaBox/Class/Home/View/SPHomeHotView.swift @@ -46,7 +46,7 @@ class SPHomeHotView: SPHomeDataItemView { override init(frame: CGRect) { super.init(frame: frame) - self.titleLabel.text = "Editor's Hotlist".localized + self.titleLabel.text = "movia_editors_hotlist".localized _setupUI() } diff --git a/MoviaBox/Class/Home/View/SPHomePlayHistoryView.swift b/MoviaBox/Class/Home/View/SPHomePlayHistoryView.swift index fa64b0e..68335d5 100644 --- a/MoviaBox/Class/Home/View/SPHomePlayHistoryView.swift +++ b/MoviaBox/Class/Home/View/SPHomePlayHistoryView.swift @@ -42,7 +42,7 @@ class SPHomePlayHistoryView: SPHomeDataItemView { override init(frame: CGRect) { super.init(frame: frame) - self.titleLabel.text = "Continue watching".localized + self.titleLabel.text = "movia_continue_watching".localized _setupUI() diff --git a/MoviaBox/Class/Home/View/SPHomeSearchButton.swift b/MoviaBox/Class/Home/View/SPHomeSearchButton.swift index d857e02..3531246 100644 --- a/MoviaBox/Class/Home/View/SPHomeSearchButton.swift +++ b/MoviaBox/Class/Home/View/SPHomeSearchButton.swift @@ -23,7 +23,7 @@ class SPHomeSearchButton: UIControl { let label = UILabel() label.font = .fontRegular(ofSize: 12) label.textColor = .colorFFFFFF(alpha: 0.52) - label.text = "Love Me Like You Do It".localized + label.text = "movia_search_tips".localized return label }() diff --git a/MoviaBox/Class/Home/View/SPHomeSearchHistoryView.swift b/MoviaBox/Class/Home/View/SPHomeSearchHistoryView.swift index 2e38025..ae9bc01 100644 --- a/MoviaBox/Class/Home/View/SPHomeSearchHistoryView.swift +++ b/MoviaBox/Class/Home/View/SPHomeSearchHistoryView.swift @@ -30,7 +30,7 @@ class SPHomeSearchHistoryView: UIView { let label = UILabel() label.font = .fontBold(ofSize: 16) label.textColor = .colorE7F5FF() - label.text = "Historical search".localized + label.text = "movia_Historical_search".localized return label }() diff --git a/MoviaBox/Class/Home/View/SPHomeShortsForYouView.swift b/MoviaBox/Class/Home/View/SPHomeShortsForYouView.swift index 23650e1..3a060f8 100644 --- a/MoviaBox/Class/Home/View/SPHomeShortsForYouView.swift +++ b/MoviaBox/Class/Home/View/SPHomeShortsForYouView.swift @@ -43,7 +43,7 @@ class SPHomeShortsForYouView: SPHomeDataItemView { override init(frame: CGRect) { super.init(frame: frame) - self.titleLabel.text = "Shorts for You".localized + self.titleLabel.text = "movia_shorts_for_you".localized _setupUI() } diff --git a/MoviaBox/Class/Home/View/SPHomeTrendingView.swift b/MoviaBox/Class/Home/View/SPHomeTrendingView.swift index 6627228..edbf3f7 100644 --- a/MoviaBox/Class/Home/View/SPHomeTrendingView.swift +++ b/MoviaBox/Class/Home/View/SPHomeTrendingView.swift @@ -64,7 +64,7 @@ class SPHomeTrendingView: SPHomeDataItemView { override init(frame: CGRect) { super.init(frame: frame) - self.titleLabel.text = "Trending Now".localized + self.titleLabel.text = "movia_trending_now".localized _setupUI() } diff --git a/MoviaBox/Class/Login/Controller/SPLoginViewController.swift b/MoviaBox/Class/Login/Controller/SPLoginViewController.swift index 9174ca6..7618a8e 100644 --- a/MoviaBox/Class/Login/Controller/SPLoginViewController.swift +++ b/MoviaBox/Class/Login/Controller/SPLoginViewController.swift @@ -42,8 +42,8 @@ class SPLoginViewController: SPViewController { private lazy var agreementLabel: YYLabel = { let agreementStr = "kLoginAgreementText".localized - let userAgreementStr = "User Agreement".localized - let privacyPolicy = "Privacy Policy".localized + let userAgreementStr = "movia_profile_User_Agreement".localized + let privacyPolicy = "movia_profile_Privacy_Policy".localized let range1 = agreementStr.ocString().range(of: userAgreementStr) let range2 = agreementStr.ocString().range(of: privacyPolicy) diff --git a/MoviaBox/Class/Mine/Controller/SPAboutUsViewController.swift b/MoviaBox/Class/Mine/Controller/SPAboutUsViewController.swift index c0a821e..f13d610 100644 --- a/MoviaBox/Class/Mine/Controller/SPAboutUsViewController.swift +++ b/MoviaBox/Class/Mine/Controller/SPAboutUsViewController.swift @@ -11,9 +11,9 @@ class SPAboutUsViewController: SPViewController { private lazy var dataArr: [SPMineItem] = { let arr = [ - SPMineItem(type: .userAgreement, title: "User Agreement".localized), - SPMineItem(type: .privacyPolicy, title: "Privacy Policy".localized), - SPMineItem(type: .informationProtection, title: "Child Personal Information Protection Rules".localized), + SPMineItem(type: .userAgreement, title: "movia_profile_User_Agreement".localized), + SPMineItem(type: .privacyPolicy, title: "movia_profile_Privacy_Policy".localized), + SPMineItem(type: .informationProtection, title: "movia_child_protection_text".localized), SPMineItem(type: .civizatioConvention, title: "Youth Civilization Convention".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), @@ -37,7 +37,7 @@ class SPAboutUsViewController: SPViewController { override func viewDidLoad() { super.viewDidLoad() - self.title = "About Us".localized + self.title = "movia_profile_About_Us".localized setBackgroundView(isShowGradient: false, bgImage: nil) _setupUI() } diff --git a/MoviaBox/Class/Mine/Controller/SPLanguageViewController.swift b/MoviaBox/Class/Mine/Controller/SPLanguageViewController.swift index ad1e995..a0d59e0 100644 --- a/MoviaBox/Class/Mine/Controller/SPLanguageViewController.swift +++ b/MoviaBox/Class/Mine/Controller/SPLanguageViewController.swift @@ -29,7 +29,7 @@ class SPLanguageViewController: SPViewController { override func viewDidLoad() { super.viewDidLoad() self.edgesForExtendedLayout = .top - self.title = "Language".localized + self.title = "movia_profile_Language".localized requestDataList() diff --git a/MoviaBox/Class/Mine/Controller/SPMineViewController.swift b/MoviaBox/Class/Mine/Controller/SPMineViewController.swift index a061bd6..d4970bd 100644 --- a/MoviaBox/Class/Mine/Controller/SPMineViewController.swift +++ b/MoviaBox/Class/Mine/Controller/SPMineViewController.swift @@ -11,12 +11,12 @@ class SPMineViewController: SPViewController { private lazy var dataArr: [SPMineItem] = { let arr = [ - SPMineItem(type: .language, iconImage: UIImage(named: "language_icon_01"), title: "Language".localized), - SPMineItem(type: .feedBack, iconImage: UIImage(named: "feed_back_icon_01"), title: "FeedBack".localized), - SPMineItem(type: .privacyPolicy, iconImage: UIImage(named: "privacy_policy_icon_01"), title: "Privacy Policy".localized), - SPMineItem(type: .userAgreement, iconImage: UIImage(named: "user_agreement_icon_01"), title: "User Agreement".localized), - SPMineItem(type: .aboutUs, iconImage: UIImage(named: "about_us_icon_01"), title: "About Us".localized), - SPMineItem(type: .settings, iconImage: UIImage(named: "settings_icon_01"), title: "Settings".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: "movia_profile_Feedback".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: "movia_profile_User_Agreement".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: "movia_profile_Setting".localized), ] return arr }() diff --git a/MoviaBox/Class/Mine/Controller/SPSettingsViewController.swift b/MoviaBox/Class/Mine/Controller/SPSettingsViewController.swift index ee99ea8..5a5f0b6 100644 --- a/MoviaBox/Class/Mine/Controller/SPSettingsViewController.swift +++ b/MoviaBox/Class/Mine/Controller/SPSettingsViewController.swift @@ -32,7 +32,7 @@ class SPSettingsViewController: SPViewController { override func viewDidLoad() { super.viewDidLoad() self.setBackgroundView(isShowGradient: false, bgImage: nil) - self.title = "Settings".localized + self.title = "movia_profile_Setting".localized SPAppCacheManager.manager.getAllCache { [weak self] value in guard let self = self else { return } @@ -129,14 +129,14 @@ extension SPSettingsViewController { ///退出登录 private func logout() { 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 guard let self = self else { return } 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) } @@ -146,7 +146,7 @@ extension SPSettingsViewController { var arr = [ 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 { diff --git a/MoviaBox/Class/Mine/View/SPMineHeaderView.swift b/MoviaBox/Class/Mine/View/SPMineHeaderView.swift index 1013ea0..b92e50e 100644 --- a/MoviaBox/Class/Mine/View/SPMineHeaderView.swift +++ b/MoviaBox/Class/Mine/View/SPMineHeaderView.swift @@ -87,7 +87,7 @@ class SPMineHeaderView: UIView { private lazy var copyButton: UIButton = { let button = UIButton(type: .custom) - button.setTitle("Copy".localized, for: .normal) + button.setTitle("movia_copy".localized, for: .normal) button.setTitleColor(.colorFFFFFF(), for: .normal) button.titleLabel?.font = .fontRegular(ofSize: 12) button.setBackgroundImage(UIImage(color: .color58484B(alpha: 0.56)), for: .normal) diff --git a/MoviaBox/Class/Mine/View/SPMinePlayHistoryView.swift b/MoviaBox/Class/Mine/View/SPMinePlayHistoryView.swift index 9ebad3b..c42b263 100644 --- a/MoviaBox/Class/Mine/View/SPMinePlayHistoryView.swift +++ b/MoviaBox/Class/Mine/View/SPMinePlayHistoryView.swift @@ -33,7 +33,7 @@ class SPMinePlayHistoryView: UIView { let label = UILabel() label.font = .fontMedium(ofSize: 16) label.textColor = .colorFFFFFF() - label.text = "Watch History".localized + label.text = "movia_watch_history".localized return label }() diff --git a/MoviaBox/Class/MyList/Controller/SPMyListChildViewController.swift b/MoviaBox/Class/MyList/Controller/SPMyListChildViewController.swift index 92848b6..aaa245d 100644 --- a/MoviaBox/Class/MyList/Controller/SPMyListChildViewController.swift +++ b/MoviaBox/Class/MyList/Controller/SPMyListChildViewController.swift @@ -75,8 +75,8 @@ class SPMyListChildViewController: SPViewController { let count = self.selectedCount deleteButton.isEnabled = count > 0 - let text = String(format: "Delet (%@)".localized, "\(selectedCount)") - deleteButton.setTitle(text, for: .normal) +// let text = String(format: "Delet (%@)".localized, "\(selectedCount)") +// deleteButton.setTitle(text, for: .normal) } @objc func handelDeleteButton() { diff --git a/MoviaBox/Class/MyList/Controller/SPMyListViewController.swift b/MoviaBox/Class/MyList/Controller/SPMyListViewController.swift index 2da6710..954267c 100644 --- a/MoviaBox/Class/MyList/Controller/SPMyListViewController.swift +++ b/MoviaBox/Class/MyList/Controller/SPMyListViewController.swift @@ -10,7 +10,7 @@ import UIKit 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] = { let vc1 = SPCollectListViewController() @@ -81,7 +81,7 @@ class SPMyListViewController: SPViewController { private lazy var cancelButton: UIButton = { 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.setTitleColor(.colorFFFFFF(alpha: 0.9), for: .normal) // button.titleLabel?.font = .fontRegular(ofSize: 15) @@ -93,7 +93,7 @@ class SPMyListViewController: SPViewController { ///全选按钮 private lazy var allSelectedButton: UIButton = { 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.setImage(UIImage(named: "check_icon_01"), for: .normal) button.setImage(UIImage(named: "check_icon_01_selected"), for: .selected) diff --git a/MoviaBox/Class/MyList/View/SPPlayHistoryCell.swift b/MoviaBox/Class/MyList/View/SPPlayHistoryCell.swift index a51f202..23333dd 100644 --- a/MoviaBox/Class/MyList/View/SPPlayHistoryCell.swift +++ b/MoviaBox/Class/MyList/View/SPPlayHistoryCell.swift @@ -14,7 +14,7 @@ class SPPlayHistoryCell: SPCollectionViewCell { coverImageView.sp_setImage(url: model?.image_url) 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 range = NSRange(location: episode.length(), length: totalEpisode.length()) diff --git a/MoviaBox/Class/Player/View/SPPlayerControlView.swift b/MoviaBox/Class/Player/View/SPPlayerControlView.swift index 89273e4..28e20fa 100644 --- a/MoviaBox/Class/Player/View/SPPlayerControlView.swift +++ b/MoviaBox/Class/Player/View/SPPlayerControlView.swift @@ -102,13 +102,13 @@ class SPPlayerControlView: UIView { ///收藏按钮 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) return button }() 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) return button }() diff --git a/MoviaBox/Class/Wallet/Controller/SPStoreViewController.swift b/MoviaBox/Class/Wallet/Controller/SPStoreViewController.swift index 47320b6..1c6e01f 100644 --- a/MoviaBox/Class/Wallet/Controller/SPStoreViewController.swift +++ b/MoviaBox/Class/Wallet/Controller/SPStoreViewController.swift @@ -55,9 +55,9 @@ class SPStoreViewController: SPViewController { }() private lazy var agreementLabel: YYLabel = { - let text1 = "Terms of Service".localized - let text2 = "Privacy Policy".localized - let text3 = "Renewal Agreement".localized + let text1 = "movia_terms_of_service".localized + let text2 = "movia_profile_Privacy_Policy".localized + let text3 = "movia_renewal_agreement".localized let text = "\(text1) | \(text2)\n\(text3)" let range1 = text.ocString().range(of: text1) let range2 = text.ocString().range(of: text2) diff --git a/MoviaBox/Class/Wallet/Controller/SPWalletViewController.swift b/MoviaBox/Class/Wallet/Controller/SPWalletViewController.swift index f691902..5c14e6e 100644 --- a/MoviaBox/Class/Wallet/Controller/SPWalletViewController.swift +++ b/MoviaBox/Class/Wallet/Controller/SPWalletViewController.swift @@ -14,7 +14,7 @@ class SPWalletViewController: SPViewController { 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: .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 }() diff --git a/MoviaBox/Libs/APPTool/SPAPPTool.swift b/MoviaBox/Libs/APPTool/SPAPPTool.swift index bd735a0..88740b1 100644 --- a/MoviaBox/Libs/APPTool/SPAPPTool.swift +++ b/MoviaBox/Libs/APPTool/SPAPPTool.swift @@ -81,7 +81,7 @@ extension SPAPPTool { if let text = text { let copy = UIPasteboard.general copy.string = text - SPToast.show(text: "Succeed".localized) + SPToast.show(text: "movia_succeed".localized) } } diff --git a/MoviaBox/Libs/SPIAPManager/SPIAPManager.swift b/MoviaBox/Libs/SPIAPManager/SPIAPManager.swift index a6d9ed6..497f274 100644 --- a/MoviaBox/Libs/SPIAPManager/SPIAPManager.swift +++ b/MoviaBox/Libs/SPIAPManager/SPIAPManager.swift @@ -107,14 +107,13 @@ class SPIAPManager: NSObject { SPLoginManager.manager.userInfo?.is_vip = true if isLoding { - SPToast.show(text: "success".localized) + SPToast.show(text: "movia_success".localized) } completer?(true) if buyType == .vip { NotificationCenter.default.post(name: SPIAPManager.buyVipFinishNotification, object: nil) } } else { -// SPToast.show(text: "failure".localized) completer?(false) } } @@ -157,7 +156,7 @@ extension SPIAPManager: JXIAPManagerDelegate { if model.status == "success" { SPLoginManager.manager.userInfo?.is_vip = true - SPToast.show(text: "success".localized) + SPToast.show(text: "movia_success".localized) self.completionHandler?(true) if buyType == .vip { NotificationCenter.default.post(name: SPIAPManager.buyVipFinishNotification, object: nil) diff --git a/MoviaBox/Libs/SPLocalizedManager/SPLocalizedManager.swift b/MoviaBox/Libs/SPLocalizedManager/SPLocalizedManager.swift index 3470b3b..b1f3122 100644 --- a/MoviaBox/Libs/SPLocalizedManager/SPLocalizedManager.swift +++ b/MoviaBox/Libs/SPLocalizedManager/SPLocalizedManager.swift @@ -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 { return UserDefaults.standard.string(forKey: LocalizedUserDefaultsKey) == nil diff --git a/MoviaBox/Source/en.lproj/Localizable.strings b/MoviaBox/Source/en.lproj/Localizable.strings index b8a444f..88a2c61 100644 --- a/MoviaBox/Source/en.lproj/Localizable.strings +++ b/MoviaBox/Source/en.lproj/Localizable.strings @@ -6,53 +6,51 @@ 英语 */ -"Home" = "Home"; -"success" = "success"; -"failure" = "failure"; -"For You" = "For You"; -"Error" = "Error"; -"Profile" = "Profile"; -"Hot Picks" = "Hot Picks"; -"Top 10" = "Top 10"; -"Fresh Drops" = "Fresh Drops"; -"Free" = "Free"; -"Trending Now" = "Trending Now"; -"Editor's Hotlist" = "Editor's Hotlist"; -"Shorts for You" = "Shorts for You"; -"Series" = "Series"; -"Save" = "Save"; -"Added" = "Added"; -"FeedBack" = "FeedBack"; -"Settings" = "Settings"; -"Language" = "Language"; -"Privacy Policy" = "Privacy Policy"; -"Terms of Service" = "Terms of Service"; -"Renewal Agreement" = "Renewal Agreement"; -"User Agreement" = "User Agreement"; -"About Us" = "About Us"; -"My list" = "My list"; -"Watch list" = "Watch list"; -"Recently viewed" = "Recently viewed"; -"Affirm" = "Affirm"; -"Cancel" = "Cancel"; -"Select All" = "Select All"; -"Delet (%@)" = "Delet (%@)"; -"Love Me Like You Do It" = "Love Me Like You Do It"; -"Explore For You" = "Explore For You"; -"Continue watching" = "Continue watching"; -"More for you!" = "More for you!"; -"More" = "More"; -"Historical search" = "Historical search"; -"Top Search" = "Top Search"; -"EP%@" = "EP%@"; -"Full Episodes" = "Full Episodes"; -"All" = "All"; -"Shorts" = "Shorts"; -"EP.%@" = "EP.%@"; -"Copy" = "Copy"; -"Succeed" = "Succeed"; -"Watch History" = "Watch History"; -"Child Personal Information Protection Rules" = "Child Personal Information Protection Rules"; +"movia_home" = "Home"; +"movia_success" = "Success"; +"movia_for_you" = "For You"; +"movia_error" = "Error"; +"movia_profile" = "Profile"; +//"Hot Picks" = "Hot Picks"; +//"Top 10" = "Top 10"; +//"Fresh Drops" = "Fresh Drops"; +//"Free" = "Free"; +"movia_trending_now" = "Trending Now"; +"movia_editors_hotlist" = "Editor's Hotlist"; +"movia_shorts_for_you" = "Shorts for You"; +"movia_series" = "Series"; +"movia_save" = "Save"; +"movia_added" = "Added"; +"movia_profile_Feedback" = "Feedback"; +"movia_profile_Setting" = "Settings"; +"movia_profile_Language" = "Language"; +"movia_profile_Privacy_Policy" = "Privacy Policy"; +"movia_terms_of_service" = "Terms of Service"; +"movia_renewal_agreement" = "Renewal Agreement"; +"movia_profile_User_Agreement" = "User Agreement"; +"movia_profile_About_Us" = "About Us"; +"movia_my_list" = "My List"; +"movia_watch_list" = "Watch list"; +"movia_recently_viewed" = "Recently viewed"; +"movia_affirm" = "Affirm"; +"movia_Cancel" = "Cancel"; +//"Select All" = "Select All"; +//"Delet (%@)" = "Delet (%@)"; +"movia_search_tips" = "Please enter keywords for search."; +"movia_explore_for_you" = "Explore For You"; +"movia_continue_watching" = "Continue watching"; +"movia_more_for_you" = "More for you!"; +"movia_more" = "More"; +"movia_Historical_search" = "Historical search"; +"movia_top_search" = "Top Search"; +"movia_text_episcode_ios" = "EP.%@"; +"movia_full_episodes" = "Full Episodes"; +"movia_all" = "All"; +"movia_shorts" = "Shorts"; +"movia_copy" = "Copy"; +"movia_succeed" = "Succeed"; +"movia_watch_history" = "Watch History"; +"movia_child_protection_text" = "Child Personal Information Protection Rules"; "Youth Civilization Convention" = "Youth Civilization Convention"; "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";