Skip to content

Commit 044f223

Browse files
[Validator] Fix translation of AtLeastOneOf constraint message
1 parent fee32aa commit 044f223

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+112
-111
lines changed

src/Symfony/Component/Validator/Constraints/AtLeastOneOf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AtLeastOneOf extends Composite
2626
];
2727

2828
public $constraints = [];
29-
public $message = 'This value should satisfy at least one of the following constraints:';
29+
public $message = 'This value should satisfy at least one of the following constraints:{{ child_messages }}';
3030
public $messageCollection = 'Each element of this collection should satisfy its own set of constraints.';
3131
public $includeInternalMessages = true;
3232

src/Symfony/Component/Validator/Constraints/AtLeastOneOfValidator.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function validate($value, Constraint $constraint)
3131

3232
$validator = $this->context->getValidator();
3333

34-
$messages = [$constraint->message];
34+
$childMessages = [];
3535

3636
foreach ($constraint->constraints as $key => $item) {
3737
$executionContext = clone $this->context;
@@ -51,11 +51,12 @@ public function validate($value, Constraint $constraint)
5151
$message .= $violations->get(\count($violations) - 1)->getMessage();
5252
}
5353

54-
$messages[] = $message;
54+
$childMessages[] = $message;
5555
}
5656
}
5757

58-
$this->context->buildViolation(implode('', $messages))
58+
$this->context->buildViolation($constraint->message)
59+
->setParameter('{{ child_messages }}', implode('', $childMessages))
5960
->setCode(AtLeastOneOf::AT_LEAST_ONE_OF_ERROR)
6061
->addViolation()
6162
;

src/Symfony/Component/Validator/Resources/translations/validators.af.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<target>Die hoeveelheid elemente in hierdie versameling moet 'n meelvoud van {{ compared_value }} wees.</target>
376376
</trans-unit>
377377
<trans-unit id="97">
378-
<source>This value should satisfy at least one of the following constraints:</source>
379-
<target>Hierdie waarde moet voldoen aan ten minste een van hierdie beperkings:</target>
378+
<source>This value should satisfy at least one of the following constraints:{{ child_messages }}</source>
379+
<target>Hierdie waarde moet voldoen aan ten minste een van hierdie beperkings:{{ child_messages }}</target>
380380
</trans-unit>
381381
<trans-unit id="98">
382382
<source>Each element of this collection should satisfy its own set of constraints.</source>

src/Symfony/Component/Validator/Resources/translations/validators.ar.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<target>يجب أن يكون عدد العناصر في هذه المجموعة مضاعف {{ compared_value }}.</target>
376376
</trans-unit>
377377
<trans-unit id="97">
378-
<source>This value should satisfy at least one of the following constraints:</source>
379-
<target>يجب أن تستوفي هذه القيمة واحدة من القيود التالية:</target>
378+
<source>This value should satisfy at least one of the following constraints:{{ child_messages }}</source>
379+
<target>يجب أن تستوفي هذه القيمة واحدة من القيود التالية:{{ child_messages }}</target>
380380
</trans-unit>
381381
<trans-unit id="98">
382382
<source>Each element of this collection should satisfy its own set of constraints.</source>

src/Symfony/Component/Validator/Resources/translations/validators.az.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<target>Bu kolleksiyadakı elementlerin sayı {{ compared_value }} tam bölünəni olmalıdır.</target>
376376
</trans-unit>
377377
<trans-unit id="97">
378-
<source>This value should satisfy at least one of the following constraints:</source>
379-
<target>Bu dəyər aşağıdakı məcburiyyətlərdən birini qarşılamalıdır:</target>
378+
<source>This value should satisfy at least one of the following constraints:{{ child_messages }}</source>
379+
<target>Bu dəyər aşağıdakı məcburiyyətlərdən birini qarşılamalıdır:{{ child_messages }}</target>
380380
</trans-unit>
381381
<trans-unit id="98">
382382
<source>Each element of this collection should satisfy its own set of constraints.</source>

src/Symfony/Component/Validator/Resources/translations/validators.be.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<target>Колькасць элементаў у гэтай калекцыі павінна быць кратным {{compared_value}}.</target>
376376
</trans-unit>
377377
<trans-unit id="97">
378-
<source>This value should satisfy at least one of the following constraints:</source>
379-
<target>Значэнне павінна задавальняць як мінімум аднаму з наступных абмежаванняў:</target>
378+
<source>This value should satisfy at least one of the following constraints:{{ child_messages }}</source>
379+
<target>Значэнне павінна задавальняць як мінімум аднаму з наступных абмежаванняў:{{ child_messages }}</target>
380380
</trans-unit>
381381
<trans-unit id="98">
382382
<source>Each element of this collection should satisfy its own set of constraints.</source>

src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<target>Броят на елементите в тази колекция трябва да бъде кратен на {{ compared_value }}.</target>
376376
</trans-unit>
377377
<trans-unit id="97">
378-
<source>This value should satisfy at least one of the following constraints:</source>
379-
<target>Стойността трябва да отговаря на поне едно от следните ограничения:</target>
378+
<source>This value should satisfy at least one of the following constraints:{{ child_messages }}</source>
379+
<target>Стойността трябва да отговаря на поне едно от следните ограничения:{{ child_messages }}</target>
380380
</trans-unit>
381381
<trans-unit id="98">
382382
<source>Each element of this collection should satisfy its own set of constraints.</source>

src/Symfony/Component/Validator/Resources/translations/validators.bs.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<target>Broj elemenata u ovoj kolekciji bi trebalo da bude djeljiv sa {{ compared_value }}.</target>
376376
</trans-unit>
377377
<trans-unit id="97">
378-
<source>This value should satisfy at least one of the following constraints:</source>
379-
<target>Ova vrijednost bi trebalo da zadovoljava namjanje jedno od narednih ograničenja:</target>
378+
<source>This value should satisfy at least one of the following constraints:{{ child_messages }}</source>
379+
<target>Ova vrijednost bi trebalo da zadovoljava namjanje jedno od narednih ograničenja:{{ child_messages }}</target>
380380
</trans-unit>
381381
<trans-unit id="98">
382382
<source>Each element of this collection should satisfy its own set of constraints.</source>

src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<target>El nombre d'elements d'aquesta col·lecció ha de ser múltiple de {{compared_value}}.</target>
376376
</trans-unit>
377377
<trans-unit id="97">
378-
<source>This value should satisfy at least one of the following constraints:</source>
379-
<target>Aquest valor ha de satisfer almenys una de les restriccions següents:</target>
378+
<source>This value should satisfy at least one of the following constraints:{{ child_messages }}</source>
379+
<target>Aquest valor ha de satisfer almenys una de les restriccions següents:{{ child_messages }}</target>
380380
</trans-unit>
381381
<trans-unit id="98">
382382
<source>Each element of this collection should satisfy its own set of constraints.</source>

src/Symfony/Component/Validator/Resources/translations/validators.cs.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<target>Počet prvků v této kolekci musí být násobek {{ compared_value }}.</target>
376376
</trans-unit>
377377
<trans-unit id="97">
378-
<source>This value should satisfy at least one of the following constraints:</source>
379-
<target>Tato hodnota musí splňovat alespoň jedno z následujících omezení:</target>
378+
<source>This value should satisfy at least one of the following constraints:{{ child_messages }}</source>
379+
<target>Tato hodnota musí splňovat alespoň jedno z následujících omezení:{{ child_messages }}</target>
380380
</trans-unit>
381381
<trans-unit id="98">
382382
<source>Each element of this collection should satisfy its own set of constraints.</source>

0 commit comments

Comments
 (0)