diff --git a/src/translations/en/businessErrorsEn.ts b/src/translations/en/businessErrorsEn.ts index a0d29fc5..5fdcd014 100644 --- a/src/translations/en/businessErrorsEn.ts +++ b/src/translations/en/businessErrorsEn.ts @@ -72,4 +72,13 @@ export const businessErrorsEn = { 'sensitivityAnalysis.tooManyFactors': 'Too many factors to run sensitivity analysis: {resultCount} results (limit: {resultCountLimit}) and {variableCount} variables (limit: {variableCountLimit}).', 'pccMin.missingFilter': 'The configuration contains one filter that has been deleted.', + 'diagram.invalidEquipmentType': + "The equipment {id} of type {equipmentType} is not a substation or voltage level in given network", + 'diagram.invalidSubstationLayout': "Given substation layout {substationLayout} doesn't exist", + 'diagram.invalidDisplayMode': "Given sld display mode {sldDisplayMode} doesn't exist", + 'diagram.maxVoltageLevelDisplayed': + 'You need to reduce the number of voltage levels to be displayed in the network area diagram (current {nbVoltageLevels}, maximum {maxVoltageLevels})', + 'diagram.equipmentNotFound': 'Voltage level or substation {id} not found', + 'diagram.noConfiguredPosition': 'No configured position found', + 'diagram.noVoltageLevelFound': 'No voltage level found for this network area diagram', }; diff --git a/src/translations/fr/businessErrorsFr.ts b/src/translations/fr/businessErrorsFr.ts index 7ac232b5..7396f646 100644 --- a/src/translations/fr/businessErrorsFr.ts +++ b/src/translations/fr/businessErrorsFr.ts @@ -73,4 +73,13 @@ export const businessErrorsFr = { 'sensitivityAnalysis.tooManyFactors': 'Trop de facteurs pour exécuter l’analyse de sensibilité : {resultCount} résultats (limite : {resultCountLimit}) et {variableCount} variables (limite : {variableCountLimit}).', 'pccMin.missingFilter': 'La configuration contient un filtre qui a été supprimé.', + 'diagram.invalidEquipmentType': + "L'équipement {id} de type {equipmentType} n'est pas un site ou poste dans le réseau courant", + 'diagram.invalidSubstationLayout': "Le mode d'affichage de site {substationLayout} n'existe pas", + 'diagram.invalidDisplayMode': "Le mode d'affichage de schéma unifilaire {sldDisplayMode} n'existe pas", + 'diagram.maxVoltageLevelDisplayed': + "Vous devez réduire le nombre de postes à afficher dans l'image nodale de zone (nombre actuel {nbVoltageLevels}, nombre maximum {maxVoltageLevels})", + 'diagram.equipmentNotFound': 'Poste ou site {id} non trouvé', + 'diagram.noConfiguredPosition': 'Aucune position configurée trouvée', + 'diagram.noVoltageLevelFound': 'Aucun poste trouvé pour cette image nodale de zone', }; diff --git a/src/utils/types/types.ts b/src/utils/types/types.ts index ebf10549..c1c2a715 100644 --- a/src/utils/types/types.ts +++ b/src/utils/types/types.ts @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import type { UUID } from 'node:crypto'; -import { IntlShape } from 'react-intl'; +import { MessageDescriptor, PrimitiveType } from 'react-intl'; import { ElementType } from './elementType'; export type Input = string | number; @@ -79,10 +79,9 @@ export enum ArrayAction { REMOVE = 'REMOVE', } -// extracted from intl .d.ts but the type is not explicitely defined and exported -export type FormatValues = Parameters[1]; +export type FormatValues = Record; export type ErrorMessageDescriptor = { - descriptor: Parameters[0]; + descriptor: MessageDescriptor; values?: FormatValues; };