diff --git a/src/app/results/log-helper.ts b/src/app/results/log-helper.ts index 1f24f07acc43ead8f700525f49e66653d889ff1f..bf5dc33695ff3ee789983cceef78878fbad3727a 100644 --- a/src/app/results/log-helper.ts +++ b/src/app/results/log-helper.ts @@ -111,11 +111,18 @@ export class LogHelper { && l.messages.length === 0 // existing global messages make generic message below useless ) { const logStats = this.logStats(); - const m = new Message(MessageCode.WARNING_PROBLEMS_ENCOUNTERED); - m.extraVar.info = "" + logStats.info; // to avoid displaying fixed number of digits - m.extraVar.warning = "" + logStats.warning; - m.extraVar.error = "" + logStats.error; - l.add(m); + let m: Message; + if (logStats.warning > 0) { + m = new Message(MessageCode.WARNING_WARNINGS_ABSTRACT); + m.extraVar.nb = "" + logStats.warning; + l.add(m); + } + if (logStats.error > 0) { + let c: MessageCode = logStats.error > 1 ? MessageCode.WARNING_ERRORS_ABSTRACT_PLUR : MessageCode.WARNING_ERRORS_ABSTRACT; + m = new Message(c); + m.extraVar.nb = "" + logStats.error; + l.add(m); + } } } // sinon pas de log global (aucun paramètre ne varie) return l; diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index c05269d2b5f214ccb66f229cab42f16e8838e0ad..eb3b5d866c0117611a7a3170c49eb559703ede6e 100755 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -7,6 +7,7 @@ "WARNING_NOTCH_SUBMERSION_GREATER_THAN_07": "Notch formula is discouraged when submersion is greater than 0.7", "WARNING_SLOT_SUBMERSION_NOT_BETWEEN_07_AND_09": "Slot formula is discouraged when submersion is lower than 0.7 or greater than 0.9", "WARNING_WEIR_SUBMERSION_LOWER_THAN_08": "Submerged weir formula is discouraged when submersion is lower than 08", + "WARNING_WARNINGS_ABSTRACT": "%nb% warnings occurred during calculation", "WARNING_ERRORS_ABSTRACT": "%nb% error occurred during calculation", "WARNING_ERRORS_ABSTRACT_PLUR": "%nb% errors occurred during calculation", "ERROR_BIEF_Z1_CALC_FAILED": "Unable to calculate upstream elevation (calculation interrupted before upstream)", @@ -553,7 +554,6 @@ "INFO_QUICKNAV_INPUT": "input", "INFO_QUICKNAV_RESULTS": "results", "WARNING_PREBARRAGE_BASSIN_ZF_SUP_Z1": "Bottom elevation of basin #%n% is greater than upstream water elevation", - "WARNING_PROBLEMS_ENCOUNTERED": "Problems occurred during calculation (info: %info%, warning: %warning%, error: %error%)", "INFO_REGIMEUNIFORME_DESCRIPTION": "open-channel flow normal depth", "INFO_REGIMEUNIFORME_TITRE_COURT": "Uniform flow", "INFO_REGIMEUNIFORME_TITRE": "Uniform flow calculation", @@ -658,7 +658,6 @@ "INFO_ESPECE_TITRE": "Fish species characteristics", "INFO_ESPECE_DESCRIPTION": "ichtyocompatible", "INFO_ESPECE_TITRE_COURT": "Species", - "WARNING_WARNINGS_ABSTRACT": "%nb% warnings occurred during calculation", "ERROR_JET_SUBMERGED_NO_SOLUTION": "There is no solution", "WARNING_DEVER_ZDV_INF_ZR": "Apron elevation of structure #%number% is below river bed elevation", "WARNING_JET_START_SUBMERGED": "Water elevation is greater than jet start elevation", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 6e487527a3f6a9a6e897c53855ef36410d77c039..60802ea9ef0bd88fdd23644186ffe1927e48ac33 100755 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -7,6 +7,7 @@ "WARNING_NOTCH_SUBMERSION_GREATER_THAN_07": "La formule de l'échancrure n'est pas conseillée pour un ennoiement supérieur à 0.7", "WARNING_SLOT_SUBMERSION_NOT_BETWEEN_07_AND_09": "La formule de la fente n'est pas conseillée pour un ennoiement inférieur à 0.7 et supérieur à 0.9", "WARNING_WEIR_SUBMERSION_LOWER_THAN_08": "La formule du seuil noyé n'est pas conseillé pour un ennoiement inférieur à 0.8", + "WARNING_WARNINGS_ABSTRACT": "%nb% avertissements rencontrés lors du calcul", "WARNING_ERRORS_ABSTRACT": "%nb% erreur rencontrée lors du calcul", "WARNING_ERRORS_ABSTRACT_PLUR": "%nb% erreurs rencontrées lors du calcul", "ERROR_BIEF_Z1_CALC_FAILED": "Impossible de calculer la cote amont (calcul interrompu avant l'amont)", @@ -554,7 +555,6 @@ "INFO_QUICKNAV_INPUT": "données", "INFO_QUICKNAV_RESULTS": "résultats", "WARNING_PREBARRAGE_BASSIN_ZF_SUP_Z1": "Cote de fond du bassin n°%n% supérieure à la cote de l'eau amont", - "WARNING_PROBLEMS_ENCOUNTERED": "Des problèmes sont survenus durant le calcul (info : %info%, avertissement : %warning%, erreur : %error%)", "INFO_REGIMEUNIFORME_DESCRIPTION": "hydraulique à surface libre hauteur normale", "INFO_REGIMEUNIFORME_TITRE_COURT": "R. uniforme", "INFO_REGIMEUNIFORME_TITRE": "Régime uniforme", @@ -659,7 +659,6 @@ "INFO_ESPECE_TITRE": "Caractéristiques d'une espèce", "INFO_ESPECE_DESCRIPTION": "ichtyocompatible", "INFO_ESPECE_TITRE_COURT": "Espèce", - "WARNING_WARNINGS_ABSTRACT": "%nb% avertissements rencontrés lors du calcul", "ERROR_JET_SUBMERGED_NO_SOLUTION": "Il n'y a pas de solution", "WARNING_DEVER_ZDV_INF_ZR": "La cote de radier de l'ouvrage n°%number% est sous la cote de fond du lit", "WARNING_JET_START_SUBMERGED": "La cote de l'eau est supérieure à la cote de départ du jet",