From d99c551e66b514d025f817920c43628ae1135412 Mon Sep 17 00:00:00 2001 From: Suraj1999 Date: Sun, 7 Jan 2024 16:53:38 +0530 Subject: [PATCH 1/2] Fix bug where timer is not in georgian language while app prefered language is georgian. --- .../Views/FeedingControlView/FeedingControlView.swift | 9 ++++++--- animeal/res/en.lproj/Localizable.strings | 1 + animeal/res/ka.lproj/Localizable.strings | 1 + animeal/res/sheet.csv | 1 + animeal/src/Common/Strings.swift | 2 ++ .../VerificationAfterChangingUserAttributeWorker.swift | 1 + .../Workers/VerificationAfterCustomAuthWorker.swift | 3 ++- .../Main/Modules/Home/Main/View/HomeViewController.swift | 2 +- animealUI/ComponentsTableViewController.swift | 2 +- 9 files changed, 16 insertions(+), 6 deletions(-) diff --git a/UIComponents/Sources/UIComponents/Components/Views/FeedingControlView/FeedingControlView.swift b/UIComponents/Sources/UIComponents/Components/Views/FeedingControlView/FeedingControlView.swift index 08a43db7..26f4bb3b 100644 --- a/UIComponents/Sources/UIComponents/Components/Views/FeedingControlView/FeedingControlView.swift +++ b/UIComponents/Sources/UIComponents/Components/Views/FeedingControlView/FeedingControlView.swift @@ -8,6 +8,7 @@ public final class FeedingControlView: UIView { private let timeLeftLabel = UILabel() private let distanceLabel = UILabel() private var cancelButton: UIButton? + private let minuteText: String private let timeIntervalFormatter: DateComponentsFormatter = { let formatter = DateComponentsFormatter() formatter.allowedUnits = [.hour, .minute] @@ -26,9 +27,10 @@ public final class FeedingControlView: UIView { // MARK: - Initialization public init( - timerProvider: FeedingTimerProviderProtocol = FeedingTimerProvider(configuration: .default) + timerProvider: FeedingTimerProviderProtocol = FeedingTimerProvider(configuration: .default), minuteText : String ) { self.timerProvider = timerProvider + self.minuteText = minuteText super.init(frame: .zero) setupTimerProvider() setupViews() @@ -112,8 +114,9 @@ private extension FeedingControlView { func setupTimerProvider() { timerProvider.onCountdownTimerChanged = { [weak self] timeInterval in - let timeLeft = self?.timeIntervalFormatter.string(from: timeInterval) ?? "0" - self?.timeLeftLabel.text = "\(timeLeft) min" + guard let self = self else { return } + let timeLeft = self.timeIntervalFormatter.string(from: timeInterval) ?? "0" + self.timeLeftLabel.text = "\(timeLeft) \(self.minuteText)" } timerProvider.onTimerFinished = { [weak self] in self?.onTimerFinishHandler?() diff --git a/animeal/res/en.lproj/Localizable.strings b/animeal/res/en.lproj/Localizable.strings index 4b2bded0..a98a6be4 100644 --- a/animeal/res/en.lproj/Localizable.strings +++ b/animeal/res/en.lproj/Localizable.strings @@ -53,6 +53,7 @@ "action.deleteAccount" = "Delete Account"; "action.iWillFeed" = "I will feed"; "action.yes" = "Yes"; +"action.min" = "min"; "action.finish" = "Finish"; "action.showOnMap" = "Show on map"; "action.backToHome" = "Back to home"; diff --git a/animeal/res/ka.lproj/Localizable.strings b/animeal/res/ka.lproj/Localizable.strings index c9b3c65c..f2617c36 100644 --- a/animeal/res/ka.lproj/Localizable.strings +++ b/animeal/res/ka.lproj/Localizable.strings @@ -53,6 +53,7 @@ "action.deleteAccount" = "Ანგარიშის წაშლა"; "action.iWillFeed" = "ვაჭმევ"; "action.yes" = "დიახ"; +"action.min" = "წუთი"; "action.finish" = "დასრულება"; "action.showOnMap" = "რუკაზე ჩვენება"; "action.backToHome" = "სახლში დაბრუნება"; diff --git a/animeal/res/sheet.csv b/animeal/res/sheet.csv index db25bb19..c6a23dfb 100644 --- a/animeal/res/sheet.csv +++ b/animeal/res/sheet.csv @@ -44,6 +44,7 @@ "more.aboutShort","","About","შესახებ","","","","","","","","","","","","","","","","","","","","","","","" "more.aboutContent","","Who are we?\nAnimal Project was founded in 2020 by animal lovers with different professions and experiences. For decades, our team members have been independently helping strays and raising awareness through personal channels.\n\nWhat is our goal?\nWe exist so that dogs and cats no longer have to live in the streets of Georgia. Our goal is to create a habitable, comfortable environment for companion animals and raise awareness within our communities.\n\nHow are we working on this goal?\nOur team heavily relies on international best practices and experience. Our areas of work include:\n· Raising social awareness;\n· Advocating with the government;\n· Charitable and humanitarian projects in collaboration with the private sector, donor organizations, and local communities;","Ვინ ვართ ჩვენ?\nAnimal Project დაარსდა 2020 წელს ცხოველთა მოყვარულთა მიერ სხვადასხვა პროფესიისა და გამოცდილების მქონე. ათწლეულების მანძილზე ჩვენი გუნდის წევრები დამოუკიდებლად ეხმარებოდნენ მაწანწალაებს და ამაღლებდნენ ცნობიერებას პირადი არხებით.\n\nრა არის ჩვენი მიზანი?\nჩვენ იმისთვის ვარსებობთ, რომ საქართველოს ქუჩებში ძაღლები და კატები აღარ იცხოვრონ. ჩვენი მიზანია შევქმნათ საცხოვრებელი, კომფორტული გარემო კომპანიონი ცხოველებისთვის და ცნობიერების ამაღლება ჩვენს თემებში.\n\nროგორ ვმუშაობთ ამ მიზანზე?\nჩვენი გუნდი დიდწილად ეყრდნობა საერთაშორისო საუკეთესო პრაქტიკას და გამოცდილებას. ჩვენი მუშაობის სფეროები მოიცავს:\n· სოციალური ცნობიერების ამაღლება;\n· მთავრობასთან ადვოკატირება;\n· საქველმოქმედო და ჰუმანიტარული პროექტები კერძო სექტორთან, დონორ ორგანიზაციებთან და ადგილობრივ თემებთან თანამშრომლობით;","","","","","","","","","","","","","","","","","","","","","","","" "action.logOut","","Log out","გასვლა","","","","","","","","","","","","","","","","","","","","","","","" +"action.min","","min","წუთი","","","","","","","","","","","","","","","","","","","","","","","" "action.cancel","","Cancel","გაუქმება","","","","","","","","","","","","","","","","","","","","","","","" "action.delete","","Delete","წაშლა","","","","","","","","","","","","","","","","","","","","","","","" "action.agree","","Agree","ვეთანხმები","","","","","","","","","","","","","","","","","","","","","","","" diff --git a/animeal/src/Common/Strings.swift b/animeal/src/Common/Strings.swift index 8d1e29fe..4474a4cb 100644 --- a/animeal/src/Common/Strings.swift +++ b/animeal/src/Common/Strings.swift @@ -35,6 +35,8 @@ internal enum L10n { internal static let iWillFeed = L10n.tr("Localizable", "action.iWillFeed", fallback: "I will feed") /// Log out internal static let logOut = L10n.tr("Localizable", "action.logOut", fallback: "Log out") + /// min + internal static let min = L10n.tr("Localizable", "action.min", fallback: "min") /// No internal static let no = L10n.tr("Localizable", "action.no", fallback: "No") /// No, thanks diff --git a/animeal/src/Flows/Auth/Modules/Verification/Model/Workers/VerificationAfterChangingUserAttributeWorker.swift b/animeal/src/Flows/Auth/Modules/Verification/Model/Workers/VerificationAfterChangingUserAttributeWorker.swift index b7bb39ec..83b82a84 100644 --- a/animeal/src/Flows/Auth/Modules/Verification/Model/Workers/VerificationAfterChangingUserAttributeWorker.swift +++ b/animeal/src/Flows/Auth/Modules/Verification/Model/Workers/VerificationAfterChangingUserAttributeWorker.swift @@ -24,6 +24,7 @@ final class VerificationAfterChangingUserAttributeWorker: VerificationModelWorke } @discardableResult + // need to check func resendCode( forAttribute attribute: VerificationModelAttribute ) async throws -> VerificationModelNextStep { diff --git a/animeal/src/Flows/Auth/Modules/Verification/Model/Workers/VerificationAfterCustomAuthWorker.swift b/animeal/src/Flows/Auth/Modules/Verification/Model/Workers/VerificationAfterCustomAuthWorker.swift index 7be7d8b0..b4d5a0a0 100644 --- a/animeal/src/Flows/Auth/Modules/Verification/Model/Workers/VerificationAfterCustomAuthWorker.swift +++ b/animeal/src/Flows/Auth/Modules/Verification/Model/Workers/VerificationAfterCustomAuthWorker.swift @@ -44,7 +44,8 @@ final class VerificationAfterCustomAuthWorker: VerificationModelWorker { func resendCode( forAttribute attribute: VerificationModelAttribute ) async throws -> VerificationModelNextStep { - try await authenticationService.signOut() + // need to check +// try await authenticationService.signOut() let result = try await authenticationService.signIn( username: AuthenticationInput { attribute.value } ) diff --git a/animeal/src/Flows/Main/Modules/Home/Main/View/HomeViewController.swift b/animeal/src/Flows/Main/Modules/Home/Main/View/HomeViewController.swift index 136f5939..00143b94 100644 --- a/animeal/src/Flows/Main/Modules/Home/Main/View/HomeViewController.swift +++ b/animeal/src/Flows/Main/Modules/Home/Main/View/HomeViewController.swift @@ -10,7 +10,7 @@ class HomeViewController: UIViewController { private var mapView: NavigationMapController! private let segmentedControl = FilledSegmentedControl() private lazy var feedControl: FeedingControlView = { - let feedControl = FeedingControlView() + let feedControl = FeedingControlView( minuteText: L10n.Action.min) feedControl.onCloseHandler = { [weak self] in self?.viewModel.handleActionEvent(.tapCancelFeeding) } diff --git a/animealUI/ComponentsTableViewController.swift b/animealUI/ComponentsTableViewController.swift index fd84d479..84545cb8 100644 --- a/animealUI/ComponentsTableViewController.swift +++ b/animealUI/ComponentsTableViewController.swift @@ -375,7 +375,7 @@ class ComponentsTableViewController: UIViewController, let feedingControllerView = FeedingControlView( timerProvider: FeedingTimerProvider( configuration: FeedingTimerProvider.Configuration(timerInterval: 1, countdownInterval: 239) - ) + ), minuteText: L10n.Action.min ) superView.addSubview(feedingControllerView.prepareForAutoLayout()) feedingControllerView.centerYAnchor ~= superView.centerYAnchor From d64b739deda02e10998f16bac9a88096269c7021 Mon Sep 17 00:00:00 2001 From: Suraj1999 Date: Tue, 9 Jan 2024 23:30:58 +0530 Subject: [PATCH 2/2] Swiftlint fix --- .../Views/FeedingControlView/FeedingControlView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UIComponents/Sources/UIComponents/Components/Views/FeedingControlView/FeedingControlView.swift b/UIComponents/Sources/UIComponents/Components/Views/FeedingControlView/FeedingControlView.swift index 26f4bb3b..106fae42 100644 --- a/UIComponents/Sources/UIComponents/Components/Views/FeedingControlView/FeedingControlView.swift +++ b/UIComponents/Sources/UIComponents/Components/Views/FeedingControlView/FeedingControlView.swift @@ -27,7 +27,7 @@ public final class FeedingControlView: UIView { // MARK: - Initialization public init( - timerProvider: FeedingTimerProviderProtocol = FeedingTimerProvider(configuration: .default), minuteText : String + timerProvider: FeedingTimerProviderProtocol = FeedingTimerProvider(configuration: .default), minuteText: String ) { self.timerProvider = timerProvider self.minuteText = minuteText