Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where timer is not in georgian language while app prefer language. #235

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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()
Expand Down Expand Up @@ -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?()
Expand Down
1 change: 1 addition & 0 deletions animeal/res/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions animeal/res/ka.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"action.deleteAccount" = "Ანგარიშის წაშლა";
"action.iWillFeed" = "ვაჭმევ";
"action.yes" = "დიახ";
"action.min" = "წუთი";
"action.finish" = "დასრულება";
"action.showOnMap" = "რუკაზე ჩვენება";
"action.backToHome" = "სახლში დაბრუნება";
Expand Down
3 changes: 2 additions & 1 deletion animeal/res/sheet.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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","ვეთანხმები","","","","","","","","","","","","","","","","","","","","","","",""
Expand Down Expand Up @@ -106,4 +107,4 @@ Please contact us at %@","ვერ იპოვეთ თქვენი შე
"about.appVersion","","App version","აპლიკაციის ვერსია","","","","","","","","","","","","","","","","","","","","","","",""
"leaderBoard.header","","Leaderboard","ლიდერბორდი","","","","","","","","","","","","","","","","","","","","","","",""
"leaderBoard.empty","","Leaderboard will show the rating of volunteers","ლიდერბორდი აჩვენებს მოხალისეთა რეიტინგს","","","","","","","","","","","","","","","","","","","","","","",""
"verification.resendCode.titleTime","","Resend code in","კოდის ხელახლა გაგზავნა","","","","","","","","","","","","","","","","","","","","","","",""
"verification.resendCode.titleTime","","Resend code in","კოდის ხელახლა გაგზავნა","","","","","","","","","","","","","","","","","","","","","","",""
2 changes: 2 additions & 0 deletions animeal/src/Common/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ final class VerificationAfterChangingUserAttributeWorker: VerificationModelWorke
}

@discardableResult
// need to check
func resendCode(
forAttribute attribute: VerificationModelAttribute
) async throws -> VerificationModelNextStep {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion animealUI/ComponentsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading