From 5ea0f52df4adaeea80e2a90f6db47d3566a369e8 Mon Sep 17 00:00:00 2001 From: Craig Holliday Date: Wed, 11 Oct 2017 20:05:11 -0500 Subject: [PATCH] Added swiftgen and abstracted all strings to L10n enum --- Constants/L10nEnum.swift | 101 ++++++++++++++++++++ Podfile | 1 + Podfile.lock | 5 +- SEDaily-IOS.xcodeproj/project.pbxproj | 27 ++++++ SEDaily-IOS/Base.lproj/Localizable.strings | 1 - SEDaily-IOS/CustomTabViewController.swift | 8 +- SEDaily-IOS/Helpers.swift | 35 ++++--- SEDaily-IOS/LoginViewController.swift | 16 ++-- SEDaily-IOS/PodcastPageViewController.swift | 22 ++--- SEDaily-IOS/fr.lproj/Localizable.strings | 1 - 10 files changed, 173 insertions(+), 44 deletions(-) create mode 100644 Constants/L10nEnum.swift diff --git a/Constants/L10nEnum.swift b/Constants/L10nEnum.swift new file mode 100644 index 0000000..05e0c94 --- /dev/null +++ b/Constants/L10nEnum.swift @@ -0,0 +1,101 @@ +// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen + +import Foundation + +// swiftlint:disable file_length + +// swiftlint:disable explicit_type_interface identifier_name line_length nesting type_body_length type_name +enum L10n { + /// Email Field Empty + static let alertMessageEmailEmpty = L10n.tr("Localizable", "AlertMessageEmailEmpty") + /// Invalid Email Format + static let alertMessageEmailWrongFormat = L10n.tr("Localizable", "AlertMessageEmailWrongFormat") + /// First Name Field Empty + static let alertMessageFirstNameEmpty = L10n.tr("Localizable", "AlertMessageFirstNameEmpty") + /// First Name must be longer than 1 characters + static let alertMessageFirstNameNotLongEnough = L10n.tr("Localizable", "AlertMessageFirstNameNotLongEnough") + /// Issue with User Token + static let alertMessageIssueWithUserToken = L10n.tr("Localizable", "AlertMessageIssueWithUserToken") + /// Last Name Field Empty + static let alertMessageLastNameEmpty = L10n.tr("Localizable", "AlertMessageLastNameEmpty") + /// Last Name must be longer than 1 characters + static let alertMessageLastNameNotLongEnough = L10n.tr("Localizable", "AlertMessageLastNameNotLongEnough") + /// Successfully Logged Out + static let alertMessageLogoutSuccess = L10n.tr("Localizable", "AlertMessageLogoutSuccess") + /// Confirm Password Field Empty + static let alertMessagePasswordConfirmEmpty = L10n.tr("Localizable", "AlertMessagePasswordConfirmEmpty") + /// Password Field Empty + static let alertMessagePasswordEmpty = L10n.tr("Localizable", "AlertMessagePasswordEmpty") + /// Password must be longer than 6 characters + static let alertMessagePasswordNotLongEnough = L10n.tr("Localizable", "AlertMessagePasswordNotLongEnough") + /// Password do not match + static let alertMessagePasswordsDonotMatch = L10n.tr("Localizable", "AlertMessagePasswordsDonotMatch") + /// Please Login + static let alertMessagePleaseLogin = L10n.tr("Localizable", "AlertMessagePleaseLogin") + /// You must login to use this feature. + static let alertMessageYouMustLogin = L10n.tr("Localizable", "AlertMessageYouMustLogin") + /// Cancel + static let cancelButtonTitle = L10n.tr("Localizable", "CancelButtonTitle") + /// Confirm Password + static let confirmPasswordPlaceholder = L10n.tr("Localizable", "ConfirmPasswordPlaceholder") + /// Email + static let emailAddressPlaceholder = L10n.tr("Localizable", "EmailAddressPlaceholder") + /// First Name + static let firstNamePlaceholder = L10n.tr("Localizable", "FirstNamePlaceholder") + /// Error + static let genericError = L10n.tr("Localizable", "GenericError") + /// OK + static let genericOK = L10n.tr("Localizable", "GenericOK") + /// Okay + static let genericOkay = L10n.tr("Localizable", "GenericOkay") + /// Success + static let genericSuccess = L10n.tr("Localizable", "GenericSuccess") + /// Last Name + static let lastNamePlaceholder = L10n.tr("Localizable", "LastNamePlaceholder") + /// Login + static let loginButtonTitle = L10n.tr("Localizable", "LoginButtonTitle") + /// Login + static let loginTitle = L10n.tr("Localizable", "LoginTitle") + /// Logout + static let logoutTitle = L10n.tr("Localizable", "LogoutTitle") + /// Password + static let passwordPlaceholder = L10n.tr("Localizable", "PasswordPlaceholder") + /// Sign Up + static let signUpButtonTitle = L10n.tr("Localizable", "SignUpButtonTitle") + /// Just For You + static let tabBarJustForYou = L10n.tr("Localizable", "TabBarJustForYou") + /// Latest + static let tabBarTitleLatest = L10n.tr("Localizable", "TabBarTitleLatest") + /// All + static let tabTitleAll = L10n.tr("Localizable", "TabTitleAll") + /// Blockchain + static let tabTitleBlockchain = L10n.tr("Localizable", "TabTitleBlockchain") + /// Business and Philosophy + static let tabTitleBusinessAndPhilosophy = L10n.tr("Localizable", "TabTitleBusinessAndPhilosophy") + /// Cloud Engineering + static let tabTitleCloudEngineering = L10n.tr("Localizable", "TabTitleCloudEngineering") + /// Data + static let tabTitleData = L10n.tr("Localizable", "TabTitleData") + /// Greatest Hits + static let tabTitleGreatestHits = L10n.tr("Localizable", "TabTitleGreatestHits") + /// Hackers + static let tabTitleHackers = L10n.tr("Localizable", "TabTitleHackers") + /// JavaScript + static let tabTitleJavaScript = L10n.tr("Localizable", "TabTitleJavaScript") + /// Machine Learning + static let tabTitleMachineLearning = L10n.tr("Localizable", "TabTitleMachineLearning") + /// Open Source + static let tabTitleOpenSource = L10n.tr("Localizable", "TabTitleOpenSource") + /// Security + static let tabTitleSecurity = L10n.tr("Localizable", "TabTitleSecurity") +} +// swiftlint:enable explicit_type_interface identifier_name line_length nesting type_body_length type_name + +extension L10n { + fileprivate static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { + let format = NSLocalizedString(key, tableName: table, bundle: Bundle(for: BundleToken.self), comment: "") + return String(format: format, locale: Locale.current, arguments: args) + } +} + +private final class BundleToken {} diff --git a/Podfile b/Podfile index a45470c..eb05608 100644 --- a/Podfile +++ b/Podfile @@ -29,6 +29,7 @@ target 'SEDaily-IOS' do pod 'KTResponsiveUI' pod 'KoalaTeaPlayer' pod 'Tabman' + pod 'SwiftGen' target 'SEDaily-IOSTests' do inherit! :search_paths diff --git a/Podfile.lock b/Podfile.lock index 8e55952..fe681df 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -39,6 +39,7 @@ PODS: - SwifterSwift/Foundation (4.0.0) - SwifterSwift/SwiftStdlib (4.0.0) - SwifterSwift/UIKit (4.0.0) + - SwiftGen (5.1.2) - SwiftIcons (1.5.1) - SwiftyBeaver (1.4.2) - SwiftyJSON (3.1.4) @@ -64,6 +65,7 @@ DEPENDENCIES: - SideMenu - SnapKit - SwifterSwift + - SwiftGen - SwiftIcons (from `https://github.com/themisterholliday/SwiftIcons.git`, branch `swift-4`) - SwiftyBeaver - SwiftyJSON @@ -105,12 +107,13 @@ SPEC CHECKSUMS: SideMenu: 8fe957e0f5dcf1a1175c8ba5d47978d4eb2a89da SnapKit: a42d492c16e80209130a3379f73596c3454b7694 SwifterSwift: 0b63ade1ec0c5bc4d6228df993de41fe44bc123e + SwiftGen: dd2892e7fb008151f30e6ce0cf465b8b8d89e80e SwiftIcons: b20641adce6b71fcb2e72389b4b5f2e87252df99 SwiftyBeaver: 91057725648ee4980308f1650af077d04b3654a0 SwiftyJSON: c2842d878f95482ffceec5709abc3d05680c0220 Tabman: 558bede024627206c554e1c8cee728d380655ebf UIFontComplete: 7e3ce7f0a12d2529fb07f537e262aabfa87df280 -PODFILE CHECKSUM: 66b19d5ea05da768f11f82f3d16acb7e731bf857 +PODFILE CHECKSUM: 7d6c85bc7ebf3763fd5c8d2c35b66e7dd8a35654 COCOAPODS: 1.3.1 diff --git a/SEDaily-IOS.xcodeproj/project.pbxproj b/SEDaily-IOS.xcodeproj/project.pbxproj index 65b303b..6f9c5d5 100644 --- a/SEDaily-IOS.xcodeproj/project.pbxproj +++ b/SEDaily-IOS.xcodeproj/project.pbxproj @@ -42,6 +42,7 @@ 1686FC081F009EC00088A6C1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1686FC071F009EC00088A6C1 /* Assets.xcassets */; }; 1686FC0B1F009EC00088A6C1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1686FC091F009EC00088A6C1 /* LaunchScreen.storyboard */; }; 1686FC161F009EC00088A6C1 /* SEDaily_IOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1686FC151F009EC00088A6C1 /* SEDaily_IOSTests.swift */; }; + 169806A61F8EF3970075D8AD /* L10nEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 169806A51F8EF08F0075D8AD /* L10nEnum.swift */; }; 16B147B11F16BF9C00433A42 /* AudioViewManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16B147B01F16BF9C00433A42 /* AudioViewManager.swift */; }; 16D67C4A1F33AC620065E838 /* AnswersTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D67C491F33AC620065E838 /* AnswersTracker.swift */; }; 16D67C4D1F33AE370065E838 /* ObjectExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D67C4C1F33AE370065E838 /* ObjectExtensions.swift */; }; @@ -101,6 +102,7 @@ 1686FC111F009EC00088A6C1 /* SEDaily-IOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SEDaily-IOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 1686FC151F009EC00088A6C1 /* SEDaily_IOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SEDaily_IOSTests.swift; sourceTree = ""; }; 1686FC171F009EC00088A6C1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 169806A51F8EF08F0075D8AD /* L10nEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = L10nEnum.swift; sourceTree = ""; }; 16B147B01F16BF9C00433A42 /* AudioViewManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioViewManager.swift; sourceTree = ""; }; 16D67C491F33AC620065E838 /* AnswersTracker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnswersTracker.swift; sourceTree = ""; }; 16D67C4C1F33AE370065E838 /* ObjectExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObjectExtensions.swift; sourceTree = ""; }; @@ -245,6 +247,7 @@ 1686FBFF1F009EC00088A6C1 /* SEDaily-IOS */ = { isa = PBXGroup; children = ( + 169806A41F8EF08F0075D8AD /* Constants */, 1610E2C21F227BE0006C8E83 /* Managers */, 1686FC0C1F009EC00088A6C1 /* Info.plist */, 164FE9E41F02EE83009419CA /* API.swift */, @@ -277,6 +280,14 @@ path = "SEDaily-IOSTests"; sourceTree = ""; }; + 169806A41F8EF08F0075D8AD /* Constants */ = { + isa = PBXGroup; + children = ( + 169806A51F8EF08F0075D8AD /* L10nEnum.swift */, + ); + path = Constants; + sourceTree = SOURCE_ROOT; + }; 4E74333675FE5899EC260076 /* Pods */ = { isa = PBXGroup; children = ( @@ -311,6 +322,7 @@ AE5F616C12D0339AD2CE40F0 /* [CP] Embed Pods Frameworks */, 4B6DBB81C87D23ABC98202EB /* [CP] Copy Pods Resources */, 16D67C4B1F33AD1D0065E838 /* ShellScript */, + 169806A21F8EED850075D8AD /* Swiftgen Localize Strings Script */, ); buildRules = ( ); @@ -432,6 +444,20 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 169806A21F8EED850075D8AD /* Swiftgen Localize Strings Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Swiftgen Localize Strings Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if which \"$PODS_ROOT\"/SwiftGen/bin/swiftgen >/dev/null; then\nset -e\n\"$PODS_ROOT\"/SwiftGen/bin/swiftgen strings -t structured-swift3 \"$PROJECT_DIR/SEDaily-IOS/Base.lproj/Localizable.strings\" --output \"$PROJECT_DIR/Constants/L10nEnum.swift\"\nelse\necho \"warning: SwiftGen not installed, download it from https://github.com/SwiftGen/SwiftGen\"\nfi"; + }; 16D67C4B1F33AD1D0065E838 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -604,6 +630,7 @@ 164FE9EB1F02F340009419CA /* Helpers.swift in Sources */, 166036211F266FF300A22B7B /* Notifications.swift in Sources */, 1672FAC41F06C141008445B1 /* NotificationCenterExtension.swift in Sources */, + 169806A61F8EF3970075D8AD /* L10nEnum.swift in Sources */, 01BB1D6D1F29999E004A912E /* PodcastPageViewController.swift in Sources */, 164FE9F11F030A2E009419CA /* PodcastModel.swift in Sources */, 164FE9ED1F02F7E2009419CA /* UIButtonExtension.swift in Sources */, diff --git a/SEDaily-IOS/Base.lproj/Localizable.strings b/SEDaily-IOS/Base.lproj/Localizable.strings index 16fd9f3..8855426 100644 --- a/SEDaily-IOS/Base.lproj/Localizable.strings +++ b/SEDaily-IOS/Base.lproj/Localizable.strings @@ -42,7 +42,6 @@ "AlertMessageLastNameNotLongEnough" = "Last Name must be longer than 1 characters"; "AlertMessagePleaseLogin" = "Please Login"; "AlertMessageIssueWithUserToken" = "Issue with User Token"; -"AlertMessageNoWebsite" = "No linked webste."; "AlertMessageYouMustLogin" = "You must login to use this feature."; "AlertMessageLogoutSuccess" = "Successfully Logged Out"; "GenericSuccess" = "Success"; diff --git a/SEDaily-IOS/CustomTabViewController.swift b/SEDaily-IOS/CustomTabViewController.swift index 460e399..70dc833 100644 --- a/SEDaily-IOS/CustomTabViewController.swift +++ b/SEDaily-IOS/CustomTabViewController.swift @@ -49,10 +49,10 @@ class CustomTabViewController: UITabBarController, UITabBarControllerDelegate { switch User.getActiveUser().isLoggedIn() { case false: - let leftBarButton = UIBarButtonItem(title: NSLocalizedString("LoginTitle", comment: ""), style: .done, target: self, action: #selector(self.loginButtonPressed)) + let leftBarButton = UIBarButtonItem(title: L10n.loginTitle, style: .done, target: self, action: #selector(self.loginButtonPressed)) self.navigationItem.leftBarButtonItem = leftBarButton case true: - let leftBarButton = UIBarButtonItem(title: NSLocalizedString("LogoutTitle", comment: ""), style: .done, target: self, action: #selector(self.logoutButtonPressed)) + let leftBarButton = UIBarButtonItem(title: L10n.logoutTitle, style: .done, target: self, action: #selector(self.logoutButtonPressed)) self.navigationItem.leftBarButtonItem = leftBarButton } } @@ -97,8 +97,8 @@ class CustomTabViewController: UITabBarController, UITabBarControllerDelegate { // let vc2 = GeneralCollectionViewController(collectionViewLayout: layout, type: API.Types.recommended) // let vc3 = GeneralCollectionViewController(collectionViewLayout: layout, type: API.Types.top) - let icon1 = UITabBarItem(title: NSLocalizedString("TabBarTitleLatest", comment: ""), image: #imageLiteral(resourceName: "mic_stand"), selectedImage: #imageLiteral(resourceName: "mic_stand_selected")) - let icon2 = UITabBarItem(title: NSLocalizedString("TabBarJustForYou", comment: ""), image: #imageLiteral(resourceName: "activity_feed"), selectedImage: #imageLiteral(resourceName: "activity_feed_selected")) + let icon1 = UITabBarItem(title: L10n.tabBarTitleLatest, image: #imageLiteral(resourceName: "mic_stand"), selectedImage: #imageLiteral(resourceName: "mic_stand_selected")) + let icon2 = UITabBarItem(title: L10n.tabBarJustForYou, image: #imageLiteral(resourceName: "activity_feed"), selectedImage: #imageLiteral(resourceName: "activity_feed_selected")) let icon3 = UITabBarItem(tabBarSystemItem: .mostViewed, tag: 0) vc1.tabBarItem = icon1 diff --git a/SEDaily-IOS/Helpers.swift b/SEDaily-IOS/Helpers.swift index 4b2b956..609338f 100644 --- a/SEDaily-IOS/Helpers.swift +++ b/SEDaily-IOS/Helpers.swift @@ -15,26 +15,25 @@ extension Helpers { static var alert: UIAlertController! enum Alerts { - static let error = NSLocalizedString("GenericError", comment: "") - static let success = NSLocalizedString("GenericSuccess", comment: "") + static let error = L10n.genericError + static let success = L10n.genericSuccess } enum Messages { - static let emailEmpty = NSLocalizedString("AlertMessageEmailEmpty", comment: "") - static let passwordEmpty = NSLocalizedString("AlertMessagePasswordEmpty", comment: "") - static let passwordConfirmEmpty = NSLocalizedString("AlertMessagePasswordConfirmEmpty", comment: "") - static let emailWrongFormat = NSLocalizedString("AlertMessageEmailWrongFormat", comment: "") - static let passwordNotLongEnough = NSLocalizedString("AlertMessagePasswordNotLongEnough", comment: "") - static let passwordsDonotMatch = NSLocalizedString("AlertMessagePasswordsDonotMatch", comment: "") - static let firstNameEmpty = NSLocalizedString("AlertMessageFirstNameEmpty", comment: "") - static let firstNameNotLongEnough = NSLocalizedString("AlertMessageFirstNameNotLongEnough", comment: "") - static let lastNameEmpty = NSLocalizedString("AlertMessageLastNameEmpty", comment: "") - static let lastNameNotLongEnough = NSLocalizedString("AlertMessageLastNameNotLongEnough", comment: "") - static let pleaseLogin = NSLocalizedString("AlertMessagePleaseLogin", comment: "") - static let issueWithUserToken = NSLocalizedString("AlertMessageIssueWithUserToken", comment: "") - static let noWebsite = NSLocalizedString("AlertMessageNoWebsite", comment: "") - static let youMustLogin = NSLocalizedString("AlertMessageYouMustLogin", comment: "") - static let logoutSuccess = NSLocalizedString("AlertMessageLogoutSuccess", comment: "") + static let emailEmpty = L10n.alertMessageEmailEmpty + static let passwordEmpty = L10n.alertMessagePasswordEmpty + static let passwordConfirmEmpty = L10n.alertMessagePasswordConfirmEmpty + static let emailWrongFormat = L10n.alertMessageEmailWrongFormat + static let passwordNotLongEnough = L10n.alertMessagePasswordNotLongEnough + static let passwordsDonotMatch = L10n.alertMessagePasswordsDonotMatch + static let firstNameEmpty = L10n.alertMessageFirstNameEmpty + static let firstNameNotLongEnough = L10n.alertMessageFirstNameNotLongEnough + static let lastNameEmpty = L10n.alertMessageLastNameEmpty + static let lastNameNotLongEnough = L10n.alertMessageLastNameNotLongEnough + static let pleaseLogin = L10n.alertMessagePleaseLogin + static let issueWithUserToken = L10n.alertMessageIssueWithUserToken + static let youMustLogin = L10n.alertMessageYouMustLogin + static let logoutSuccess = L10n.alertMessageLogoutSuccess } } @@ -53,7 +52,7 @@ class Helpers { } alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("GenericOkay", comment: ""), style: UIAlertActionStyle.default, handler: nil)) + alert.addAction(UIAlertAction(title: L10n.genericOkay, style: UIAlertActionStyle.default, handler: nil)) topController.present(alert, animated: true, completion: nil) completionHandler?() } diff --git a/SEDaily-IOS/LoginViewController.swift b/SEDaily-IOS/LoginViewController.swift index 464c25e..0d8bbee 100644 --- a/SEDaily-IOS/LoginViewController.swift +++ b/SEDaily-IOS/LoginViewController.swift @@ -186,13 +186,13 @@ class LoginViewController: UIViewController { addBottomBorderToView(view: firstNameTextField, height: 36.calculateHeight(), width: 316.calculateWidth()) addBottomBorderToView(view: lastNameTextField, height: 36.calculateHeight(), width: 316.calculateWidth()) - emailTextField.placeholder = NSLocalizedString("EmailAddressPlaceholder", comment: "") + emailTextField.placeholder = L10n.emailAddressPlaceholder emailTextField.setPlaceHolderTextColor(Stylesheet.Colors.secondaryColor) emailTextField.textColor = Stylesheet.Colors.white emailTextField.autocorrectionType = .no emailTextField.autocapitalizationType = .none - passwordTextField.placeholder = NSLocalizedString("PasswordPlaceholder", comment: "") + passwordTextField.placeholder = L10n.passwordPlaceholder passwordTextField.setPlaceHolderTextColor(Stylesheet.Colors.secondaryColor) passwordTextField.textColor = Stylesheet.Colors.white passwordTextField.autocorrectionType = .no @@ -200,20 +200,20 @@ class LoginViewController: UIViewController { passwordTextField.isSecureTextEntry = true passwordConfirmTextField.isHidden = true - passwordConfirmTextField.placeholder = NSLocalizedString("ConfirmPasswordPlaceholder", comment: "") + passwordConfirmTextField.placeholder = L10n.confirmPasswordPlaceholder passwordConfirmTextField.textColor = Stylesheet.Colors.white passwordConfirmTextField.autocorrectionType = .no passwordConfirmTextField.autocapitalizationType = .none passwordConfirmTextField.isSecureTextEntry = true firstNameTextField.isHidden = true - firstNameTextField.placeholder = NSLocalizedString("FirstNamePlaceholder", comment: "") + firstNameTextField.placeholder = L10n.firstNamePlaceholder firstNameTextField.textColor = Stylesheet.Colors.white firstNameTextField.autocorrectionType = .no firstNameTextField.autocapitalizationType = .none lastNameTextField.isHidden = true - lastNameTextField.placeholder = NSLocalizedString("LastNamePlaceholder", comment: "") + lastNameTextField.placeholder = L10n.lastNamePlaceholder lastNameTextField.textColor = Stylesheet.Colors.white lastNameTextField.autocorrectionType = .no lastNameTextField.autocapitalizationType = .none @@ -235,20 +235,20 @@ class LoginViewController: UIViewController { make.height.equalTo(42.calculateHeight()) } - loginButton.setTitle(NSLocalizedString("LoginButtonTitle", comment: ""), for: .normal) + loginButton.setTitle(L10n.loginButtonTitle, for: .normal) loginButton.setTitleColor(Stylesheet.Colors.white, for: .normal) loginButton.setBackgroundColor(color: Stylesheet.Colors.secondaryColor, forState: .normal) loginButton.addTarget(self, action: #selector(self.loginButtonPressed), for: .touchUpInside) loginButton.cornerRadius = 4.calculateWidth() - cancelButton.setTitle(NSLocalizedString("CancelButtonTitle", comment: ""), for: .normal) + cancelButton.setTitle(L10n.cancelButtonTitle, for: .normal) cancelButton.setTitleColor(Stylesheet.Colors.white, for: .normal) cancelButton.setBackgroundColor(color: Stylesheet.Colors.secondaryColor, forState: .normal) cancelButton.addTarget(self, action: #selector(self.cancelButtonPressed), for: .touchUpInside) cancelButton.cornerRadius = 4.calculateWidth() cancelButton.isHidden = true - signUpButton.setTitle(NSLocalizedString("SignUpButtonTitle", comment: ""), for: .normal) + signUpButton.setTitle(L10n.signUpButtonTitle, for: .normal) signUpButton.setTitleColor(Stylesheet.Colors.white, for: .normal) signUpButton.setBackgroundColor(color: Stylesheet.Colors.secondaryColor, forState: .normal) signUpButton.addTarget(self, action: #selector(self.signUpButtonPressed), for: .touchUpInside) diff --git a/SEDaily-IOS/PodcastPageViewController.swift b/SEDaily-IOS/PodcastPageViewController.swift index 14491c1..d877a8e 100644 --- a/SEDaily-IOS/PodcastPageViewController.swift +++ b/SEDaily-IOS/PodcastPageViewController.swift @@ -47,47 +47,47 @@ class PodcastPageViewController: TabmanViewController, PageboyViewControllerData let layout = UICollectionViewLayout() let child_1 = GeneralCollectionViewController(collectionViewLayout: layout, type: API.Types.new) - child_1.tabTitle = NSLocalizedString("TabTitleAll", comment: "") + child_1.tabTitle = L10n.tabTitleAll viewControllers.append(child_1) let child_2 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1068, type: API.Types.new) - child_2.tabTitle = NSLocalizedString("TabTitleBusinessAndPhilosophy", comment: "") + child_2.tabTitle = L10n.tabTitleBusinessAndPhilosophy viewControllers.append(child_2) let child_3 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1082, type: API.Types.new) - child_3.tabTitle = NSLocalizedString("TabTitleBlockchain", comment: "") + child_3.tabTitle = L10n.tabTitleBlockchain viewControllers.append(child_3) let child_4 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1079, type: API.Types.new) - child_4.tabTitle = NSLocalizedString("TabTitleCloudEngineering", comment: "") + child_4.tabTitle = L10n.tabTitleCloudEngineering viewControllers.append(child_4) let child_5 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1081, type: API.Types.new) - child_5.tabTitle = NSLocalizedString("TabTitleData", comment: "") + child_5.tabTitle = L10n.tabTitleData viewControllers.append(child_5) let child_6 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1084, type: API.Types.new) - child_6.tabTitle = NSLocalizedString("TabTitleJavaScript", comment: "") + child_6.tabTitle = L10n.tabTitleJavaScript viewControllers.append(child_6) let child_7 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1080, type: API.Types.new) - child_7.tabTitle = NSLocalizedString("TabTitleMachineLearning", comment: "") + child_7.tabTitle = L10n.tabTitleMachineLearning viewControllers.append(child_7) let child_8 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1078, type: API.Types.new) - child_8.tabTitle = NSLocalizedString("TabTitleOpenSource", comment: "") + child_8.tabTitle = L10n.tabTitleOpenSource viewControllers.append(child_8) let child_9 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1083, type: API.Types.new) - child_9.tabTitle = NSLocalizedString("TabTitleSecurity", comment: "") + child_9.tabTitle = L10n.tabTitleSecurity viewControllers.append(child_9) let child_10 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1085, type: API.Types.new) - child_10.tabTitle = NSLocalizedString("TabTitleHackers", comment: "") + child_10.tabTitle = L10n.tabTitleHackers viewControllers.append(child_10) let child_11 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1069, type: API.Types.new) - child_11.tabTitle = NSLocalizedString("TabTitleGreatestHits", comment: "") + child_11.tabTitle = L10n.tabTitleGreatestHits viewControllers.append(child_11) viewControllers.forEach { (controller) in diff --git a/SEDaily-IOS/fr.lproj/Localizable.strings b/SEDaily-IOS/fr.lproj/Localizable.strings index 69341da..fdf47f5 100644 --- a/SEDaily-IOS/fr.lproj/Localizable.strings +++ b/SEDaily-IOS/fr.lproj/Localizable.strings @@ -42,7 +42,6 @@ "AlertMessageLastNameNotLongEnough" = "Last Name must be longer than 1 characters*"; "AlertMessagePleaseLogin" = "Please Login*"; "AlertMessageIssueWithUserToken" = "Issue with User Token*"; -"AlertMessageNoWebsite" = "No linked webste.*"; "AlertMessageYouMustLogin" = "You must login to use this feature.*"; "AlertMessageLogoutSuccess" = "Successfully Logged Out*"; "GenericSuccess" = "Success*";