Skip to content

Commit e069714

Browse files
committed
fix: rtl for "CompletionStatus" Enum in CourseDates
1 parent fab9aa7 commit e069714

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Course/Course/Domain/Model/CourseDates.swift

+17
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,23 @@ public enum CompletionStatus: String {
286286
case thisWeek = "This Week"
287287
case nextWeek = "Next Week"
288288
case upcoming = "Upcoming"
289+
290+
var localized: String {
291+
switch self {
292+
case .completed:
293+
return CourseLocalization.CourseDates.completed
294+
case .pastDue:
295+
return CourseLocalization.CourseDates.pastDue
296+
case .today:
297+
return CourseLocalization.CourseDates.today
298+
case .thisWeek:
299+
return CourseLocalization.CourseDates.today
300+
case .nextWeek:
301+
return CourseLocalization.CourseDates.today
302+
case .upcoming:
303+
return CourseLocalization.CourseDates.today
304+
}
305+
}
289306
}
290307

291308
extension Array {

Course/Course/Presentation/Dates/CourseDatesView.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ struct CompletedBlocks: View {
239239
}) {
240240
HStack {
241241
VStack(alignment: .leading) {
242-
Text(CompletionStatus.completed.rawValue)
242+
Text(CompletionStatus.completed.localized)
243243
.font(Theme.Fonts.titleSmall)
244244
.foregroundColor(Theme.Colors.textPrimary)
245245

@@ -286,6 +286,7 @@ struct CompletedBlocks: View {
286286
Spacer()
287287
if block.canShowLink && !block.firstComponentBlockID.isEmpty {
288288
Image(systemName: "chevron.right")
289+
.flipsForRightToLeftLayoutDirection(true)
289290
.resizable()
290291
.scaledToFit()
291292
.frame(width: 6.55, height: 11.15)
@@ -325,6 +326,7 @@ struct BlockStatusView: View {
325326
Spacer()
326327
if block.canShowLink && !block.firstComponentBlockID.isEmpty {
327328
Image(systemName: "chevron.right")
329+
.flipsForRightToLeftLayoutDirection(true)
328330
.resizable()
329331
.scaledToFit()
330332
.frame(width: 6.55, height: 11.15)

0 commit comments

Comments
 (0)