Skip to content

Commit 4798ba5

Browse files
Merge branch '6.4' into 7.3
* 6.4: [DebugBundle] Wire `DumpDataCollector`'s `webMode` argument filter should be empty when filtering on all domains
2 parents c1e91c5 + d13b9ae commit 4798ba5

File tree

3 files changed

+38
-17
lines changed

3 files changed

+38
-17
lines changed

src/Symfony/Bundle/DebugBundle/Resources/config/services.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
param('kernel.charset'),
5353
service('.virtual_request_stack'),
5454
null, // var_dumper.cli_dumper or var_dumper.server_connection when debug.dump_destination is set
55+
param('kernel.runtime_mode.web'),
5556
])
5657
->tag('data_collector', [
5758
'id' => 'dump',

src/Symfony/Component/Translation/Bridge/Loco/LocoProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function read(array $domains, array $locales): TranslatorBag
100100
// Loco forbids concurrent requests, so the requests must be synchronous in order to prevent "429 Too Many Requests" errors.
101101
$response = $this->client->request('GET', \sprintf('export/locale/%s.xlf', rawurlencode($locale)), [
102102
'query' => [
103-
'filter' => $domain,
103+
'filter' => '*' !== $domain ? $domain : '',
104104
'status' => $this->restrictToStatus ?? 'translated,blank-translation',
105105
],
106106
'headers' => [

src/Symfony/Component/Translation/Bridge/Loco/Tests/LocoProviderTest.php

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -967,8 +967,7 @@ public static function getResponsesForOneLocaleAndOneDomain(): \Generator
967967
</body>
968968
</file>
969969
</xliff>
970-
XLIFF
971-
,
970+
XLIFF,
972971
$expectedTranslatorBagEn,
973972
];
974973

@@ -997,8 +996,7 @@ public static function getResponsesForOneLocaleAndOneDomain(): \Generator
997996
</body>
998997
</file>
999998
</xliff>
1000-
XLIFF
1001-
,
999+
XLIFF,
10021000
$expectedTranslatorBagFr,
10031001
];
10041002
}
@@ -1049,8 +1047,7 @@ public static function getResponsesForManyLocalesAndManyDomains(): \Generator
10491047
</body>
10501048
</file>
10511049
</xliff>
1052-
XLIFF
1053-
,
1050+
XLIFF,
10541051
'messages+intl-icu' => <<<'XLIFF'
10551052
<?xml version="1.0" encoding="UTF-8"?>
10561053
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd">
@@ -1066,8 +1063,7 @@ public static function getResponsesForManyLocalesAndManyDomains(): \Generator
10661063
</body>
10671064
</file>
10681065
</xliff>
1069-
XLIFF
1070-
,
1066+
XLIFF,
10711067
'validators' => <<<'XLIFF'
10721068
<?xml version="1.0" encoding="UTF-8"?>
10731069
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd">
@@ -1087,8 +1083,7 @@ public static function getResponsesForManyLocalesAndManyDomains(): \Generator
10871083
</body>
10881084
</file>
10891085
</xliff>
1090-
XLIFF
1091-
,
1086+
XLIFF,
10921087
],
10931088
'fr' => [
10941089
'messages' => <<<'XLIFF'
@@ -1106,8 +1101,7 @@ public static function getResponsesForManyLocalesAndManyDomains(): \Generator
11061101
</body>
11071102
</file>
11081103
</xliff>
1109-
XLIFF
1110-
,
1104+
XLIFF,
11111105
'messages+intl-icu' => <<<'XLIFF'
11121106
<?xml version="1.0" encoding="UTF-8"?>
11131107
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd">
@@ -1123,8 +1117,7 @@ public static function getResponsesForManyLocalesAndManyDomains(): \Generator
11231117
</body>
11241118
</file>
11251119
</xliff>
1126-
XLIFF
1127-
,
1120+
XLIFF,
11281121
'validators' => <<<'XLIFF'
11291122
<?xml version="1.0" encoding="UTF-8"?>
11301123
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd">
@@ -1144,8 +1137,7 @@ public static function getResponsesForManyLocalesAndManyDomains(): \Generator
11441137
</body>
11451138
</file>
11461139
</xliff>
1147-
XLIFF
1148-
,
1140+
XLIFF,
11491141
],
11501142
],
11511143
$expectedTranslatorBag,
@@ -1171,6 +1163,34 @@ public static function getResponsesForReadWithLastModified(): \Generator
11711163
}
11721164
}
11731165

1166+
public function testReadForAllDomains()
1167+
{
1168+
$loader = $this->getLoader();
1169+
1170+
$loader
1171+
->expects($this->once())
1172+
->method('load')
1173+
->willReturn($this->createMock(MessageCatalogue::class));
1174+
1175+
$provider = self::createProvider(
1176+
new MockHttpClient([
1177+
function (string $method, string $url, array $options = []): ResponseInterface {
1178+
$this->assertSame('GET', $method);
1179+
$this->assertSame('https://localise.biz/api/export/locale/fr.xlf?filter=&status=translated%2Cblank-translation', $url);
1180+
$this->assertSame(['filter' => '', 'status' => 'translated,blank-translation'], $options['query']);
1181+
1182+
return new MockResponse();
1183+
},
1184+
], 'https://localise.biz/api/'),
1185+
$this->getLoader(),
1186+
$this->getLogger(),
1187+
$this->getDefaultLocale(),
1188+
'localise.biz/api/',
1189+
);
1190+
1191+
$this->translatorBag = $provider->read(['*'], ['fr']);
1192+
}
1193+
11741194
public function testReadWithRestrictToStatus()
11751195
{
11761196
$loader = $this->getLoader();

0 commit comments

Comments
 (0)