diff --git a/ViteMaDose.xcodeproj/project.pbxproj b/ViteMaDose.xcodeproj/project.pbxproj index a57ebc75..9c121d5c 100644 --- a/ViteMaDose.xcodeproj/project.pbxproj +++ b/ViteMaDose.xcodeproj/project.pbxproj @@ -207,6 +207,8 @@ 57FE5C0E261FA84D0012B66D /* UIColor+VideMaDose.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+VideMaDose.swift"; sourceTree = ""; }; 6A28354B262DC06C00FA6456 /* ViteMaDose.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ViteMaDose.entitlements; sourceTree = ""; }; 889B9A49263307EC00175E24 /* .swiftlint.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = ""; }; + A17FECFE264D301E0044E034 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + A17FECFF264D301F0044E034 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; DA234DC22626494600D6F71C /* remote-configuration.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "remote-configuration.plist"; sourceTree = ""; }; DA234DD02626506600D6F71C /* RemoteConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteConfig.swift; sourceTree = ""; }; DA4D9952261E6B6A00D28AD0 /* LocationSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationSearchViewController.swift; sourceTree = ""; }; @@ -662,6 +664,7 @@ knownRegions = ( fr, Base, + en, ); mainGroup = 576738B3261E329C004A700D; packageReferences = ( @@ -932,6 +935,7 @@ isa = PBXVariantGroup; children = ( 57B2BCA42633B254001B3D61 /* fr */, + A17FECFE264D301E0044E034 /* en */, ); name = Localizable.strings; sourceTree = ""; @@ -940,6 +944,7 @@ isa = PBXVariantGroup; children = ( 57DEAA04263444BB005E8628 /* fr */, + A17FECFF264D301F0044E034 /* en */, ); name = Localizable.stringsdict; sourceTree = ""; diff --git a/ViteMaDose/Models/VaccinationCentre.swift b/ViteMaDose/Models/VaccinationCentre.swift index 82f0877f..65d65a5e 100644 --- a/ViteMaDose/Models/VaccinationCentre.swift +++ b/ViteMaDose/Models/VaccinationCentre.swift @@ -84,15 +84,18 @@ extension VaccinationCentre { } var nextAppointmentDate: Date? { - return prochainRdv?.toDate(nil, region: AppConstant.franceRegion)?.date ?? prochainRdv?.toISODate(nil, region: AppConstant.franceRegion)?.date + return prochainRdv?.toDate(nil, region: Region.current)?.date ?? prochainRdv?.toISODate(nil, region: Region.current)?.date } var nextAppointmentDay: String? { - return prochainRdv?.toString(with: .date(.long), region: AppConstant.franceRegion) + // Don't display year + // [TODO] Technically an en_US locale should do "MMM dd" instead + return prochainRdv?.toString(with: .custom("dd MMM"), region: Region.current) } var nextAppointmentTime: String? { - return prochainRdv?.toString(with: .time(.short), region: AppConstant.franceRegion) + // Avoid AM/PM in English locale + return prochainRdv?.toString(with: .custom("HH:mm"), region: Region.current) } var appointmentUrl: URL? { @@ -176,7 +179,7 @@ struct VaccinationCentres: Codable, Hashable { } var formattedLastUpdated: String? { - guard let lastUpdateDate = lastUpdated?.toDate(nil, region: AppConstant.franceRegion) else { + guard let lastUpdateDate = lastUpdated?.toDate(nil, region: Region.current) else { return nil } diff --git a/ViteMaDose/Resources/AppConstant.swift b/ViteMaDose/Resources/AppConstant.swift index 69d80589..58ea7404 100644 --- a/ViteMaDose/Resources/AppConstant.swift +++ b/ViteMaDose/Resources/AppConstant.swift @@ -9,9 +9,4 @@ import Foundation import SwiftDate enum AppConstant { - static let franceRegion = Region( - calendar: Calendar.current, - zone: Zones.current, - locale: Locale(identifier: "fr_FR") - ) } diff --git a/ViteMaDose/Resources/Localization/Localization.swift b/ViteMaDose/Resources/Localization/Localization.swift index 22e1f5af..981a4400 100644 --- a/ViteMaDose/Resources/Localization/Localization.swift +++ b/ViteMaDose/Resources/Localization/Localization.swift @@ -31,7 +31,7 @@ enum Localization { } enum LocationSearch { - static let search_placeholder = "Commune, Code Postal, Département...".localized + static let search_placeholder = "location_search.search_placeholder".localized enum MainTitle { static let title = "location_search.main_title".localized diff --git a/ViteMaDose/Resources/Localization/en.lproj/Localizable.strings b/ViteMaDose/Resources/Localization/en.lproj/Localizable.strings new file mode 100644 index 00000000..5392022f --- /dev/null +++ b/ViteMaDose/Resources/Localization/en.lproj/Localizable.strings @@ -0,0 +1,46 @@ +/* + Localizable.strings + ViteMaDose + + Created by Philip Blair on 12/05/2021. + +*/ + +// Home +"home.main_title" = "Find a vaccine quickly and easily"; +"home.main_title.first_highlighted_text" = "quickly"; +"home.main_title.second_highlighted_text" = "easily"; +"home.search_placeholder" = "Search..."; +"home.last_stats" = "Latest statistics..."; +"home.open_map" = "See locations on the map"; +"home.partners" = "Find your appointments with"; +"home.stats.all_locations" = "Locations found in France"; +"home.stats.all_availabilities" = "Appointments available"; +"home.stats.locations_with_availabilities" = "Locations with available appointments"; +"home.stats.available_locations_percentage" = "Of locations have availabilities"; +// Department Selection +"location_search.main_title" = "Select or search for a location in France"; +"location_search.main_title.highlighted_text" = "France"; +"location_search.search_placeholder" = "Commune, Postal Code, Department..."; +// Locations +"locations.list_title" = "List of locations"; +"locations.no_results" = "We have not found any appointments for %@"; +"locations.sort_option.closest" = "Closest"; +"locations.sort_option.fastest" = "Available soonest"; +// Location +"location.date" = "On %@ at %@"; +"location.book_button" = "Book an appointment"; +"location.verify_button" = "Check with this location"; +"location.last_update" = "Last updated on %@ at %@"; +"location.no_appointment" = "No appointments"; +"location.open_route" = "Show route"; +"location.unavailable_date" = "Date unavailable"; +"location.unavailable_name" = "Name of location unavailable"; +"location.unavailable_address" = "Address unavailable"; +// Error +"error.generic.title" = "Oops! We're having some technical difficulties..."; +"error.generic.retry_button" = "Retry"; +"error.generic.cancel_button" = "Cancel"; +"error.generic.default_message" = "If the problem persists, please contact the team at https://covidtracker.fr/contact"; +"error.network.server_error" = "We've encountered a server error. Please try again later."; +"error.network.offline" = "You appear to be offline."; diff --git a/ViteMaDose/Resources/Localization/en.lproj/Localizable.stringsdict b/ViteMaDose/Resources/Localization/en.lproj/Localizable.stringsdict new file mode 100644 index 00000000..db19eded --- /dev/null +++ b/ViteMaDose/Resources/Localization/en.lproj/Localizable.stringsdict @@ -0,0 +1,112 @@ + + + + + locations.available_locations + + NSStringLocalizedFormatKey + %#@count@ + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + zero + Locations with appointments + one + Location with appointments + other + Locations with appointments + + + locations.all_locations + + NSStringLocalizedFormatKey + %#@count@ + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + zero + Total locations found + one + Total location found + other + Total locations found + + + locations.appointments + + NSStringLocalizedFormatKey + %#@count@ + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + zero + %d appointments + one + %d appointment + other + %d appointments + + + locations.main_title_department + + NSStringLocalizedFormatKey + %#@count@ + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + one + We have found %d appointment for %@ + other + We have found %d appointment for %@ + + + locations.main_title_city + + NSStringLocalizedFormatKey + %#@count@ + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + one + We have found %d appointment near %@ + other + We have found %d appointments near %@ + + + home.recent_search + + New item + + NSStringLocalizedFormatKey + %#@count@ + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + zero + Recent searches + one + Recent search + other + Recent searches + + + +