From c9cc08f88bc6ea97b89c55f9001dbc0686849a68 Mon Sep 17 00:00:00 2001 From: gme_2 Date: Wed, 13 Feb 2019 10:56:36 +0900 Subject: [PATCH] translation managaed in setting --- GME Remit.xcodeproj/project.pbxproj | 4 + GMERemittance/AppDelegate.swift | 2 +- .../WkWebView/WkWebViewController.swift | 1 - .../AutoRefundsViewController.swift | 2 +- .../HomeCollectionCollectionViewCell.swift | 1 + .../Cell/HomeCollectionTableViewCell.swift | 24 ++- .../HomeRemainingLimitTableViewCell.swift | 3 +- .../View/HomeViewController.swift | 7 +- .../Interactor/LoginInteractor.swift | 4 +- .../View/LoginViewController.swift | 1 + .../View/SplashScreenViewController.swift | 56 +----- .../Profile/ProfileViewController.swift | 3 +- .../RecipientListViewController.swift | 9 +- GMERemittance/SideMenu/Setting.storyboard | 166 ++++++++++++++++++ .../SideMenu/SettingViewController.swift | 68 ++++++- .../SideMenu/SideMenuViewController.swift | 4 +- .../Social/StatusUploadViewController.swift | 2 +- GMERemittance/Utility/AppConstants.swift | 62 +++++++ GMERemittance/_Home/_Home.storyboard | 159 +---------------- en.lproj/Localizable.strings | 1 + 20 files changed, 345 insertions(+), 234 deletions(-) create mode 100644 GMERemittance/SideMenu/Setting.storyboard diff --git a/GME Remit.xcodeproj/project.pbxproj b/GME Remit.xcodeproj/project.pbxproj index 9bc8c405..bac466ad 100644 --- a/GME Remit.xcodeproj/project.pbxproj +++ b/GME Remit.xcodeproj/project.pbxproj @@ -1975,6 +1975,7 @@ D96848C9212D3AEB00EF12B1 /* ExtensionJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96848C8212D3AEB00EF12B1 /* ExtensionJSON.swift */; }; D96848CC212D3F2300EF12B1 /* ExchangeRateApiService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96848CB212D3F2300EF12B1 /* ExchangeRateApiService.swift */; }; D96848CE212D419400EF12B1 /* ApiServiceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96848CD212D419400EF12B1 /* ApiServiceType.swift */; }; + D9692A1B221396AF00795EBC /* Setting.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D9692A1A221396AF00795EBC /* Setting.storyboard */; }; D96A4FBC2146079600CFD507 /* AppConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96A4FBB2146079600CFD507 /* AppConstants.swift */; }; D96A4FD421460B4A00CFD507 /* SplashScreenModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96A4FC121460B4900CFD507 /* SplashScreenModuleInterface.swift */; }; D96A4FD521460B4A00CFD507 /* SplashScreenService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96A4FC421460B4900CFD507 /* SplashScreenService.swift */; }; @@ -4116,6 +4117,7 @@ D96848C8212D3AEB00EF12B1 /* ExtensionJSON.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionJSON.swift; sourceTree = ""; }; D96848CB212D3F2300EF12B1 /* ExchangeRateApiService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeRateApiService.swift; sourceTree = ""; }; D96848CD212D419400EF12B1 /* ApiServiceType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiServiceType.swift; sourceTree = ""; }; + D9692A1A221396AF00795EBC /* Setting.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Setting.storyboard; sourceTree = ""; }; D96A4FBB2146079600CFD507 /* AppConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConstants.swift; sourceTree = ""; }; D96A4FC121460B4900CFD507 /* SplashScreenModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SplashScreenModuleInterface.swift; sourceTree = ""; }; D96A4FC421460B4900CFD507 /* SplashScreenService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SplashScreenService.swift; sourceTree = ""; }; @@ -4311,6 +4313,7 @@ 04498A712039416E00AC4D99 /* SettingViewController.swift */, 04546C4020329A36007EFE15 /* AboutGMEViewController.swift */, D9DC105F216314BC008F3C51 /* SideMenu.storyboard */, + D9692A1A221396AF00795EBC /* Setting.storyboard */, ); path = SideMenu; sourceTree = ""; @@ -11715,6 +11718,7 @@ D93C2C5F22000D660079BF03 /* top_line_over.png in Resources */, D93C2BF322000D660079BF03 /* transkey_input_cap_20.png in Resources */, D93C284A22000D640079BF03 /* iPad_transkey_alnum_eng_8.png in Resources */, + D9692A1B221396AF00795EBC /* Setting.storyboard in Resources */, D93C2C0C22000D660079BF03 /* pt-icon65.png in Resources */, D93C297522000D650079BF03 /* iPhone_transkey_landscape_alnum_cmd_8_japanese_down.png in Resources */, D93C284C22000D640079BF03 /* iPad_transkey_alnum_cap_14.png in Resources */, diff --git a/GMERemittance/AppDelegate.swift b/GMERemittance/AppDelegate.swift index ff1a1bb5..b86f4ce6 100644 --- a/GMERemittance/AppDelegate.swift +++ b/GMERemittance/AppDelegate.swift @@ -85,7 +85,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD private func setEntryPoint() { let _default = UserDefaults.standard - if let loginStatus = _default.string(forKey: UserKeys.accessCode) { + if let _ = _default.string(forKey: UserKeys.accessCode) { // user is logged in let mainWireFrame = MainWireframe.shared diff --git a/GMERemittance/Library/WebLinks/WkWebView/WkWebViewController.swift b/GMERemittance/Library/WebLinks/WkWebView/WkWebViewController.swift index 22b9d359..baec9bb3 100644 --- a/GMERemittance/Library/WebLinks/WkWebView/WkWebViewController.swift +++ b/GMERemittance/Library/WebLinks/WkWebView/WkWebViewController.swift @@ -51,7 +51,6 @@ class WkWebViewController: UIViewController { self.activityIndicator?.hidesWhenStopped = true self.webView.bringSubview(toFront: activityIndicator!) - let headers = self.headers ?? [] diff --git a/GMERemittance/Module/Auto refund/AutoRefundsViewController.swift b/GMERemittance/Module/Auto refund/AutoRefundsViewController.swift index baaae1db..dea85e03 100644 --- a/GMERemittance/Module/Auto refund/AutoRefundsViewController.swift +++ b/GMERemittance/Module/Auto refund/AutoRefundsViewController.swift @@ -71,7 +71,7 @@ class AutoRefundsViewController: UIViewController { private func fetchInfo() { self.showProgressHud() - let username = Utility.getMyUserName() ?? "" + let username = Utility.getMyUserName() self.fetchAutoRefundInfo(username: username, success: { (autorefund) in self.autorefund = autorefund diff --git a/GMERemittance/Module/Home/User Interface/View/Cell/HomeCollectionCollectionViewCell.swift b/GMERemittance/Module/Home/User Interface/View/Cell/HomeCollectionCollectionViewCell.swift index c4b2238e..ebac9846 100644 --- a/GMERemittance/Module/Home/User Interface/View/Cell/HomeCollectionCollectionViewCell.swift +++ b/GMERemittance/Module/Home/User Interface/View/Cell/HomeCollectionCollectionViewCell.swift @@ -18,6 +18,7 @@ class HomeCollectionCollectionViewCell: UICollectionViewCell { func setup() { self.imageview.image = model?.icon + print(model?.title) self.titleLabel.text = model?.title self.dragButton.isHidden = true // self.layer.addShadow(with: <#T##UIColor#>) diff --git a/GMERemittance/Module/Home/User Interface/View/Cell/HomeCollectionTableViewCell.swift b/GMERemittance/Module/Home/User Interface/View/Cell/HomeCollectionTableViewCell.swift index 2394a760..d57c44de 100644 --- a/GMERemittance/Module/Home/User Interface/View/Cell/HomeCollectionTableViewCell.swift +++ b/GMERemittance/Module/Home/User Interface/View/Cell/HomeCollectionTableViewCell.swift @@ -7,6 +7,7 @@ // import UIKit +import Localize_Swift struct MenuNotificationName { static let sendMoney = "SendMoeny" @@ -43,21 +44,26 @@ class HomeCollectionTableViewCell: UITableViewCell, UICollectionViewDelegateFlow override func awakeFromNib() { super.awakeFromNib() // Initialization code + self.collectionView.delegate = self + self.collectionView.dataSource = self } func setup() { collectionView.addObserver(self, forKeyPath: "contentSize", options: NSKeyValueObservingOptions.old, context: nil) - self.configureMenu() - self.collectionView.delegate = self - self.collectionView.dataSource = self - + NotificationCenter.default.addObserver(self, selector: #selector(configureLanguage), name: NSNotification.Name(LCLLanguageChangeNotification), object: nil) + self.menus = self.configureMenu() + } + + @objc func configureLanguage() { + self.collectionView.reloadData() } - private func configureMenu() { + private func configureMenu() -> [HomeCollectionModel] { let sendMoneyMenu = HomeCollectionModel() sendMoneyMenu.index = 0 - sendMoneyMenu.title = "send_money_text".localized() + let text = "send_money_text".localized() + sendMoneyMenu.title = text sendMoneyMenu.icon = #imageLiteral(resourceName: "send-money") let mobileRechargeMenu = HomeCollectionModel() @@ -85,7 +91,8 @@ class HomeCollectionTableViewCell: UITableViewCell, UICollectionViewDelegateFlow walletToWalletMenu.title = "Wallet to Wallet Transfer" walletToWalletMenu.icon = #imageLiteral(resourceName: "wallet-transfer") - self.menus = [sendMoneyMenu, toadaysRateMenu, transactionStatementMenu, trackTransferMenu] + let menus = [sendMoneyMenu, toadaysRateMenu, transactionStatementMenu, trackTransferMenu] + return menus } override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { @@ -135,7 +142,8 @@ extension HomeCollectionTableViewCell: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = self.collectionView.dequeueReusableCell(withReuseIdentifier: "HomeCollectionCollectionViewCell", for: indexPath) as! HomeCollectionCollectionViewCell - cell.model = self.menus?.elementAt(index: indexPath.row) + let menus = self.configureMenu() + cell.model = menus.elementAt(index: indexPath.row) cell.setup() return cell } diff --git a/GMERemittance/Module/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift b/GMERemittance/Module/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift index 79d22549..1af31fc1 100644 --- a/GMERemittance/Module/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift +++ b/GMERemittance/Module/Home/User Interface/View/Cell/HomeRemainingLimitTableViewCell.swift @@ -36,7 +36,8 @@ class HomeRemainingLimitTableViewCell: UITableViewCell { } private func configureText() { - self.remainingYearlyLabel.text = StringConstant().yearlyLimit + let text = "remaining_limit_text".localized() + self.remainingYearlyLabel.text = text } @objc private func getYearlyLimitNotificationName() -> Notification.Name { diff --git a/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift b/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift index 2c5b1901..4c17eb4e 100644 --- a/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift +++ b/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift @@ -9,7 +9,7 @@ import UIKit import Crashlytics import RAMAnimatedTabBarController - +import Localize_Swift class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { @@ -90,6 +90,7 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) configureViews() + self.setActionBarIcons(showNotificationParameter: false) // set true if there is unread self.tableView.reloadData() } @@ -130,7 +131,7 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { NotificationCenter.default.addObserver(self, selector: #selector(self.showPennyTestFirstTime), name: NSNotification.Name.init("showPennyTestFirstTime"), object: nil) } - private func configureLanguage() { + @objc private func configureLanguage() { // self.barButtonItem.title = StringConstants().homeText } @@ -201,7 +202,7 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout { } @objc private func showSideMenuSetting() { - let vc = UIStoryboard.init(name: "_Home", bundle: nil).instantiateViewController(withIdentifier: "SettingViewController") as! SettingViewController + let vc = UIStoryboard.init(name: "Setting", bundle: nil).instantiateViewController(withIdentifier: "SettingViewController") as! SettingViewController self.navigationController?.pushViewController(vc, animated: true) } diff --git a/GMERemittance/Module/Login/Application Logic/Interactor/LoginInteractor.swift b/GMERemittance/Module/Login/Application Logic/Interactor/LoginInteractor.swift index edf38b41..0094dd63 100644 --- a/GMERemittance/Module/Login/Application Logic/Interactor/LoginInteractor.swift +++ b/GMERemittance/Module/Login/Application Logic/Interactor/LoginInteractor.swift @@ -55,7 +55,7 @@ extension LoginInteractor: LoginInteractorInput { func login(userName: String, password: String, encryptedPassword: String) { let username = userName - let validationResult = self.isValid(userName: username, password: password) + let validationResult = self.isValid(userName: username, password: encryptedPassword) if !validationResult.isValid { self.output?.show(error: validationResult.error) return @@ -68,7 +68,7 @@ extension LoginInteractor: LoginInteractorInput { print(passwordBase64Data) // send encrypted password to server for kftc - self.service._login(userId: username, password: password, success: { (user) in + self.service._login(userId: username, password: encryptedPassword, success: { (user) in let accessCode = user?.accessCode ?? "" let accessCodeBase64 = accessCode diff --git a/GMERemittance/Module/Login/User Interface/View/LoginViewController.swift b/GMERemittance/Module/Login/User Interface/View/LoginViewController.swift index 0a5dd467..2176e612 100644 --- a/GMERemittance/Module/Login/User Interface/View/LoginViewController.swift +++ b/GMERemittance/Module/Login/User Interface/View/LoginViewController.swift @@ -285,6 +285,7 @@ extension LoginViewController: TransKeyViewDelegate { qwertyCipherString = mQwertyTransKeyView?.mTK_GetSecureData() targetView = mQwertyTransKeyView self.encryptedPassword = qwertyCipherString + self.passwordTextField.text = "password" } isShowQwerty = false diff --git a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift index a34844c1..11d2d255 100644 --- a/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift +++ b/GMERemittance/Module/SplashScreen/User Interface/View/SplashScreenViewController.swift @@ -156,61 +156,9 @@ class SplashScreenViewController: UIViewController { self.buttonSignUp.setTitle("new_user_text".localized(), for: .normal) } - private func setupLanguages() { + func setupLanguages() { - let model = SendMoneyCountryViewModel() - model.name = "english_language_text".localized() - model.id = "english_language_text" - model.code = "en" - - let model2 = SendMoneyCountryViewModel() - model2.name = "korean_language_text".localized() - model2.id = "korean_language_text" - model2.code = "kr" - - let model3 = SendMoneyCountryViewModel() - model3.name = "cambodia_lanugage_text".localized() - model3.id = "cambodia_lanugage_text" - model3.code = "kh" - - - let model4 = SendMoneyCountryViewModel() - model4.name = "srilanka_lanugage_text".localized() - model4.id = "srilanka_lanugage_text" - model4.code = "lk" - - let model5 = SendMoneyCountryViewModel() - model5.name = "myanmar_language_text".localized() - model5.id = "myanmar_language_text" - model5.code = "lk" - - - let model6 = SendMoneyCountryViewModel() - model6.name = "russian_langugae_text".localized() - model6.id = "russian_langugae_text" - model6.code = "ru" - - let model7 = SendMoneyCountryViewModel() - model7.name = "vietnam_language_text".localized() - model7.id = "vietnam_language_text" - model7.code = "vn" - - let model8 = SendMoneyCountryViewModel() - model8.name = "thailand_language_text".localized() - model8.id = "thailand_language_text" - model8.code = "th" - - let model9 = SendMoneyCountryViewModel() - model9.name = "indonesia_language_text".localized() - model9.id = "indonesia_language_text" - model9.code = "id" - - let model10 = SendMoneyCountryViewModel() - model10.name = "mongolia_language_text".localized() - model10.id = "mongolia_language_text" - model10.code = "mn" - - self.languages = [model, model2, model3, model4, model5, model6, model7, model8, model9, model10] + self.languages = Utility.getLanguages() } private func configureTimer() { diff --git a/GMERemittance/Profile/ProfileViewController.swift b/GMERemittance/Profile/ProfileViewController.swift index ba5e20e6..bc398679 100644 --- a/GMERemittance/Profile/ProfileViewController.swift +++ b/GMERemittance/Profile/ProfileViewController.swift @@ -33,7 +33,7 @@ class ProfileViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillDisappear(animated) -// self.setupPicturedNavBar() + self.configureLanguage() self.setupNormalNavigation() self.navigationItem.title = StringConstants().profileText self.withdrawButton.isHidden = !Utility.pennyTestVerified() @@ -47,7 +47,6 @@ class ProfileViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - self.configureLanguage() } func configureLanguage() { diff --git a/GMERemittance/Recipient/RecipientListViewController.swift b/GMERemittance/Recipient/RecipientListViewController.swift index 8a5e8d18..930ea482 100644 --- a/GMERemittance/Recipient/RecipientListViewController.swift +++ b/GMERemittance/Recipient/RecipientListViewController.swift @@ -12,7 +12,7 @@ import RAMAnimatedTabBarController class RecipientListViewController: UIViewController { struct StringConstant { - static let swipeText = "Swipe left to “Edit” or “Delete” recipient profile." + static let swipeText = "" static let sendMoneyText = "Send Money" static let newRecipeintText = "New Recipient" static let navBarTitle = "Select Recipient" @@ -46,7 +46,7 @@ class RecipientListViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.setupNormalNavigation() - self.navigationItem.title = StringConstant.navBarTitle + self.navigationItem.title = "recipient_listing_title_text".localized() fetchReceipients() } @@ -61,9 +61,9 @@ class RecipientListViewController: UIViewController { } func configureLanguage() { - self.labelSwipeInfo.text = StringConstant.swipeText + self.labelSwipeInfo.text = "edit_delete_hint_ios_text".localized() // self.barButton.title = StringConstant.sendMoneyText - self.newRecipeintLabel.text = StringConstant.newRecipeintText + self.newRecipeintLabel.text = "new_recipient".localized() } @@ -121,7 +121,6 @@ extension RecipientListViewController: UITableViewDelegate,UITableViewDataSource } func selectedAcunt(acunt: Account) { - print(acunt.bankName) guard let index = self.selectedIndex else {return} if let navigation = self.navigationController { if let reciepient = self.reciepients?.elementAt(index: index) { diff --git a/GMERemittance/SideMenu/Setting.storyboard b/GMERemittance/SideMenu/Setting.storyboard new file mode 100644 index 00000000..53f5a6c7 --- /dev/null +++ b/GMERemittance/SideMenu/Setting.storyboard @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + SanFranciscoDisplay-Regular + + + SanFranciscoText-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GMERemittance/SideMenu/SettingViewController.swift b/GMERemittance/SideMenu/SettingViewController.swift index 26f6bfda..f84ec3bb 100644 --- a/GMERemittance/SideMenu/SettingViewController.swift +++ b/GMERemittance/SideMenu/SettingViewController.swift @@ -7,22 +7,62 @@ // import UIKit +import Localize_Swift class SettingViewController: UIViewController { struct StringConstants { - let changePasswordText = "change_password_text".localized() - let settingText = "setting_text".localized() + var changePasswordText = "change_password_text".localized() + var settingText = "setting_text".localized() + var languageText = "language_text".localized() + } + + var languages: [SendMoneyCountryViewModel] = [] + var selectedLanguage: SendMoneyCountryViewModel? { + didSet { + let code = selectedLanguage?.code ?? "en" + if code == "lk" { + Localize.setCurrentLanguage("si") + } + + if code == "kh" { + Localize.setCurrentLanguage("km") + } + + else { + Localize.setCurrentLanguage(code) + } + UserDefaults.standard.set(code, forKey: AppConstants.firstTimeLanguageIsSet) + } } @IBOutlet weak var settingLabel: UILabel! @IBOutlet weak var changePasswordButton: UIButton! + @IBOutlet weak var settingButton: UIButton! override func viewDidLoad() { super.viewDidLoad() - self.changePasswordButton.setTitle(StringConstants().changePasswordText, for: UIControlState.normal) -// self.settingLabel.text = Straing + NotificationCenter.default.addObserver(self, selector: #selector(setText), name: NSNotification.Name(LCLLanguageChangeNotification), object: nil) + setupLanguages() + configureLanguage() + } + + + + @objc func setText() { + self.changePasswordButton.setTitle("change_password_text".localized(), for: .normal) + self.settingButton.setTitle("language_text".localized(), for: .normal) + } + + private func configureLanguage() { + self.changePasswordButton.setTitle("change_password_text".localized(), for: .normal) + self.settingButton.setTitle("language_text".localized(), for: .normal) + } + + func setupLanguages() { + + self.languages = Utility.getLanguages() } override func viewWillAppear(_ animated: Bool) { @@ -42,4 +82,24 @@ class SettingViewController: UIViewController { self.navigationController!.pushViewController(changePasswordViewController, animated: true) } } + + @IBAction func settings(_ sender: Any) { + self.showCountryPickerview() + } + + @objc private func showCountryPickerview() { + setupLanguages() + let viewcontroller = UIStoryboard.init(name: "CountryPicker", bundle: nil).instantiateViewController(withIdentifier: "CountryPickerViewController") as! CountryPickerViewController + let data: [SendMoneyCountryViewModel] = self.languages + viewcontroller.isLanguageSelection = true + viewcontroller.data = data + viewcontroller.doneAction = self.countrySelected + viewcontroller.type = PickerTitle.country + self.present(viewcontroller, animated: true, completion: nil) + } + + func countrySelected(models: [SendMoneyCountryViewModel]) { + self.selectedLanguage = models.first + } + } diff --git a/GMERemittance/SideMenu/SideMenuViewController.swift b/GMERemittance/SideMenu/SideMenuViewController.swift index ccfa6320..2f41bc46 100644 --- a/GMERemittance/SideMenu/SideMenuViewController.swift +++ b/GMERemittance/SideMenu/SideMenuViewController.swift @@ -9,6 +9,7 @@ import UIKit import SDWebImage import LGSideMenuController +import Localize_Swift struct SideMenuNavigationNotifications { static let aboutGme = "aboutGme" @@ -72,6 +73,7 @@ class SideMenuViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.setUpSettingsScreen() + NotificationCenter.default.addObserver(self, selector: #selector(configureText), name: NSNotification.Name(LCLLanguageChangeNotification), object: nil) } @@ -98,7 +100,7 @@ class SideMenuViewController: UIViewController { self.addShadow(view: withdrawButton) } - private func configureText() { + @objc private func configureText() { autoDebitAccountButton.setTitle(StringConstants().autoDebitMenuText, for: UIControlState.normal) aboutGmeButton.setTitle(StringConstants().aboutGmeMenuText, for: UIControlState.normal) settingButton.setTitle(StringConstants().settingMenuText, for: UIControlState.normal) diff --git a/GMERemittance/Social/StatusUploadViewController.swift b/GMERemittance/Social/StatusUploadViewController.swift index 94f1c373..b31b1ee1 100644 --- a/GMERemittance/Social/StatusUploadViewController.swift +++ b/GMERemittance/Social/StatusUploadViewController.swift @@ -458,7 +458,7 @@ extension StatusUploadViewController: UINavigationControllerDelegate, UIImagePic socialfeedviewmodel?.uploadImage(image: gifData, isGif: true) } catch let e { - + print(e.localizedDescription) } } else { diff --git a/GMERemittance/Utility/AppConstants.swift b/GMERemittance/Utility/AppConstants.swift index 232515b7..6dcd0ea2 100644 --- a/GMERemittance/Utility/AppConstants.swift +++ b/GMERemittance/Utility/AppConstants.swift @@ -269,3 +269,65 @@ class Utility { return "172017F9EC11222E8107142733" } } + + +extension Utility { + static func getLanguages() -> [SendMoneyCountryViewModel] { + let model = SendMoneyCountryViewModel() + model.name = "english_language_text".localized() + model.id = "english_language_text" + model.code = "en" + + let model2 = SendMoneyCountryViewModel() + model2.name = "korean_language_text".localized() + model2.id = "korean_language_text" + model2.code = "kr" + + let model3 = SendMoneyCountryViewModel() + model3.name = "cambodia_lanugage_text".localized() + model3.id = "cambodia_lanugage_text" + model3.code = "kh" + + + let model4 = SendMoneyCountryViewModel() + model4.name = "srilanka_lanugage_text".localized() + model4.id = "srilanka_lanugage_text" + model4.code = "lk" + + let model5 = SendMoneyCountryViewModel() + model5.name = "myanmar_language_text".localized() + model5.id = "myanmar_language_text" + model5.code = "lk" + + + let model6 = SendMoneyCountryViewModel() + model6.name = "russian_langugae_text".localized() + model6.id = "russian_langugae_text" + model6.code = "ru" + + let model7 = SendMoneyCountryViewModel() + model7.name = "vietnam_language_text".localized() + model7.id = "vietnam_language_text" + model7.code = "vn" + + let model8 = SendMoneyCountryViewModel() + model8.name = "thailand_language_text".localized() + model8.id = "thailand_language_text" + model8.code = "th" + + let model9 = SendMoneyCountryViewModel() + model9.name = "indonesia_language_text".localized() + model9.id = "indonesia_language_text" + model9.code = "id" + + let model10 = SendMoneyCountryViewModel() + model10.name = "mongolia_language_text".localized() + model10.id = "mongolia_language_text" + model10.code = "mn" + + let languages = [model, model2, model3, model4, model5, model6, model7, model8, model9, model10] + return languages + } +} + + diff --git a/GMERemittance/_Home/_Home.storyboard b/GMERemittance/_Home/_Home.storyboard index dda40362..42b0f485 100644 --- a/GMERemittance/_Home/_Home.storyboard +++ b/GMERemittance/_Home/_Home.storyboard @@ -1578,33 +1578,33 @@ - + - + @@ -1612,13 +1612,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4055,7 +3915,6 @@ - diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index 6a33c595..b199b9c8 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -344,3 +344,4 @@ "thailand_language_text" = "Thailand"; "indonesia_language_text" = "Indonesia"; "mongolia_language_text" = "Mongolia"; +"language_text" = "Language";