From ef20c838c44037ef4262cf13edd52e6cad86ee2a Mon Sep 17 00:00:00 2001 From: Raz Date: Fri, 1 Nov 2024 08:53:37 +0100 Subject: [PATCH] fix wording --- .../Views/Planning/PlanningSettingsView.swift | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/PadelClub/Views/Planning/PlanningSettingsView.swift b/PadelClub/Views/Planning/PlanningSettingsView.swift index 33a2162..3edfed5 100644 --- a/PadelClub/Views/Planning/PlanningSettingsView.swift +++ b/PadelClub/Views/Planning/PlanningSettingsView.swift @@ -190,6 +190,20 @@ struct PlanningSettingsView: View { } } + private func _localizedFooterMessage(groupStagesWithDateIsEmpty: Bool, roundsWithDateIsEmpty: Bool) -> String { + let base = "Supprime les horaires des matchs restants non démarrés." + let extend = " Garde les horaires définis pour les " + if groupStagesWithDateIsEmpty && roundsWithDateIsEmpty { + return base + } else if groupStagesWithDateIsEmpty, roundsWithDateIsEmpty == false { + return base + extend + "manches du tableau." + } else if roundsWithDateIsEmpty, groupStagesWithDateIsEmpty == false { + return base + extend + "poules." + } else { + return base + extend + "poules et les manches du tableau." + } + } + @ViewBuilder private func _smartView() -> some View { let allMatches = tournament.allMatches().filter({ $0.hasEnded() == false && $0.hasStarted() == false }) @@ -221,7 +235,7 @@ struct PlanningSettingsView: View { } } } footer: { - Text("Supprime les horaires des matchs restants non démarrés. Garde les horaires définis pour les poules et les manches du tableau.") + Text(_localizedFooterMessage(groupStagesWithDateIsEmpty: groupStagesWithDate.isEmpty, roundsWithDateIsEmpty: roundsWithDate.isEmpty)) } }