Skip to content
9 changes: 9 additions & 0 deletions src/translations/en/businessErrorsEn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,13 @@
'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",

Check warning on line 76 in src/translations/en/businessErrorsEn.ts

View workflow job for this annotation

GitHub Actions / build / build

Replace `"The·equipment·{id}·of·type·{equipmentType}·is·not·a·substation·or·voltage·level·in·given·network"` with `'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',
};
9 changes: 9 additions & 0 deletions src/translations/fr/businessErrorsFr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
7 changes: 3 additions & 4 deletions src/utils/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<IntlShape['formatMessage']>[1];
export type FormatValues = Record<string, PrimitiveType>;

export type ErrorMessageDescriptor = {
descriptor: Parameters<IntlShape['formatMessage']>[0];
descriptor: MessageDescriptor;
values?: FormatValues;
};
Loading