Skip to content

Commit bd264b8

Browse files
Merge branch '5.0' into 5.1
* 5.0: [Cache] Use the default expiry when saving (not when creating) items Fix typo Fix DBAL deprecation [Form] Fix ChoiceType translation domain Add Tagalog translations for new form messages [Form] Add missing vietnamese translations sync translations from master [OptionsResolver] Fix force prepend normalizer add vietnamese translation for html5 color validation
2 parents b6bc375 + 7c4aee4 commit bd264b8

File tree

5 files changed

+316
-2
lines changed

5 files changed

+316
-2
lines changed

Extension/Core/Type/ChoiceType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ private function addSubForm(FormBuilderInterface $builder, string $name, ChoiceV
390390
'value' => $choiceView->value,
391391
'label' => $choiceView->label,
392392
'attr' => $choiceView->attr,
393-
'translation_domain' => $options['translation_domain'],
393+
'translation_domain' => $options['choice_translation_domain'],
394394
'block_name' => 'entry',
395395
];
396396

Resources/translations/validators.en.xlf

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,102 @@
1818
<source>This value is not a valid HTML5 color.</source>
1919
<target>This value is not a valid HTML5 color.</target>
2020
</trans-unit>
21+
<trans-unit id="100">
22+
<source>Please enter a valid birthdate.</source>
23+
<target>Please enter a valid birthdate.</target>
24+
</trans-unit>
25+
<trans-unit id="101">
26+
<source>The selected choice is invalid.</source>
27+
<target>The selected choice is invalid.</target>
28+
</trans-unit>
29+
<trans-unit id="102">
30+
<source>The collection is invalid.</source>
31+
<target>The collection is invalid.</target>
32+
</trans-unit>
33+
<trans-unit id="103">
34+
<source>Please select a valid color.</source>
35+
<target>Please select a valid color.</target>
36+
</trans-unit>
37+
<trans-unit id="104">
38+
<source>Please select a valid country.</source>
39+
<target>Please select a valid country.</target>
40+
</trans-unit>
41+
<trans-unit id="105">
42+
<source>Please select a valid currency.</source>
43+
<target>Please select a valid currency.</target>
44+
</trans-unit>
45+
<trans-unit id="106">
46+
<source>Please choose a valid date interval.</source>
47+
<target>Please choose a valid date interval.</target>
48+
</trans-unit>
49+
<trans-unit id="107">
50+
<source>Please enter a valid date and time.</source>
51+
<target>Please enter a valid date and time.</target>
52+
</trans-unit>
53+
<trans-unit id="108">
54+
<source>Please enter a valid date.</source>
55+
<target>Please enter a valid date.</target>
56+
</trans-unit>
57+
<trans-unit id="109">
58+
<source>Please select a valid file.</source>
59+
<target>Please select a valid file.</target>
60+
</trans-unit>
61+
<trans-unit id="110">
62+
<source>The hidden field is invalid.</source>
63+
<target>The hidden field is invalid.</target>
64+
</trans-unit>
65+
<trans-unit id="111">
66+
<source>Please enter an integer.</source>
67+
<target>Please enter an integer.</target>
68+
</trans-unit>
69+
<trans-unit id="112">
70+
<source>Please select a valid language.</source>
71+
<target>Please select a valid language.</target>
72+
</trans-unit>
73+
<trans-unit id="113">
74+
<source>Please select a valid locale.</source>
75+
<target>Please select a valid locale.</target>
76+
</trans-unit>
77+
<trans-unit id="114">
78+
<source>Please enter a valid money amount.</source>
79+
<target>Please enter a valid money amount.</target>
80+
</trans-unit>
81+
<trans-unit id="115">
82+
<source>Please enter a number.</source>
83+
<target>Please enter a number.</target>
84+
</trans-unit>
85+
<trans-unit id="116">
86+
<source>The password is invalid.</source>
87+
<target>The password is invalid.</target>
88+
</trans-unit>
89+
<trans-unit id="117">
90+
<source>Please enter a percentage value.</source>
91+
<target>Please enter a percentage value.</target>
92+
</trans-unit>
93+
<trans-unit id="118">
94+
<source>The values do not match.</source>
95+
<target>The values do not match.</target>
96+
</trans-unit>
97+
<trans-unit id="119">
98+
<source>Please enter a valid time.</source>
99+
<target>Please enter a valid time.</target>
100+
</trans-unit>
101+
<trans-unit id="120">
102+
<source>Please select a valid timezone.</source>
103+
<target>Please select a valid timezone.</target>
104+
</trans-unit>
105+
<trans-unit id="121">
106+
<source>Please enter a valid URL.</source>
107+
<target>Please enter a valid URL.</target>
108+
</trans-unit>
109+
<trans-unit id="122">
110+
<source>Please enter a valid search term.</source>
111+
<target>Please enter a valid search term.</target>
112+
</trans-unit>
113+
<trans-unit id="123">
114+
<source>Please provide a valid phone number.</source>
115+
<target>Please provide a valid phone number.</target>
116+
</trans-unit>
21117
</body>
22118
</file>
23119
</xliff>

