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 51e0b8a..9da14b7 100644 --- a/Podfile +++ b/Podfile @@ -27,6 +27,7 @@ target 'SEDaily-IOS' do pod 'KTResponsiveUI' pod 'KoalaTeaPlayer' pod 'Tabman' + pod 'SwiftGen' pod 'Skeleton' target 'SEDaily-IOSTests' do diff --git a/Podfile.lock b/Podfile.lock index b7624de..2a32c9e 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -66,6 +66,7 @@ DEPENDENCIES: - Skeleton - SnapKit - SwifterSwift + - SwiftGen - SwiftIcons (from `https://github.com/themisterholliday/SwiftIcons.git`, branch `swift-4`) - SwiftyBeaver - SwiftyJSON @@ -107,6 +108,7 @@ SPEC CHECKSUMS: SideMenu: 1bf32e90afaa2dc0e0ab68e938a0ff85014c4217 Skeleton: b76249b7d6a73a9913e164c8030647a3e005c700 SnapKit: a42d492c16e80209130a3379f73596c3454b7694 + SwiftGen: dd2892e7fb008151f30e6ce0cf465b8b8d89e80e SwifterSwift: 5f406a5f831343312d6d5b34282b57ef3f52c40b SwiftIcons: b20641adce6b71fcb2e72389b4b5f2e87252df99 SwiftyBeaver: 91057725648ee4980308f1650af077d04b3654a0 diff --git a/SEDaily-IOS.xcodeproj/project.pbxproj b/SEDaily-IOS.xcodeproj/project.pbxproj index 0d837b0..47badfe 100644 --- a/SEDaily-IOS.xcodeproj/project.pbxproj +++ b/SEDaily-IOS.xcodeproj/project.pbxproj @@ -38,10 +38,12 @@ 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 */; }; 16D766BA1F06B4850066C143 /* AudioView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D766B91F06B4850066C143 /* AudioView.swift */; }; + 1E44AF031F87B08D00221B22 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E44AF051F87B08D00221B22 /* Localizable.strings */; }; 16FA84031F8D323700A45D9B /* SkeletonCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16FA84021F8D323700A45D9B /* SkeletonCollectionView.swift */; }; 238E99F4E37C7365658113B8 /* Pods_SEDaily_IOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DF0C9F051C6C2F8638D2ABF8 /* Pods_SEDaily_IOSTests.framework */; }; 24412438C753126FDDD37CBF /* Pods_SEDaily_IOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A3651E5B02B83E392546E167 /* Pods_SEDaily_IOS.framework */; }; @@ -93,10 +95,15 @@ 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 = ""; }; 16D766B91F06B4850066C143 /* AudioView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioView.swift; sourceTree = ""; }; + 1E44AEFF1F87ACF500221B22 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/LaunchScreen.strings; sourceTree = ""; }; + 1E44AF001F87ACF500221B22 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Main.strings; sourceTree = ""; }; + 1E44AF061F87B09100221B22 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; + 1E44AF081F87B0A700221B22 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; 16FA84021F8D323700A45D9B /* SkeletonCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkeletonCollectionView.swift; sourceTree = ""; }; 675FBEB71FD81FBA8767227A /* Pods-SEDaily-IOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SEDaily-IOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-SEDaily-IOS/Pods-SEDaily-IOS.release.xcconfig"; sourceTree = ""; }; 995F64385352A79BA0DF7DEB /* Pods-SEDaily-IOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SEDaily-IOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SEDaily-IOSTests/Pods-SEDaily-IOSTests.debug.xcconfig"; sourceTree = ""; }; @@ -231,11 +238,13 @@ 1686FBFF1F009EC00088A6C1 /* SEDaily-IOS */ = { isa = PBXGroup; children = ( + 169806A41F8EF08F0075D8AD /* Constants */, 1610E2C21F227BE0006C8E83 /* Managers */, 1686FC0C1F009EC00088A6C1 /* Info.plist */, 164FE9E41F02EE83009419CA /* API.swift */, 1686FC001F009EC00088A6C1 /* AppDelegate.swift */, 164C71041F021AC8003803BC /* CustomTabViewController.swift */, + 1E44AF051F87B08D00221B22 /* Localizable.strings */, 1686FC071F009EC00088A6C1 /* Assets.xcassets */, 164FE9DD1F02DAB8009419CA /* CollectionViewCells */, 164FE9DA1F02DAA5009419CA /* CollectionViews */, @@ -262,6 +271,14 @@ path = "SEDaily-IOSTests"; sourceTree = ""; }; + 169806A41F8EF08F0075D8AD /* Constants */ = { + isa = PBXGroup; + children = ( + 169806A51F8EF08F0075D8AD /* L10nEnum.swift */, + ); + path = Constants; + sourceTree = SOURCE_ROOT; + }; 4E74333675FE5899EC260076 /* Pods */ = { isa = PBXGroup; children = ( @@ -296,6 +313,7 @@ AE5F616C12D0339AD2CE40F0 /* [CP] Embed Pods Frameworks */, 4B6DBB81C87D23ABC98202EB /* [CP] Copy Pods Resources */, 16D67C4B1F33AD1D0065E838 /* ShellScript */, + 169806A21F8EED850075D8AD /* Swiftgen Localize Strings Script */, ); buildRules = ( ); @@ -364,6 +382,7 @@ knownRegions = ( en, Base, + fr, ); mainGroup = 1686FBF41F009EC00088A6C1; productRefGroup = 1686FBFE1F009EC00088A6C1 /* Products */; @@ -382,6 +401,7 @@ buildActionMask = 2147483647; files = ( 1686FC0B1F009EC00088A6C1 /* LaunchScreen.storyboard in Resources */, + 1E44AF031F87B08D00221B22 /* Localizable.strings in Resources */, 1686FC081F009EC00088A6C1 /* Assets.xcassets in Resources */, 1686FC061F009EC00088A6C1 /* Main.storyboard in Resources */, ); @@ -415,6 +435,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; @@ -586,6 +620,7 @@ 16FA84031F8D323700A45D9B /* SkeletonCollectionView.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 */, @@ -618,6 +653,7 @@ isa = PBXVariantGroup; children = ( 1686FC051F009EC00088A6C1 /* Base */, + 1E44AF001F87ACF500221B22 /* fr */, ); name = Main.storyboard; sourceTree = ""; @@ -626,10 +662,20 @@ isa = PBXVariantGroup; children = ( 1686FC0A1F009EC00088A6C1 /* Base */, + 1E44AEFF1F87ACF500221B22 /* fr */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; + 1E44AF051F87B08D00221B22 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 1E44AF061F87B09100221B22 /* Base */, + 1E44AF081F87B0A700221B22 /* fr */, + ); + name = Localizable.strings; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -637,6 +683,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -696,6 +743,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; diff --git a/SEDaily-IOS/Base.lproj/Localizable.strings b/SEDaily-IOS/Base.lproj/Localizable.strings new file mode 100644 index 0000000..8855426 --- /dev/null +++ b/SEDaily-IOS/Base.lproj/Localizable.strings @@ -0,0 +1,50 @@ +/* + Localizable.strings + SEDaily-IOS + + Created by Justin Lam on 10/6/17. + Copyright © 2017 Koala Tea. All rights reserved. +*/ + +/* */ +"TabBarTitleLatest" = "Latest"; +"TabBarJustForYou" = "Just For You"; +"TabTitleAll" = "All"; +"TabTitleBusinessAndPhilosophy" = "Business and Philosophy"; +"TabTitleBlockchain" = "Blockchain"; +"TabTitleCloudEngineering" = "Cloud Engineering"; +"TabTitleData" = "Data"; +"TabTitleJavaScript" = "JavaScript"; +"TabTitleMachineLearning" = "Machine Learning"; +"TabTitleOpenSource" = "Open Source"; +"TabTitleSecurity" = "Security"; +"TabTitleHackers" = "Hackers"; +"TabTitleGreatestHits" = "Greatest Hits"; +"LoginTitle" = "Login"; +"LogoutTitle" = "Logout"; +"EmailAddressPlaceholder" = "Email"; +"PasswordPlaceholder" = "Password"; +"ConfirmPasswordPlaceholder" = "Confirm Password"; +"FirstNamePlaceholder" = "First Name"; +"LastNamePlaceholder" = "Last Name"; +"LoginButtonTitle" = "Login"; +"CancelButtonTitle" = "Cancel"; +"SignUpButtonTitle" = "Sign Up"; +"AlertMessageEmailEmpty" = "Email Field Empty"; +"AlertMessagePasswordEmpty" = "Password Field Empty"; +"AlertMessagePasswordConfirmEmpty" = "Confirm Password Field Empty"; +"AlertMessageEmailWrongFormat" = "Invalid Email Format"; +"AlertMessagePasswordNotLongEnough" = "Password must be longer than 6 characters"; +"AlertMessagePasswordsDonotMatch" = "Password do not match"; +"AlertMessageFirstNameEmpty" = "First Name Field Empty"; +"AlertMessageFirstNameNotLongEnough" = "First Name must be longer than 1 characters"; +"AlertMessageLastNameEmpty" = "Last Name Field Empty"; +"AlertMessageLastNameNotLongEnough" = "Last Name must be longer than 1 characters"; +"AlertMessagePleaseLogin" = "Please Login"; +"AlertMessageIssueWithUserToken" = "Issue with User Token"; +"AlertMessageYouMustLogin" = "You must login to use this feature."; +"AlertMessageLogoutSuccess" = "Successfully Logged Out"; +"GenericSuccess" = "Success"; +"GenericError" = "Error"; +"GenericOkay" = "Okay"; +"GenericOK" = "OK"; diff --git a/SEDaily-IOS/CustomTabViewController.swift b/SEDaily-IOS/CustomTabViewController.swift index a441d5c..1a11adc 100644 --- a/SEDaily-IOS/CustomTabViewController.swift +++ b/SEDaily-IOS/CustomTabViewController.swift @@ -49,13 +49,11 @@ class CustomTabViewController: UITabBarController, UITabBarControllerDelegate { switch User.getActiveUser().isLoggedIn() { case false: - let leftBarButton = UIBarButtonItem(title: "Login", 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 - break case true: - let leftBarButton = UIBarButtonItem(title: "Logout", 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 - break } } @@ -99,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: "Latest", image: #imageLiteral(resourceName: "mic_stand"), selectedImage: #imageLiteral(resourceName: "mic_stand_selected")) - let icon2 = UITabBarItem(title: "Just For You", 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 df8f4c9..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 = "Error" - static let success = "Success" + static let error = L10n.genericError + static let success = L10n.genericSuccess } enum Messages { - static let emailEmpty = "Email Field Empty" - static let passwordEmpty = "Password Field Empty" - static let passwordConfirmEmpty = "Confirm Password Field Empty" - static let emailWrongFormat = "Invalid Email Format" - static let passwordNotLongEnough = "Password must be longer than 6 characters" - static let passwordsDonotMatch = "Password do not match" - static let firstNameEmpty = "First Name Field Empty" - static let firstNameNotLongEnough = "First Name must be longer than 1 characters" - static let lastNameEmpty = "Last Name Field Empty" - static let lastNameNotLongEnough = "Last Name must be longer than 1 characters" - static let pleaseLogin = "Please Login" - static let issueWithUserToken = "Issue with User Token" - static let noWebsite = "No linked webste." - static let youMustLogin = "You must login to use this feature." - static let logoutSuccess = "Successfully Logged Out" + 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: "Okay", 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 417c193..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 = "Email" + emailTextField.placeholder = L10n.emailAddressPlaceholder emailTextField.setPlaceHolderTextColor(Stylesheet.Colors.secondaryColor) emailTextField.textColor = Stylesheet.Colors.white emailTextField.autocorrectionType = .no emailTextField.autocapitalizationType = .none - passwordTextField.placeholder = "Password" + 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 = "Confirm Password" + passwordConfirmTextField.placeholder = L10n.confirmPasswordPlaceholder passwordConfirmTextField.textColor = Stylesheet.Colors.white passwordConfirmTextField.autocorrectionType = .no passwordConfirmTextField.autocapitalizationType = .none passwordConfirmTextField.isSecureTextEntry = true firstNameTextField.isHidden = true - firstNameTextField.placeholder = "First Name" + firstNameTextField.placeholder = L10n.firstNamePlaceholder firstNameTextField.textColor = Stylesheet.Colors.white firstNameTextField.autocorrectionType = .no firstNameTextField.autocapitalizationType = .none lastNameTextField.isHidden = true - lastNameTextField.placeholder = "Last Name" + 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("Login", 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("Cancel", 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("Sign Up", 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 90c8e12..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 = "All" + child_1.tabTitle = L10n.tabTitleAll viewControllers.append(child_1) let child_2 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1068, type: API.Types.new) - child_2.tabTitle = "Business and Philosophy" + child_2.tabTitle = L10n.tabTitleBusinessAndPhilosophy viewControllers.append(child_2) let child_3 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1082, type: API.Types.new) - child_3.tabTitle = "Blockchain" + child_3.tabTitle = L10n.tabTitleBlockchain viewControllers.append(child_3) let child_4 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1079, type: API.Types.new) - child_4.tabTitle = "Cloud Engineering" + child_4.tabTitle = L10n.tabTitleCloudEngineering viewControllers.append(child_4) let child_5 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1081, type: API.Types.new) - child_5.tabTitle = "Data" + child_5.tabTitle = L10n.tabTitleData viewControllers.append(child_5) let child_6 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1084, type: API.Types.new) - child_6.tabTitle = "JavaScript" + child_6.tabTitle = L10n.tabTitleJavaScript viewControllers.append(child_6) let child_7 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1080, type: API.Types.new) - child_7.tabTitle = "Machine Learning" + child_7.tabTitle = L10n.tabTitleMachineLearning viewControllers.append(child_7) let child_8 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1078, type: API.Types.new) - child_8.tabTitle = "Open Source" + child_8.tabTitle = L10n.tabTitleOpenSource viewControllers.append(child_8) let child_9 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1083, type: API.Types.new) - child_9.tabTitle = "Security" + child_9.tabTitle = L10n.tabTitleSecurity viewControllers.append(child_9) let child_10 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1085, type: API.Types.new) - child_10.tabTitle = "Hackers" + child_10.tabTitle = L10n.tabTitleHackers viewControllers.append(child_10) let child_11 = GeneralCollectionViewController(collectionViewLayout: layout, tagId: 1069, type: API.Types.new) - child_11.tabTitle = "Greatest Hits" + child_11.tabTitle = L10n.tabTitleGreatestHits viewControllers.append(child_11) viewControllers.forEach { (controller) in diff --git a/SEDaily-IOS/en.lproj/Localizable.strings b/SEDaily-IOS/en.lproj/Localizable.strings new file mode 100644 index 0000000..422c6e5 --- /dev/null +++ b/SEDaily-IOS/en.lproj/Localizable.strings @@ -0,0 +1,7 @@ +/* + Localizable.strings + SEDaily-IOS + + Created by Justin Lam on 10/6/17. + Copyright © 2017 Koala Tea. All rights reserved. +*/ diff --git a/SEDaily-IOS/fr.lproj/LaunchScreen.strings b/SEDaily-IOS/fr.lproj/LaunchScreen.strings new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/SEDaily-IOS/fr.lproj/LaunchScreen.strings @@ -0,0 +1 @@ + diff --git a/SEDaily-IOS/fr.lproj/Localizable.strings b/SEDaily-IOS/fr.lproj/Localizable.strings new file mode 100644 index 0000000..fdf47f5 --- /dev/null +++ b/SEDaily-IOS/fr.lproj/Localizable.strings @@ -0,0 +1,51 @@ +/* + Localizable.strings + SEDaily-IOS + + Created by Justin Lam on 10/6/17. + Copyright © 2017 Koala Tea. All rights reserved. +*/ + +/* */ +"TabBarTitleLatest" = "Latest*"; +"TabBarJustForYou" = "Just For You*"; +"TabTitleAll" = "All*"; +"TabTitleBusinessAndPhilosophy" = "Business and Philosophy*"; +"TabTitleBlockchain" = "Blockchain*"; +"TabTitleCloudEngineering" = "Cloud Engineering*"; +"TabTitleData" = "Data*"; +"TabTitleJavaScript" = "JavaScript*"; +"TabTitleMachineLearning" = "Machine Learning*"; +"TabTitleOpenSource" = "Open Source*"; +"TabTitleSecurity" = "Security*"; +"TabTitleHackers" = "Hackers*"; +"TabTitleGreatestHits" = "Greatest Hits*"; +"LoginTitle" = "Login*"; +"LogoutTitle" = "Logout*"; +"EmailAddressPlaceholder" = "Email*"; +"PasswordPlaceholder" = "Password*"; +"ConfirmPasswordPlaceholder" = "Confirm Password*"; +"FirstNamePlaceholder" = "First Name*"; +"LastNamePlaceholder" = "Last Name*"; +"LoginButtonTitle" = "Login*"; +"CancelButtonTitle" = "Cancel*"; +"SignUpButtonTitle" = "Sign Up*"; +"AlertMessageEmailEmpty" = "Email Field Empty*"; +"AlertMessagePasswordEmpty" = "Password Field Empty*"; +"AlertMessagePasswordConfirmEmpty" = "Confirm Password Field Empty*"; +"AlertMessageEmailWrongFormat" = "Invalid Email Format*"; +"AlertMessagePasswordNotLongEnough" = "Password must be longer than 6 characters*"; +"AlertMessagePasswordsDonotMatch" = "Password do not match*"; +"AlertMessageFirstNameEmpty" = "First Name Field Empty*"; +"AlertMessageFirstNameNotLongEnough" = "First Name must be longer than 1 characters*"; +"AlertMessageLastNameEmpty" = "Last Name Field Empty*"; +"AlertMessageLastNameNotLongEnough" = "Last Name must be longer than 1 characters*"; +"AlertMessagePleaseLogin" = "Please Login*"; +"AlertMessageIssueWithUserToken" = "Issue with User Token*"; +"AlertMessageYouMustLogin" = "You must login to use this feature.*"; +"AlertMessageLogoutSuccess" = "Successfully Logged Out*"; +"GenericSuccess" = "Success*"; +"GenericError" = "Error*"; +"GenericOkay" = "Okay*"; +"GenericOK" = "OK*"; + diff --git a/SEDaily-IOS/fr.lproj/Main.strings b/SEDaily-IOS/fr.lproj/Main.strings new file mode 100644 index 0000000..071102c --- /dev/null +++ b/SEDaily-IOS/fr.lproj/Main.strings @@ -0,0 +1,6 @@ + +/* Class = "UITabBarItem"; title = "Item 1"; ObjectID = "1oc-bk-EZe"; */ +"1oc-bk-EZe.title" = "Item 1"; + +/* Class = "UITabBarItem"; title = "Item 2"; ObjectID = "teR-pK-dgQ"; */ +"teR-pK-dgQ.title" = "Item 2";