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: RTL localization for assets and strings #441

Merged
merged 6 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -2,7 +2,8 @@
"images" : [
{
"filename" : "arrowRight16.svg",
"idiom" : "universal"
"idiom" : "universal",
"language-direction" : "left-to-right"
}
],
"info" : {
Expand Down
1 change: 1 addition & 0 deletions Core/Core/View/Base/CourseButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
17 changes: 17 additions & 0 deletions Course/Course/Domain/Model/CourseDates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion Course/Course/Presentation/Dates/CourseDatesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -287,6 +287,8 @@ struct CompletedBlocks: View {
if block.canShowLink && !block.firstComponentBlockID.isEmpty {
Image(systemName: "chevron.right")
.resizable()
.flipsForRightToLeftLayoutDirection(true)

Comment on lines +292 to +293
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the extra line here.

.scaledToFit()
.frame(width: 6.55, height: 11.15)
.labelStyle(.iconOnly)
Expand Down Expand Up @@ -326,6 +328,7 @@ struct BlockStatusView: View {
if block.canShowLink && !block.firstComponentBlockID.isEmpty {
Image(systemName: "chevron.right")
.resizable()
.flipsForRightToLeftLayoutDirection(true)
.scaledToFit()
.frame(width: 6.55, height: 11.15)
.labelStyle(.iconOnly)
Expand Down
4 changes: 3 additions & 1 deletion Course/Course/Presentation/Handouts/HandoutsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ struct HandoutsItemCell: View {
.font(Theme.Fonts.labelSmall)
}
Spacer()
Image(systemName: "chevron.right").resizable()
Image(systemName: "chevron.right")
.resizable()
.flipsForRightToLeftLayoutDirection(true)
.frame(width: 7, height: 12)
.foregroundColor(Theme.Colors.accentColor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public struct CourseVerticalView: View {
}
}
Image(systemName: "chevron.right")
.flipsForRightToLeftLayoutDirection(true)
.padding(.vertical, 8)
}
.padding(.horizontal, 36)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ public struct TopicCell: View {
.multilineTextAlignment(.leading)
Spacer()
Image(systemName: "chevron.right")
.flipsForRightToLeftLayoutDirection(true)
.foregroundColor(Theme.Colors.accentColor)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ struct ProfileSupportInfoView: View {
.foregroundColor(Theme.Colors.textPrimary)
Spacer()
Image(systemName: "chevron.right")
.flipsForRightToLeftLayoutDirection(true)
}
}
.simultaneousGesture(TapGesture().onEnded {
Expand Down Expand Up @@ -187,6 +188,7 @@ struct ProfileSupportInfoView: View {
.font(Theme.Fonts.titleMedium)
Spacer()
Image(systemName: "chevron.right")
.flipsForRightToLeftLayoutDirection(true)
}
}
.foregroundColor(.primary)
Expand Down
2 changes: 2 additions & 0 deletions Profile/Profile/Presentation/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public struct SettingsView: View {
.font(Theme.Fonts.titleMedium)
Spacer()
Image(systemName: "chevron.right")
.flipsForRightToLeftLayoutDirection(true)
}
})
.accessibilityIdentifier("video_settings_button")
Expand Down Expand Up @@ -183,6 +184,7 @@ public struct SettingsView: View {
.font(Theme.Fonts.titleMedium)
Spacer()
Image(systemName: "chevron.right")
.flipsForRightToLeftLayoutDirection(true)
}
})
.accessibilityIdentifier("video_settings_button")
Expand Down
Loading