Resources/translations/validators.tl.xlf

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,106 @@
1414
<source>The CSRF token is invalid. Please try to resubmit the form.</source>
1515
<target>Hindi balido ang CSRF token. Maagpasa muli ng isang pang porma.</target>
1616
</trans-unit>
17+
<trans-unit id="99">
18+
<source>This value is not a valid HTML5 color.</source>
19+
<target>Ang halagang ito ay hindi wastong HTML5 color.</target>
20+
</trans-unit>
21+
<trans-unit id="100">
22+
<source>Please enter a valid birthdate.</source>
23+
<target>Pakilagay ang tamang petsa ng kapanganakan.</target>
24+
</trans-unit>
25+
<trans-unit id="101">
26+
<source>The selected choice is invalid.</source>
27+
<target>Ang pinagpiliang sagot ay hindi tama.</target>
28+
</trans-unit>
29+
<trans-unit id="102">
30+
<source>The collection is invalid.</source>
31+
<target>Hindi balido ang koleksyon.</target>
32+
</trans-unit>
33+
<trans-unit id="103">
34+
<source>Please select a valid color.</source>
35+
<target>Pakipiliin ang nararapat na kulay.</target>
36+
</trans-unit>
37+
<trans-unit id="104">
38+
<source>Please select a valid country.</source>
39+
<target>Pakipiliin ang nararapat na bansa.</target>
40+
</trans-unit>
41+
<trans-unit id="105">
42+
<source>Please select a valid currency.</source>
43+
<target>Pakipiliin ang tamang pananalapi.</target>
44+
</trans-unit>
45+
<trans-unit id="106">
46+
<source>Please choose a valid date interval.</source>
47+
<target>Piliin ang wastong agwat ng petsa.</target>
48+
</trans-unit>
49+
<trans-unit id="107">
50+
<source>Please enter a valid date and time.</source>
51+
<target>Piliin ang wastong petsa at oras.</target>
52+
</trans-unit>
53+
<trans-unit id="108">
54+
<source>Please enter a valid date.</source>
55+
<target>Ilagay ang wastong petsa.</target>
56+
</trans-unit>
57+
<trans-unit id="109">
58+
<source>Please select a valid file.</source>
59+
<target>Piliin ang balidong file.</target>
60+
</trans-unit>
61+
<trans-unit id="110">
62+
<source>The hidden field is invalid.</source>
63+
<target>Hindi balido ang field na nakatago.</target>
64+
</trans-unit>
65+
<trans-unit id="111">
66+
<source>Please enter an integer.</source>
67+
<target>Pakilagay ang integer.</target>
68+
</trans-unit>
69+
<trans-unit id="112">
70+
<source>Please select a valid language.</source>
71+
<target>Piliin ang nararapat na lengguwahe.</target>
72+
</trans-unit>
73+
<trans-unit id="113">
74+
<source>Please select a valid locale.</source>
75+
<target>Pakipili ang nararapat na locale.</target>
76+
</trans-unit>
77+
<trans-unit id="114">
78+
<source>Please enter a valid money amount.</source>
79+
<target>Pakilagay ang tamang halaga ng pera.</target>
80+
</trans-unit>
81+
<trans-unit id="115">
82+
<source>Please enter a number.</source>
83+
<target>Ilagay ang numero.</target>
84+
</trans-unit>
85+
<trans-unit id="116">
86+
<source>The password is invalid.</source>
87+
<target>Hindi balido ang password.</target>
88+
</trans-unit>
89+
<trans-unit id="117">
90+
<source>Please enter a percentage value.</source>
91+
<target>Pakilagay ang tamang porsyento ng halaga.</target>
92+
</trans-unit>
93+
<trans-unit id="118">
94+
<source>The values do not match.</source>
95+
<target>Hindi tugma ang mga halaga.</target>
96+
</trans-unit>
97+
<trans-unit id="119">
98+
<source>Please enter a valid time.</source>
99+
<target>Pakilagay ang tamang oras.</target>
100+
</trans-unit>
101+
<trans-unit id="120">
102+
<source>Please select a valid timezone.</source>
103+
<target>Pakilagay ang tamang sona ng oras.</target>
104+
</trans-unit>
105+
<trans-unit id="121">
106+
<source>Please enter a valid URL.</source>
107+
<target>Pakilagay ang balidong URL.</target>
108+
</trans-unit>
109+
<trans-unit id="122">
110+
<source>Please enter a valid search term.</source>
111+
<target>Pakilagay ang balidong katagang sinasaliksik.</target>
112+
</trans-unit>
113+
<trans-unit id="123">
114+
<source>Please provide a valid phone number.</source>
115+
<target>Pakilagay ang balidong numero ng telepono.</target>
116+
</trans-unit>
17117
</body>
18118
</file>
19119
</xliff>

