Skip to content

Commit

Permalink
Merge branch 'develop' into feat/relative-dates
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanStepanok committed Aug 19, 2024
2 parents 8ddd699 + 157ded7 commit 2e43d42
Show file tree
Hide file tree
Showing 39 changed files with 398 additions and 668 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/validate-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test Makefile

on:
workflow_dispatch:

push:
branches: [ develop ]

pull_request:

jobs:
translations:
name: "${{ matrix.case.name }}"
runs-on: macos-14

strategy:
matrix:
case:
- name: clean_translations
command: |
make clean_translations;
- name: extract_translations
command: |
make extract_translations;
echo "Ensure combined localization file exists";
test -f I18N/I18N/en.lproj/Localizable.strings;
- name: pull_translations
command:
make pull_translations;
echo "Files are split properly";
test -f Authorization/Authorization/uk.lproj/Localizable.strings;

steps:
- uses: nschloe/action-cached-lfs-checkout@v1.2.1
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Use Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install translations requirements
run: make translation_requirements

- name: "${{ matrix.case.name }}"
run: "${{ matrix.case.command }}"
2 changes: 0 additions & 2 deletions Authorization/Authorization.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
025F40E129D360E20064C183 /* ResetPasswordViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetPasswordViewModel.swift; sourceTree = "<group>"; };
02A2ACDA2A4B016100FBBBBB /* AuthorizationAnalytics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorizationAnalytics.swift; sourceTree = "<group>"; };
02E0618329DC2373006E9024 /* ResetPasswordViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetPasswordViewModelTests.swift; sourceTree = "<group>"; };
02ED50CC29A64B90008341CD /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = "<group>"; };
02F3BFE4292533720051930C /* AuthorizationRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthorizationRouter.swift; sourceTree = "<group>"; };
071009C628D1DA4F00344290 /* SignInViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInViewModel.swift; sourceTree = "<group>"; };
07169454296D913300E3DED6 /* AuthorizationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AuthorizationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -528,7 +527,6 @@
isa = PBXVariantGroup;
children = (
0770DE6C28D0C035006D8A5D /* en */,
02ED50CC29A64B90008341CD /* uk */,
);
name = Localizable.strings;
sourceTree = "<group>";
Expand Down
49 changes: 0 additions & 49 deletions Authorization/Authorization/uk.lproj/Localizable.strings

This file was deleted.

2 changes: 0 additions & 2 deletions Core/Core.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@
02EBC7562C19DCDB00BE182C /* SyncStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SyncStatus.swift; sourceTree = "<group>"; };
02EBC7582C19DE1100BE182C /* CalendarManagerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarManagerProtocol.swift; sourceTree = "<group>"; };
02EBC75A2C19DE3D00BE182C /* CourseForSync.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseForSync.swift; sourceTree = "<group>"; };
02ED50CB29A64B84008341CD /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = "<group>"; };
02F164362902A9EB0090DDEF /* StringExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringExtension.swift; sourceTree = "<group>"; };
02F6EF3A28D9B8EC00835477 /* CourseCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseCellView.swift; sourceTree = "<group>"; };
02F6EF4928D9F0A700835477 /* DateExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateExtension.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1293,7 +1292,6 @@
isa = PBXVariantGroup;
children = (
0770DE5C28D0B209006D8A5D /* en */,
02ED50CB29A64B84008341CD /* uk */,
);
name = Localizable.strings;
sourceTree = "<group>";
Expand Down
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
17 changes: 17 additions & 0 deletions Core/Core/Domain/Model/CourseDates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,23 @@ public enum CompletionStatus: String {
case thisWeek = "This Week"
case nextWeek = "Next Week"
case upcoming = "Upcoming"

public var localized: String {
switch self {
case .completed:
return CoreLocalization.CourseDates.completed
case .pastDue:
return CoreLocalization.CourseDates.pastDue
case .today:
return CoreLocalization.CourseDates.today
case .thisWeek:
return CoreLocalization.CourseDates.thisWeek
case .nextWeek:
return CoreLocalization.CourseDates.nextWeek
case .upcoming:
return CoreLocalization.CourseDates.upcoming
}
}
}

public extension Array {
Expand Down
12 changes: 12 additions & 0 deletions Core/Core/SwiftGen/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
2 changes: 1 addition & 1 deletion Core/Core/View/Base/AlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ struct AlertView_Previews: PreviewProvider {
.previewLayout(.sizeThatFits)
.background(Color.gray)

AlertView(alertTitle: "Comfirm log out",
AlertView(alertTitle: "Confirm log out",
alertMessage: "Are you sure you want to log out?",
positiveAction: "Yes",
onCloseTapped: {},
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
7 changes: 7 additions & 0 deletions Core/Core/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,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";
127 changes: 0 additions & 127 deletions Core/Core/uk.lproj/Localizable.strings

This file was deleted.

Loading

0 comments on commit 2e43d42

Please sign in to comment.