From 6ac4716b86571a4201b0e018d5470d777351a562 Mon Sep 17 00:00:00 2001 From: Rawan Date: Thu, 16 May 2024 13:53:45 +0300 Subject: [PATCH 1/5] fix: rtl for "arrowRight16" image in Core/Assets --- Core/Core/Assets.xcassets/arrowRight16.imageset/Contents.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/Core/Assets.xcassets/arrowRight16.imageset/Contents.json b/Core/Core/Assets.xcassets/arrowRight16.imageset/Contents.json index 2d22dfa63..bbe56d546 100644 --- a/Core/Core/Assets.xcassets/arrowRight16.imageset/Contents.json +++ b/Core/Core/Assets.xcassets/arrowRight16.imageset/Contents.json @@ -2,7 +2,8 @@ "images" : [ { "filename" : "arrowRight16.svg", - "idiom" : "universal" + "idiom" : "universal", + "language-direction" : "left-to-right" } ], "info" : { From fab9aa70155bd1962f0f14d01e3531b71aa72b02 Mon Sep 17 00:00:00 2001 From: Rawan Date: Thu, 16 May 2024 13:57:23 +0300 Subject: [PATCH 2/5] fix: rtl for "chevron.right" system image in many views --- Core/Core/View/Base/CourseButton.swift | 1 + Course/Course/Presentation/Handouts/HandoutsView.swift | 4 +++- .../Outline/CourseStructure/CourseStructureView.swift | 0 .../Outline/CourseVertical/CourseVerticalView.swift | 1 + .../Presentation/DiscussionTopics/DiscussionTopicsView.swift | 1 + .../Profile/Subviews/ProfileSupportInfoView.swift | 2 ++ Profile/Profile/Presentation/Settings/SettingsView.swift | 2 ++ 7 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 Course/Course/Presentation/Outline/CourseStructure/CourseStructureView.swift diff --git a/Core/Core/View/Base/CourseButton.swift b/Core/Core/View/Base/CourseButton.swift index 9ff48554a..cfc999d5b 100644 --- a/Core/Core/View/Base/CourseButton.swift +++ b/Core/Core/View/Base/CourseButton.swift @@ -40,6 +40,7 @@ public struct CourseButton: View { .foregroundColor(Theme.Colors.textPrimary) Spacer() Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) .padding(.vertical, 8) .foregroundColor(Theme.Colors.accentXColor) } diff --git a/Course/Course/Presentation/Handouts/HandoutsView.swift b/Course/Course/Presentation/Handouts/HandoutsView.swift index c9a2ed6cf..1d1003bfd 100644 --- a/Course/Course/Presentation/Handouts/HandoutsView.swift +++ b/Course/Course/Presentation/Handouts/HandoutsView.swift @@ -205,7 +205,9 @@ struct HandoutsItemCell: View { .font(Theme.Fonts.labelSmall) } Spacer() - Image(systemName: "chevron.right").resizable() + Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) + .resizable() .frame(width: 7, height: 12) .foregroundColor(Theme.Colors.accentColor) } diff --git a/Course/Course/Presentation/Outline/CourseStructure/CourseStructureView.swift b/Course/Course/Presentation/Outline/CourseStructure/CourseStructureView.swift new file mode 100644 index 000000000..e69de29bb diff --git a/Course/Course/Presentation/Outline/CourseVertical/CourseVerticalView.swift b/Course/Course/Presentation/Outline/CourseVertical/CourseVerticalView.swift index ccfc6f9b7..cd0c8d174 100644 --- a/Course/Course/Presentation/Outline/CourseVertical/CourseVerticalView.swift +++ b/Course/Course/Presentation/Outline/CourseVertical/CourseVerticalView.swift @@ -125,6 +125,7 @@ public struct CourseVerticalView: View { } } Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) .padding(.vertical, 8) } .padding(.horizontal, 36) diff --git a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift index ad84d6a00..5964e41ab 100644 --- a/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift +++ b/Discussion/Discussion/Presentation/DiscussionTopics/DiscussionTopicsView.swift @@ -263,6 +263,7 @@ public struct TopicCell: View { .multilineTextAlignment(.leading) Spacer() Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) .foregroundColor(Theme.Colors.accentColor) } }) diff --git a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift index 5b8f74713..29ff3c17a 100644 --- a/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift +++ b/Profile/Profile/Presentation/Profile/Subviews/ProfileSupportInfoView.swift @@ -130,6 +130,7 @@ struct ProfileSupportInfoView: View { .foregroundColor(Theme.Colors.textPrimary) Spacer() Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) } } .simultaneousGesture(TapGesture().onEnded { @@ -187,6 +188,7 @@ struct ProfileSupportInfoView: View { .font(Theme.Fonts.titleMedium) Spacer() Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) } } .foregroundColor(.primary) diff --git a/Profile/Profile/Presentation/Settings/SettingsView.swift b/Profile/Profile/Presentation/Settings/SettingsView.swift index 590afa784..e827d005e 100644 --- a/Profile/Profile/Presentation/Settings/SettingsView.swift +++ b/Profile/Profile/Presentation/Settings/SettingsView.swift @@ -150,6 +150,7 @@ public struct SettingsView: View { .font(Theme.Fonts.titleMedium) Spacer() Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) } }) .accessibilityIdentifier("video_settings_button") @@ -183,6 +184,7 @@ public struct SettingsView: View { .font(Theme.Fonts.titleMedium) Spacer() Image(systemName: "chevron.right") + .flipsForRightToLeftLayoutDirection(true) } }) .accessibilityIdentifier("video_settings_button") From e069714559d8a21b4f822bfbd82f96b920c6b171 Mon Sep 17 00:00:00 2001 From: Rawan Date: Thu, 16 May 2024 13:59:12 +0300 Subject: [PATCH 3/5] 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) From d9f1701c98a22f252d2e35cc5ae191e809140393 Mon Sep 17 00:00:00 2001 From: RawanMatar89 <41669180+RawanMatar89@users.noreply.github.com> Date: Thu, 11 Jul 2024 09:44:08 +0300 Subject: [PATCH 4/5] fix: flip image to support rtl issue --- Course/Course/Presentation/Dates/CourseDatesView.swift | 5 +++-- Course/Course/Presentation/Handouts/HandoutsView.swift | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Course/Course/Presentation/Dates/CourseDatesView.swift b/Course/Course/Presentation/Dates/CourseDatesView.swift index 5bac7ea56..609503b0b 100644 --- a/Course/Course/Presentation/Dates/CourseDatesView.swift +++ b/Course/Course/Presentation/Dates/CourseDatesView.swift @@ -286,8 +286,9 @@ struct CompletedBlocks: View { Spacer() if block.canShowLink && !block.firstComponentBlockID.isEmpty { Image(systemName: "chevron.right") - .flipsForRightToLeftLayoutDirection(true) .resizable() + .flipsForRightToLeftLayoutDirection(true) + .scaledToFit() .frame(width: 6.55, height: 11.15) .labelStyle(.iconOnly) @@ -326,8 +327,8 @@ struct BlockStatusView: View { Spacer() if block.canShowLink && !block.firstComponentBlockID.isEmpty { Image(systemName: "chevron.right") - .flipsForRightToLeftLayoutDirection(true) .resizable() + .flipsForRightToLeftLayoutDirection(true) .scaledToFit() .frame(width: 6.55, height: 11.15) .labelStyle(.iconOnly) diff --git a/Course/Course/Presentation/Handouts/HandoutsView.swift b/Course/Course/Presentation/Handouts/HandoutsView.swift index 1d1003bfd..f08075fb5 100644 --- a/Course/Course/Presentation/Handouts/HandoutsView.swift +++ b/Course/Course/Presentation/Handouts/HandoutsView.swift @@ -206,8 +206,8 @@ struct HandoutsItemCell: View { } Spacer() Image(systemName: "chevron.right") - .flipsForRightToLeftLayoutDirection(true) .resizable() + .flipsForRightToLeftLayoutDirection(true) .frame(width: 7, height: 12) .foregroundColor(Theme.Colors.accentColor) } From 59dd1d2d2e76880df1df8f651aa5e187977b3ca9 Mon Sep 17 00:00:00 2001 From: RawanMatar89 <41669180+RawanMatar89@users.noreply.github.com> Date: Sun, 21 Jul 2024 12:59:44 +0300 Subject: [PATCH 5/5] fix: "CompletionStatus" in course dates localized var issue --- Core/Core/Domain/Model/CourseDates.swift | 14 +++++++------- Core/Core/SwiftGen/Strings.swift | 12 ++++++++++++ Core/Core/en.lproj/Localizable.strings | 7 +++++++ 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Core/Core/Domain/Model/CourseDates.swift b/Core/Core/Domain/Model/CourseDates.swift index a7005a24a..f3fbcdd9a 100644 --- a/Core/Core/Domain/Model/CourseDates.swift +++ b/Core/Core/Domain/Model/CourseDates.swift @@ -332,20 +332,20 @@ public enum CompletionStatus: String { case nextWeek = "Next Week" case upcoming = "Upcoming" - var localized: String { + public var localized: String { switch self { case .completed: - return CourseLocalization.CourseDates.completed + return CoreLocalization.CourseDates.completed case .pastDue: - return CourseLocalization.CourseDates.pastDue + return CoreLocalization.CourseDates.pastDue case .today: - return CourseLocalization.CourseDates.today + return CoreLocalization.CourseDates.today case .thisWeek: - return CourseLocalization.CourseDates.today + return CoreLocalization.CourseDates.thisWeek case .nextWeek: - return CourseLocalization.CourseDates.today + return CoreLocalization.CourseDates.nextWeek case .upcoming: - return CourseLocalization.CourseDates.today + return CoreLocalization.CourseDates.upcoming } } } diff --git a/Core/Core/SwiftGen/Strings.swift b/Core/Core/SwiftGen/Strings.swift index 8cdf97b6e..ab42f4176 100644 --- a/Core/Core/SwiftGen/Strings.swift +++ b/Core/Core/SwiftGen/Strings.swift @@ -79,6 +79,18 @@ public enum CoreLocalization { } } public enum CourseDates { + /// Completed + public static let completed = CoreLocalization.tr("Localizable", "COURSE_DATES.COMPLETED", fallback: "Completed") + /// Next week + public static let nextWeek = CoreLocalization.tr("Localizable", "COURSE_DATES.NEXT_WEEK", fallback: "Next week") + /// Past due + public static let pastDue = CoreLocalization.tr("Localizable", "COURSE_DATES.PAST_DUE", fallback: "Past due") + /// This week + public static let thisWeek = CoreLocalization.tr("Localizable", "COURSE_DATES.THIS_WEEK", fallback: "This week") + /// Today + public static let today = CoreLocalization.tr("Localizable", "COURSE_DATES.TODAY", fallback: "Today") + /// Upcoming + public static let upcoming = CoreLocalization.tr("Localizable", "COURSE_DATES.UPCOMING", fallback: "Upcoming") public enum ResetDate { /// Your dates could not be shifted. Please try again. public static let errorMessage = CoreLocalization.tr("Localizable", "COURSE_DATES.RESET_DATE.ERROR_MESSAGE", fallback: "Your dates could not be shifted. Please try again.") diff --git a/Core/Core/en.lproj/Localizable.strings b/Core/Core/en.lproj/Localizable.strings index b4ca1bc64..1f8389f1f 100644 --- a/Core/Core/en.lproj/Localizable.strings +++ b/Core/Core/en.lproj/Localizable.strings @@ -139,3 +139,10 @@ "COURSE_DATES.RESET_DATE.ERROR_MESSAGE" = "Your dates could not be shifted. Please try again."; "COURSE_DATES.RESET_DATE.SUCCESS_MESSAGE" = "Your dates have been successfully shifted."; "COURSE_DATES.RESET_DATE.TITLE" = "Course Dates"; + +"COURSE_DATES.TODAY" = "Today"; +"COURSE_DATES.COMPLETED" = "Completed"; +"COURSE_DATES.PAST_DUE" = "Past due"; +"COURSE_DATES.THIS_WEEK" = "This week"; +"COURSE_DATES.NEXT_WEEK" = "Next week"; +"COURSE_DATES.UPCOMING" = "Upcoming";