Skip to content

Commit

Permalink
Merge pull request #60 from adisve/patch/search/localizations
Browse files Browse the repository at this point in the history
Search page, localizations
  • Loading branch information
adisve authored May 18, 2023
2 parents 26b7cf9 + 5fed612 commit ad31acc
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 29 deletions.
2 changes: 2 additions & 0 deletions Assets/bs-BA.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

*/

"%@ at %@"="%@ u %@ sati";

"Continue"="Nastavi";

"Search events"="Traži događaje";
Expand Down
2 changes: 2 additions & 0 deletions Assets/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

*/

"%@ at %@"="%@ um %@";

"Continue"="Fortsetzen";

"Search events" = "Ereignisse suchen";
Expand Down
2 changes: 2 additions & 0 deletions Assets/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

*/

"%@ at %@"="%@ at %@";

"Continue"="Continue";

"Search events" = "Search events";
Expand Down
2 changes: 2 additions & 0 deletions Assets/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

*/

"%@ at %@"="%@ à %@";

"Continue"="Continuer";

"Search events" = "Rechercher des événements";
Expand Down
2 changes: 2 additions & 0 deletions Assets/it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

*/

"%@ at %@"="%@ alle %@";

"Continue"="Continua";

"Search events"="Cerca eventi";
Expand Down
2 changes: 2 additions & 0 deletions Assets/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

*/

"%@ at %@"="%@ kl. %@";

"Continue"="Fortsätt";