Resources/translations/validators.vi.xlf

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<body>
55
<trans-unit id="28">
66
<source>This form should not contain extra fields.</source>
7-
<target>Mẫu này không nên chứa trường mở rộng</target>
7+
<target>Mẫu này không nên chứa trường mở rộng.</target>
88
</trans-unit>
99
<trans-unit id="29">
1010
<source>The uploaded file was too large. Please try to upload a smaller file.</source>
@@ -14,6 +14,106 @@
1414
<source>The CSRF token is invalid. Please try to resubmit the form.</source>
1515
<target>CSRF token không hợp lệ. Vui lòng thử lại.</target>
1616
</trans-unit>
17+
<trans-unit id="99">
18+
<source>This value is not a valid HTML5 color.</source>
19+
<target>Giá trị này không phải là màu HTML5 hợp lệ.</target>
20+
</trans-unit>
21+
<trans-unit id="100">
22+
<source>Please enter a valid birthdate.</source>
23+
<target>Vui lòng nhập ngày sinh hợp lệ.</target>
24+
</trans-unit>
25+
<trans-unit id="101">
26+
<source>The selected choice is invalid.</source>
27+
<target>Lựa chọn không hợp lệ.</target>
28+
</trans-unit>
29+
<trans-unit id="102">
30+
<source>The collection is invalid.</source>
31+
<target>Danh sách không hợp lệ.</target>
32+
</trans-unit>
33+
<trans-unit id="103">
34+
<source>Please select a valid color.</source>
35+
<target>Vui lòng chọn một màu hợp lệ.</target>
36+
</trans-unit>
37+
<trans-unit id="104">
38+
<source>Please select a valid country.</source>
39+
<target>Vui lòng chọn đất nước hợp lệ.</target>
40+
</trans-unit>
41+
<trans-unit id="105">
42+
<source>Please select a valid currency.</source>
43+
<target>Vui lòng chọn tiền tệ hợp lệ.</target>
44+
</trans-unit>
45+
<trans-unit id="106">
46+
<source>Please choose a valid date interval.</source>
47+
<target>Vui lòng chọn một khoảng thời gian hợp lệ.</target>
48+
</trans-unit>
49+
<trans-unit id="107">
50+
<source>Please enter a valid date and time.</source>
51+
<target>Vui lòng nhập ngày và thời gian hợp lệ.</target>
52+
</trans-unit>
53+
<trans-unit id="108">
54+
<source>Please enter a valid date.</source>
55+
<target>Vui lòng nhập ngày hợp lệ.</target>
56+
</trans-unit>
57+
<trans-unit id="109">
58+
<source>Please select a valid file.</source>
59+
<target>Vui lòng chọn tệp hợp lệ.</target>
60+
</trans-unit>
61+
<trans-unit id="110">
62+
<source>The hidden field is invalid.</source>
63+
<target>Phạm vi ẩn không hợp lệ.</target>
64+
</trans-unit>
65+
<trans-unit id="111">
66+
<source>Please enter an integer.</source>
67+
<target>Vui lòng nhập một số nguyên.</target>
68+
</trans-unit>
69+
<trans-unit id="112">
70+
<source>Please select a valid language.</source>
71+
<target>Vui lòng chọn ngôn ngữ hợp lệ.</target>
72+
</trans-unit>
73+
<trans-unit id="113">
74+
<source>Please select a valid locale.</source>
75+
<target>Vui lòng chọn miền hợp lệ.</target>
76+
</trans-unit>
77+
<trans-unit id="114">
78+
<source>Please enter a valid money amount.</source>
79+
<target>Vui lòng nhập một khoảng tiền hợp lệ.</target>
80+
</trans-unit>
81+
<trans-unit id="115">
82+
<source>Please enter a number.</source>
83+
<target>Vui lòng nhập một con số.</target>
84+
</trans-unit>
85+
<trans-unit id="116">
86+
<source>The password is invalid.</source>
87+
<target>Mật khẩu không hợp lệ.</target>
88+
</trans-unit>
89+
<trans-unit id="117">
90+
<source>Please enter a percentage value.</source>
91+
<target>Vui lòng nhập một giá trị phần trăm.</target>
92+
</trans-unit>
93+
<trans-unit id="118">
94+
<source>The values do not match.</source>
95+
<target>Các giá trị không phù hợp.</target>
96+
</trans-unit>
97+
<trans-unit id="119">
98+
<source>Please enter a valid time.</source>
99+
<target>Vui lòng nhập thời gian hợp lệ.</target>
100+
</trans-unit>
101+
<trans-unit id="120">
102+
<source>Please select a valid timezone.</source>
103+
<target>Vui lòng chọn múi giờ hợp lệ.</target>
104+
</trans-unit>
105+
<trans-unit id="121">
106+
<source>Please enter a valid URL.</source>
107+
<target>Vui lòng nhập một URL hợp lệ.</target>
108+
</trans-unit>
109+
<trans-unit id="122">
110+
<source>Please enter a valid search term.</source>
111+
<target>Vui lòng nhập chuỗi tìm kiếm hợp lệ.</target>
112+
</trans-unit>
113+
<trans-unit id="123">
114+
<source>Please provide a valid phone number.</source>
115+
<target>Vui lòng cung cấp số điện thoại hợp lệ.</target>
116+
</trans-unit>
17117
</body>
18118
</file>
19119
</xliff>

Tests/Extension/Core/Type/ChoiceTypeTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,24 @@ public function testStripLeadingUnderscoresAndDigitsFromId()
20032003
$this->assertEquals('_09name', $view->vars['full_name']);
20042004
}
20052005

2006+
public function testSubFormTranslationDomain()
2007+
{
2008+
$form = $this->factory->create(static::TESTED_TYPE, null, [
2009+
'label' => 'label',
2010+
'translation_domain' => 'label_translation_domain',
2011+
'choices' => [
2012+
'choice1' => true,
2013+
'choice2' => false,
2014+
],
2015+
'choice_translation_domain' => 'choice_translation_domain',
2016+
'expanded' => true,
2017+
])->createView();
2018+
2019+
$this->assertCount(2, $form->children);
2020+
$this->assertSame('choice_translation_domain', $form->children[0]->vars['translation_domain']);
2021+
$this->assertSame('choice_translation_domain', $form->children[1]->vars['translation_domain']);
2022+
}
2023+
20062024
/**
20072025
* @dataProvider provideTrimCases
20082026
*/

0 commit comments

Comments
 (0)