Skip to content

Commit

Permalink
Localize Chronodose text items for English
Browse files Browse the repository at this point in the history
  • Loading branch information
peblair committed May 14, 2021
1 parent 3d0a9c6 commit 43acab4
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 13 deletions.
18 changes: 9 additions & 9 deletions ViteMaDose/Helpers/Utils/OnboardingManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum OnboardingManager {
private static let descriptionFontSize: CGFloat = 18.0

static func makeFirstPage() -> BLTNPageItem {
let page = BLTNPageItem(title: "Vite Ma Dose fait le plein de nouveautés !")
let page = BLTNPageItem(title: Localization.Onboarding.Page1.title)
page.image = "🎉".toImage(ofSize: 60)

let appearance = BLTNItemAppearance()
Expand All @@ -22,8 +22,8 @@ enum OnboardingManager {
appearance.actionButtonColor = .royalBlue

page.appearance = appearance
page.descriptionText = "Découvrez les notifications pour ne rater aucune dose, et les chronodoses permettant à chacun de trouver un rendez-vous en 24h sans restriction."
page.actionButtonTitle = "Suivant"
page.descriptionText = Localization.Onboarding.Page1.description
page.actionButtonTitle = Localization.Onboarding.Page1.button
page.alternativeButton?.isHidden = true
page.isDismissable = false
page.actionHandler = { item in
Expand All @@ -34,7 +34,7 @@ enum OnboardingManager {
}

static func makeNotificationsPage() -> BLTNPageItem {
let page = BLTNPageItem(title: "Notifications")
let page = BLTNPageItem(title: Localization.Onboarding.Page2.title)
page.image = "🔔".toImage(ofSize: 60)

let appearance = BLTNItemAppearance()
Expand All @@ -43,8 +43,8 @@ enum OnboardingManager {
appearance.actionButtonColor = .royalBlue

page.appearance = appearance
page.descriptionText = "Pour ne rater aucun créneau de vaccination, nous avons ajouté un système de notifications ! Pour vous abonner à un centre, rien de plus simple, il suffit de toucher la cloche. Vous recevrez une alerte si nous détectons des disponibilités."
page.actionButtonTitle = "Suivant"
page.descriptionText = Localization.Onboarding.Page2.description
page.actionButtonTitle = Localization.Onboarding.Page2.button
page.alternativeButton?.isHidden = true
page.isDismissable = false
page.actionHandler = { item in
Expand All @@ -56,7 +56,7 @@ enum OnboardingManager {
}

static func makeChronoDosesPage() -> BLTNPageItem {
let page = BLTNPageItem(title: "Chronodoses")
let page = BLTNPageItem(title: Localization.Onboarding.Page3.title)
page.image = "⚡️".toImage(ofSize: 60)

let appearance = BLTNItemAppearance()
Expand All @@ -65,8 +65,8 @@ enum OnboardingManager {
appearance.actionButtonColor = .mandy

page.appearance = appearance
page.descriptionText = "À partir du mercredi 12 mai, vous pourrez réserver les rendez-vous de vaccination vacants du jour même et du lendemain, sans restriction. Nous les appelons les “Chronodoses”, et sont matérialisées par des éclairs et un bandeau rouge."
page.actionButtonTitle = "Merci !"
page.descriptionText = Localization.Onboarding.Page3.description
page.actionButtonTitle = Localization.Onboarding.Page3.button
page.alternativeButton?.isHidden = true
page.isDismissable = false
page.actionHandler = { item in
Expand Down
24 changes: 24 additions & 0 deletions ViteMaDose/Resources/Localization/Localization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum Localization {
enum Locations {
static let list_title = "locations.list_title".localized
static let followed_list_title = "locations.followed_list_title".localized
static let followed_list_button = "locations.followed_list_button".localized
static let no_results = "locations.no_results".localized
static let available_locations = "locations.available_locations".localized
static let all_locations = "locations.all_locations".localized
Expand All @@ -59,6 +60,7 @@ enum Localization {
}

enum Location {
static let chronodoses_available = "location.chronodoses_available".localized
static let date = "location.date".localized
static let book_button = "location.book_button".localized
static let verify_button = "location.verify_button".localized
Expand All @@ -70,6 +72,8 @@ enum Localization {
static let unavailable_address = "location.unavailable_address".localized
static let start_following_title = "location.start_following_title".localized
static let start_following_message = "location.start_following_message".localized
static let start_following_button_all = "location.start_following_button_all".localized
static let start_following_button_chronodoses = "location.start_following_button_chronodoses".localized
static let follow_action_title = "location.follow_action_title".localized
static let notify_button = "location.notify_button".localized
static let follow_button = "location.follow_button".localized
Expand All @@ -92,4 +96,24 @@ enum Localization {
static let offline = "error.network.offline".localized
}
}

enum Onboarding {
enum Page1 {
static let title = "onboarding.page_1.title".localized
static let description = "onboarding.page_1.description".localized
static let button = "onboarding.page_1.button".localized
}

enum Page2 {
static let title = "onboarding.page_2.title".localized
static let description = "onboarding.page_2.description".localized
static let button = "onboarding.page_2.button".localized
}

enum Page3 {
static let title = "onboarding.page_3.title".localized
static let description = "onboarding.page_3.description".localized
static let button = "onboarding.page_3.button".localized
}
}
}
26 changes: 26 additions & 0 deletions ViteMaDose/Resources/Localization/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@
"location_search.search_placeholder" = "Commune, Postal Code, Department...";
// Locations
"locations.list_title" = "List of locations";
"locations.followed_list_button" = "My locations";
"locations.followed_list_title" = "My followed locations";
"locations.no_results" = "We have not found any appointments for %@";
"locations.sort_option.closest" = "Closest";
"locations.sort_option.fastest" = "Available soonest";
// Location
"location.chronodoses_available" = "Chronodoses Available";
"location.date" = "On %@ at %@";
"location.book_button" = "Book an appointment";
"location.verify_button" = "Check with this location";
Expand All @@ -37,10 +40,33 @@
"location.unavailable_date" = "Date unavailable";
"location.unavailable_name" = "Name of location unavailable";
"location.unavailable_address" = "Address unavailable";
// Location start following
"location.start_following_title" = "Start following?";
"location.start_following_message" = "You can choose to be notified for each change in availability or only when Chronodoses become available at this center.";
"location.start_following_button_all" = "All notifications";
"location.start_following_button_chronodoses" = "Chronodoses only";
"location.follow_action_title" = "Follow";
"location.notify_button" = "Be Notified";
"location.follow_button" = "Follow without notifications";
// Location stop following
"location.stop_following_title" = "Stop following this center?";
"location.stop_following_message" = "If you have activated notifications for this center, they will be deactivated.";
"location.unfollow_action_title" = "Stop Following?";
"location.stop_following_button" = "Unfollow";
// 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.";
// Onboarding
"onboarding.page_1.title" = "Vite Ma Dose has many new features!";
"onboarding.page_1.description" = "Notifications allow you to never miss a new dose, and Chronodoses allow anyone to find an appointment in the next 24 hours without any restrictions.";
"onboarding.page_1.button" = "Next";
"onboarding.page_2.title" = "Notifications";
"onboarding.page_2.description" = "To never miss a vaccination availability, we have added a notification system! To follow a center, it's as simple as pressing the bell icon. You will recieve an alert if we detect any openings.";
"onboarding.page_2.button" = "Next";
"onboarding.page_3.title" = "Chronodoses";
"onboarding.page_3.description" = "Starting 12 May, you can reserve a vaccination appointment the same day or the next day, without restrictions. We call these Chronodoses, and they are denoted by lightning and a red band.";
"onboarding.page_3.button" = "Thank You!";
15 changes: 15 additions & 0 deletions ViteMaDose/Resources/Localization/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
"location_search.search_placeholder" = "Commune, Code Postal, Département...";
// Locations
"locations.list_title" = "Liste des lieux";
"locations.followed_list_button" = "Mes centres suivis";
"locations.followed_list_title" = "Liste de vos lieux suivis";
"locations.no_results" = "Nous n'avons pas trouvé de créneau pour %@";
"locations.sort_option.closest" = "Au plus proche";
"locations.sort_option.fastest" = "Au plus vite";
// Location
"location.chronodoses_available" = "Chronodoses disponibles";
"location.date" = "Le %@ à partir de %@";
"location.book_button" = "Prendre rendez-vous";
"location.verify_button" = "Vérifier ce lieu";
Expand All @@ -41,6 +43,9 @@
// Location start following
"location.start_following_title" = "Recevoir les notifications ?";
"location.start_following_message" = "Vous pouvez choisir d'être notifié pour chaque changement de disponibilité ou seulement lorsque des Chronodoses sont disponibles pour ce centre.";
// Alerts
"location.start_following_button_all" = "Toutes les notifications";
"location.start_following_button_chronodoses" = "Chronodoses uniquement";
"location.follow_action_title" = "Suivre";
"location.notify_button" = "Être notifié";
"location.follow_button" = "Suivre sans notifications";
Expand All @@ -56,3 +61,13 @@
"error.generic.default_message" = "Si le problème persiste, merci de contacter l'équipe sur https://covidtracker.fr/contact";
"error.network.server_error" = "Nous rencontrons des problèmes avec le serveur, veuillez réessayer plus tard.";
"error.network.offline" = "Il semblerait que vous soyez hors ligne.";
// Onboarding
"onboarding.page_1.title" = "Vite Ma Dose fait le plein de nouveautés !";
"onboarding.page_1.description" = "Découvrez les notifications pour ne rater aucune dose, et les chronodoses permettant à chacun de trouver un rendez-vous en 24h sans restriction.";
"onboarding.page_1.button" = "Suivant";
"onboarding.page_2.title" = "Notifications";
"onboarding.page_2.description" = "Pour ne rater aucun créneau de vaccination, nous avons ajouté un système de notifications ! Pour vous abonner à un centre, rien de plus simple, il suffit de toucher la cloche. Vous recevrez une alerte si nous détectons des disponibilités.";
"onboarding.page_2.button" = "Suivant";
"onboarding.page_3.title" = "Chronodoses";
"onboarding.page_3.description" = "À partir du mercredi 12 mai, vous pourrez réserver les rendez-vous de vaccination vacants du jour même et du lendemain, sans restriction. Nous les appelons les “Chronodoses”, et sont matérialisées par des éclairs et un bandeau rouge.";
"onboarding.page_3.button" = "Merci !";
2 changes: 1 addition & 1 deletion ViteMaDose/Views/CentresList/Cells/CentreCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ final class CentreCell: UITableViewCell {
chronoDoseViewContainer.clipsToBounds = false
chronoDoseViewContainer.layer.cornerRadius = 15.0
chronoDoseViewContainer.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
chronoDoseLabel.text = "Chronodoses disponibles"
chronoDoseLabel.text = Localization.Location.chronodoses_available
}

private func configureFollowCentreButton(_ viewData: CentreViewData) {
Expand Down
4 changes: 2 additions & 2 deletions ViteMaDose/Views/CentresList/CentresListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ extension CentresListViewController: UITableViewDelegate {
preferredStyle: .actionSheet
)

let allNotificationsAction = UIAlertAction(title: "Toutes les notifications", style: .default) { [weak self] _ in
let allNotificationsAction = UIAlertAction(title: Localization.Location.start_following_button_all, style: .default) { [weak self] _ in
self?.viewModel.requestNotificationsAuthorizationIfNeeded {
self?.viewModel.followCentre(at: indexPath, notificationsType: .all)
}
}

let chronoDosesNotificationsAction = UIAlertAction(title: "Chronodoses uniquement", style: .default) { [weak self] _ in
let chronoDosesNotificationsAction = UIAlertAction(title: Localization.Location.start_following_button_chronodoses, style: .default) { [weak self] _ in
self?.viewModel.requestNotificationsAuthorizationIfNeeded {
self?.viewModel.followCentre(at: indexPath, notificationsType: .chronodoses)
}
Expand Down
2 changes: 1 addition & 1 deletion ViteMaDose/Views/Home/Cells/HomeFollowedCentresCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class HomeFollowedCentresCell: UITableViewCell {
iconContainerView.setCornerRadius(15)
cellContainerView.setCornerRadius(15)

titleLabel.text = "Mes centres suivis"
titleLabel.text = Localization.Locations.followed_list_button
titleLabel.textColor = .label
titleLabel.font = .rounded(ofSize: 18, weight: .bold)
}
Expand Down

0 comments on commit 43acab4

Please sign in to comment.