@@ -378,7 +378,7 @@ private function executeValidation(object $validation, ConnectionInterface $to)
378
378
// If the 'sourceFolder' property is set, then we are validating a folder of i18n files
379
379
$ dataPath = rtrim ($ validation ->sourceFolder , '/ ' );
380
380
$ matches = null ;
381
- if (preg_match ("/^(wider\-region|national\-calendar|diocesan\-calendar)\-([A-Z][_a-z ]+)\-i18n$/ " , $ validation ->validate , $ matches )) {
381
+ if (preg_match ("/^(wider\-region|national\-calendar|diocesan\-calendar)\-([A-Za-z_ ]+)\-i18n$/ " , $ validation ->validate , $ matches )) {
382
382
switch ($ matches [1 ]) {
383
383
case 'wider-region ' :
384
384
$ dataPath = strtr (
@@ -397,8 +397,10 @@ private function executeValidation(object $validation, ConnectionInterface $to)
397
397
$ nation = $ diocese ->nation ;
398
398
$ dataPath = strtr (
399
399
JsonData::DIOCESAN_CALENDARS_I18N_FOLDER ,
400
- ['{diocese} ' => $ matches [2 ]],
401
- ['{nation} ' => $ nation ]
400
+ [
401
+ '{diocese} ' => $ matches [2 ],
402
+ '{nation} ' => $ nation
403
+ ]
402
404
);
403
405
break ;
404
406
}
@@ -433,9 +435,11 @@ private function executeValidation(object $validation, ConnectionInterface $to)
433
435
$ dioceseName = $ diocese ->diocese ;
434
436
$ dataPath = strtr (
435
437
JsonData::DIOCESAN_CALENDARS_FILE ,
436
- ['{diocese} ' => $ matches [2 ]],
437
- ['{nation} ' => $ nation ],
438
- ['{diocese_name} ' => $ dioceseName ]
438
+ [
439
+ '{diocese} ' => $ matches [2 ],
440
+ '{nation} ' => $ nation ,
441
+ '{diocese_name} ' => $ dioceseName
442
+ ]
439
443
);
440
444
break ;
441
445
}
@@ -463,7 +467,7 @@ private function executeValidation(object $validation, ConnectionInterface $to)
463
467
if (false === $ files || empty ($ files )) {
464
468
$ message = new \stdClass ();
465
469
$ message ->type = "error " ;
466
- $ message ->text = "Data folder $ validation ->sourceFolder does not exist or does not contain any json files " ;
470
+ $ message ->text = "Data folder $ validation ->sourceFolder ( $ dataPath ) does not exist or does not contain any json files " ;
467
471
$ message ->classes = ". $ validation ->validate .file-exists " ;
468
472
$ this ->sendMessage ($ to , $ message );
469
473
return ;
0 commit comments