Commit b817ae6 1 parent 36eb346 commit b817ae6 Copy full SHA for b817ae6
File tree 3 files changed +14
-3
lines changed
src/modules/pathfinding/hooks
3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 9
9
"cancelPathfinding" : " Cancel" ,
10
10
"chooseOnMap" : " Choose on the map" ,
11
11
"composition" : " Composition" ,
12
+ "coreErrors" : {
13
+ "path_with_repeated_tracks" : " The path goes over the same track multiple times"
14
+ },
12
15
"deleteVias" : " Delete steps" ,
13
16
"deleteRoute" : " Delete the route" ,
14
17
"destination" : " Destination" ,
Original file line number Diff line number Diff line change 9
9
"cancelPathfinding" : " Annuler" ,
10
10
"chooseOnMap" : " Choisir sur la carte" ,
11
11
"composition" : " Composition" ,
12
+ "coreErrors" : {
13
+ "path_with_repeated_tracks" : " Le chemin emprunte plusieurs fois la même voie"
14
+ },
12
15
"deleteRoute" : " Supprimer l'itinéraire" ,
13
16
"deleteVias" : " Supprimer les étapes" ,
14
17
"destination" : " Destination" ,
Original file line number Diff line number Diff line change @@ -365,19 +365,24 @@ export const usePathfinding = (
365
365
} else {
366
366
pathfindingDispatch ( {
367
367
type : 'PATHFINDING_INCOMPATIBLE_CONSTRAINTS' ,
368
- message : `pathfindingErrors.${ pathfindingResult . error_type } ` ,
368
+ message : t ( `pathfindingErrors.${ pathfindingResult . error_type } ` ) ,
369
369
} ) ;
370
370
}
371
371
}
372
372
} else if ( pathfindingResult . failed_status === 'internal_error' ) {
373
+ const translationKey = pathfindingResult . core_error . type . startsWith ( 'core:' )
374
+ ? pathfindingResult . core_error . type . replace ( 'core:' , '' )
375
+ : pathfindingResult . core_error . type ;
373
376
pathfindingDispatch ( {
374
377
type : 'PATHFINDING_ERROR' ,
375
- message : `pathfindingErrors.${ pathfindingResult . core_error . message } ` ,
378
+ message : t ( `coreErrors.${ translationKey } ` , {
379
+ defaultValue : pathfindingResult . core_error . message ,
380
+ } ) ,
376
381
} ) ;
377
382
} else {
378
383
pathfindingDispatch ( {
379
384
type : 'PATHFINDING_ERROR' ,
380
- message : `pathfindingErrors.${ pathfindingResult . error_type } ` ,
385
+ message : t ( `pathfindingErrors.${ pathfindingResult . error_type } ` ) ,
381
386
} ) ;
382
387
}
383
388
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments