From 7374fb23fa69c74ab3513fc7dba2564703c60c58 Mon Sep 17 00:00:00 2001 From: Rawan Date: Thu, 16 May 2024 13:59:12 +0300 Subject: [PATCH] fix: rtl for "CompletionStatus" Enum in CourseDates --- Course/Course/Domain/Model/CourseDates.swift | 17 +++++++++++++++++ .../Presentation/Dates/CourseDatesView.swift | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Course/Course/Domain/Model/CourseDates.swift b/Course/Course/Domain/Model/CourseDates.swift index 966899cb9..da250c701 100644 --- a/Course/Course/Domain/Model/CourseDates.swift +++ b/Course/Course/Domain/Model/CourseDates.swift @@ -286,6 +286,23 @@ public enum CompletionStatus: String { case thisWeek = "This Week" case nextWeek = "Next Week" case upcoming = "Upcoming" + + var localized: String { + switch self { + case .completed: + return CourseLocalization.CourseDates.completed + case .pastDue: + return CourseLocalization.CourseDates.pastDue + case .today: + return CourseLocalization.CourseDates.today + case .thisWeek: + return CourseLocalization.CourseDates.today + case .nextWeek: + return CourseLocalization.CourseDates.today + case .upcoming: + return CourseLocalization.CourseDates.today + } + } } extension Array { diff --git a/Course/Course/Presentation/Dates/CourseDatesView.swift b/Course/Course/Presentation/Dates/CourseDatesView.swift index d63722f3f..5bac7ea56 100644 --- a/Course/Course/Presentation/Dates/CourseDatesView.swift +++ b/Course/Course/Presentation/Dates/CourseDatesView.swift @@ -239,7 +239,7 @@ struct CompletedBlocks: View { }) { HStack { VStack(alignment: .leading) { - Text(CompletionStatus.completed.rawValue) + Text(CompletionStatus.completed.localized) .font(Theme.Fonts.titleSmall) .foregroundColor(Theme.Colors.textPrimary) @@ -286,6 +286,7 @@ struct CompletedBlocks: View { Spacer() if block.canShowLink && !block.firstComponentBlockID.isEmpty { Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) .resizable() .scaledToFit() .frame(width: 6.55, height: 11.15) @@ -325,6 +326,7 @@ struct BlockStatusView: View { Spacer() if block.canShowLink && !block.firstComponentBlockID.isEmpty { Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) .resizable() .scaledToFit() .frame(width: 6.55, height: 11.15)