"Search events" = "Sök händelser";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ struct EventCardButton: View {
Image(systemName: "calendar.badge.clock")
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
if let eventStart = event.eventStart.toDate(),
let eventHoursMinutes = event.eventStart.convertToHoursAndMinutes()
if let eventDate = event.eventStart.toDate(),
let eventEnd = event.eventEnd.convertToHoursAndMinutes(),
let eventStart = event.eventStart.convertToHoursAndMinutes()
{
Text("\(eventStart) at \(eventHoursMinutes)")
Text(String(format: NSLocalizedString("%@, from %@ - %@", comment: ""), eventDate, eventStart, eventEnd))
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ struct UpcomingEventCardButton: View {
Image(systemName: "calendar.badge.clock")
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
if let eventStart = event.eventStart.toDate(),
let eventHoursMinutes = event.eventStart.convertToHoursAndMinutes()
if let eventDate = event.eventStart.toDate(),
let eventEnd = event.eventEnd.toDate(),
let eventStart = event.eventStart.convertToHoursAndMinutes()
{
Text(String(format: NSLocalizedString("%@ at %@", comment: ""), eventStart, eventHoursMinutes))
Text(String(format: NSLocalizedString("%@, from %@ - %@", comment: ""), eventDate, eventStart, eventEnd))
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct ExamDetailsSheet: View {
.foregroundColor(.onSurface)
})
DetailsBuilder(title: NSLocalizedString("Type", comment: ""), image: "info.circle", content: {
Text(event.type ?? NSLocalizedString("No type", comment: ""))
Text(event.type?.trimmingCharacters(in: .newlines) ?? NSLocalizedString("No type", comment: ""))
.font(.system(size: 16))
.foregroundColor(.onSurface)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ struct RegisteredBookings: View {
if !bookings.isEmpty {
ForEach(bookings) { resource in
ResourceCard(
timeSpan: "\(resource.timeSlot.from?.convertToHoursAndMinutes() ?? "")",
eventStart: resource.timeSlot.from?.convertToHoursAndMinutes() ?? NSLocalizedString("(no time)", comment: ""),
eventEnd: resource.timeSlot.to?.convertToHoursAndMinutes() ?? NSLocalizedString("(no time)", comment: ""),
title: NSLocalizedString("Booked resource", comment: ""),
location: resource.locationID,
date: resource.timeSlot.from?.toDate() ?? NSLocalizedString("(no date)", comment: ""),
hoursMinutes: "\(resource.timeSlot.from?.convertToHoursAndMinutes() ?? NSLocalizedString("(no time)", comment: "")) - \(resource.timeSlot.to?.convertToHoursAndMinutes() ?? NSLocalizedString("(no time)", comment: ""))",
onClick: {
onClickResource(resource)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ struct RegisteredEvents: View {
let eventEnd = event.eventEnd.convertToHoursAndMinutes()
{
ResourceCard(
timeSpan: "\(event.eventStart.convertToHoursAndMinutes() ?? "")",
eventStart: eventStart,
eventEnd: eventEnd,
type: event.type,
title: event.title,
date: event.eventStart.toDate() ?? NSLocalizedString("(no date)", comment: ""),
hoursMinutes: "\(eventStart) - \(eventEnd)",
onClick: {
onClickEvent(event)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,27 @@ import SwiftUI

struct ResourceCard: View {
let date: String
let hoursMinutes: String
let timeSpan: String
let eventStart: String
let eventEnd: String
let type: String?
let location: String?
let title: String?
let onClick: () -> Void

init(timeSpan: String,
type: String? = nil,
title: String? = nil,
location: String? = nil,
date: String,
hoursMinutes: String,
onClick: @escaping () -> Void)
init(
eventStart: String,
eventEnd: String,
type: String? = nil,
title: String? = nil,
location: String? = nil,
date: String,
onClick: @escaping () -> Void)
{
self.timeSpan = timeSpan
self.eventStart = eventStart
self.eventEnd = eventEnd
self.type = type
self.title = title
self.date = date
self.hoursMinutes = hoursMinutes
self.location = location
self.onClick = onClick
}
Expand Down Expand Up @@ -69,7 +70,7 @@ struct ResourceCard: View {
Image(systemName: "calendar.badge.clock")
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
Text("\(NSLocalizedString("Date:", comment: "")) \(date) \(NSLocalizedString("Time:", comment: "")) \(hoursMinutes)")
Text(String(format: NSLocalizedString("%@, from %@ - %@", comment: ""), date, eventStart, eventEnd))
.font(.system(size: 15))
.foregroundColor(.onSurface.opacity(0.7))
}
Expand Down
8 changes: 6 additions & 2 deletions Sources/Presentation/Views/Search/Search.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ struct Search: View {
.padding(.bottom, 15)
}
.background(Color.background)
.onChange(of: viewModel.selectedSchool) { _ in
viewModel.schoolNotSelected.toggle()
.onChange(of: viewModel.selectedSchool) { school in
if school == nil {
viewModel.schoolNotSelected = true
} else {
viewModel.schoolNotSelected = false
}
}
.sheet(item: $viewModel.searchPreviewModel) { model in
SearchPreview(
Expand Down
4 changes: 3 additions & 1 deletion Sources/Presentation/Views/Search/SearchInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ struct SearchInfo: View {
Group {
Text(NSLocalizedString("Important: ", comment: "")).bold()
+
Text(NSLocalizedString("This university requires you to log in to their institution before you can see some of their schedules", comment: ""))
Text(NSLocalizedString(
"This university requires you to log in to their institution before you can see some of their schedules",
comment: ""))
}.font(.system(size: 14))
.foregroundColor(.red)
}
Expand Down
6 changes: 3 additions & 3 deletions Tumble.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.2.60;
MARKETING_VERSION = 3.2.70;
NETWORK_SETTINGS = testing;
PRODUCT_BUNDLE_IDENTIFIER = com.example.tumble;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -2054,7 +2054,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.2.60;
MARKETING_VERSION = 3.2.70;
NETWORK_SETTINGS = testing;
PRODUCT_BUNDLE_IDENTIFIER = com.example.tumble;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -2096,7 +2096,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.2.60;
MARKETING_VERSION = 3.2.70;
NETWORK_SETTINGS = production;
PRODUCT_BUNDLE_IDENTIFIER = com.example.tumble;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down

0 comments on commit ad31acc

Please sign in to comment.