Skip to content

Commit

Permalink
Merge branch 'hotfix/1.1.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cristoforocervino committed Apr 29, 2021
2 parents b3e8d3f + d4dbc96 commit 23e8def
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/Form/DataMapper/PeriodDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function mapFormsToData(iterable $forms, &$viewData): void
if ($startDate instanceof \DateTimeInterface && $endDate instanceof \DateTimeInterface) {
if ($startDate > $endDate) {
$failure = new TransformationFailedException('Start date should be greater or equals then the end date.');
$failure->setInvalidMessage('Start date should be greater or equals then the end date', [
$failure->setInvalidMessage('Start date should be greater or equals then the end date.', [
'{{ startDate }}' => json_encode($startDate),
'{{ endDate }}' => json_encode($endDate),
]);
Expand Down
3 changes: 2 additions & 1 deletion src/Form/PeriodType.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public function configureOptions(OptionsResolver $resolver): void
'end_date_options' => [],
'boundary_type_child_name' => 'boundary',
'boundary_type_options' => [],
'allow_null' => true
'allow_null' => true,
'error_bubbling' => false
]);

$resolver->setAllowedValues('default_boundary_type', [
Expand Down
20 changes: 0 additions & 20 deletions src/Resources/translations/AndantePeriodBundle.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,6 @@
<source>Boundary type</source>
<target>Boundary type</target>
</trans-unit>
<trans-unit id="8">
<source>Start date should be valid. {{ startDate }} is not a valid date.</source>
<target>La data di inizio dovrebbe essere valida. {{ startDate }} non è una data valida.</target>
</trans-unit>
<trans-unit id="9">
<source>End date should be valid. {{ endDate }} is not a valid date.</source>
<target>La data di fine dovrebbe essere valida. {{ endDate }} non è una data valida.</target>
</trans-unit>
<trans-unit id="10">
<source>Start date should be greater or equals then the end date.</source>
<target>La data di inizio dovrebbe essere maggiore o uguale della data di fine.</target>
</trans-unit>
<trans-unit id="11">
<source>Invalid Period.</source>
<target>Periodo non valido.</target>
</trans-unit>
<trans-unit id="12">
<source>A valid Period is required.</source>
<target>Un periodo è obbligatorio.</target>
</trans-unit>
</body>
</file>
</xliff>
20 changes: 0 additions & 20 deletions src/Resources/translations/AndantePeriodBundle.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,6 @@
<source>Boundary type</source>
<target>Estremità</target>
</trans-unit>
<trans-unit id="8">
<source>Start date should be valid. {{ startDate }} is not a valid date.</source>
<target>Start date should be valid. {{ startDate }} is not a valid date.</target>
</trans-unit>
<trans-unit id="9">
<source>End date should be valid. {{ endDate }} is not a valid date.</source>
<target>End date should be valid. {{ endDate }} is not a valid date.</target>
</trans-unit>
<trans-unit id="10">
<source>Start date should be greater or equals then the end date.</source>
<target>Start date should be greater or equals then the end date.</target>
</trans-unit>
<trans-unit id="11">
<source>Invalid Period.</source>
<target>Invalid Period.</target>
</trans-unit>
<trans-unit id="12">
<source>A valid Period is required.</source>
<target>A valid Period is required.</target>
</trans-unit>
</body>
</file>
</xliff>
27 changes: 27 additions & 0 deletions src/Resources/translations/validators.en.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="file.ext" source-language="it" datatype="plaintext">
<body>
<trans-unit id="invalid_message_period.invalid_start_date">
<source>Start date should be valid. {{ startDate }} is not a valid date.</source>
<target>Start date should be valid. {{ startDate }} is not a valid date.</target>
</trans-unit>
<trans-unit id="invalid_message_period.invalid_end_date">
<source>End date should be valid. {{ endDate }} is not a valid date.</source>
<target>End date should be valid. {{ endDate }} is not a valid date.</target>
</trans-unit>
<trans-unit id="invalid_message_period.invalid_date_range">
<source>Start date should be greater or equals then the end date.</source>
<target>Start date should be greater or equals then the end date.</target>
</trans-unit>
<trans-unit id="invalid_message_period.invalid">
<source>Invalid Period.</source>
<target>Invalid Period.</target>
</trans-unit>
<trans-unit id="invalid_message_period.required">
<source>A valid Period is required.</source>
<target>A valid Period is required.</target>
</trans-unit>
</body>
</file>
</xliff>
27 changes: 27 additions & 0 deletions src/Resources/translations/validators.it.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="file.ext" source-language="it" datatype="plaintext">
<body>
<trans-unit id="invalid_message_period.invalid_start_date">
<source>Start date should be valid. {{ startDate }} is not a valid date.</source>
<target>La data di inizio dovrebbe essere valida. {{ startDate }} non è una data valida.</target>
</trans-unit>
<trans-unit id="invalid_message_period.invalid_end_date">
<source>End date should be valid. {{ endDate }} is not a valid date.</source>
<target>La data di fine dovrebbe essere valida. {{ endDate }} non è una data valida.</target>
</trans-unit>
<trans-unit id="invalid_message_period.invalid_date_range">
<source>Start date should be greater or equals then the end date.</source>
<target>La data di inizio dovrebbe essere successiva o uguale della data di fine.</target>
</trans-unit>
<trans-unit id="invalid_message_period.invalid">
<source>Invalid Period.</source>
<target>Periodo non valido.</target>
</trans-unit>
<trans-unit id="invalid_message_period.required">
<source>A valid Period is required.</source>
<target>Un periodo è obbligatorio.</target>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 23e8def

Please sign in to comment.