7
7
use Symfony \Component \HttpClient \MockHttpClient ;
8
8
use Symfony \Component \Translation \Bridge \Loco \Provider \LocoProvider ;
9
9
use Symfony \Component \Translation \Loader \ArrayLoader ;
10
- use Symfony \Component \Translation \Loader \XliffRawLoader ;
10
+ use Symfony \Component \Translation \Loader \XliffFileLoader ;
11
11
use Symfony \Component \Translation \MessageCatalogue ;
12
12
use Symfony \Component \Translation \TranslatorBag ;
13
13
use Symfony \Contracts \HttpClient \ResponseInterface ;
@@ -184,7 +184,7 @@ public function testCompleteWriteProcess()
184
184
'validators ' => ['post.num_comments ' => '{count, plural, one {# commentaire} other {# commentaires}} ' ],
185
185
]));
186
186
187
- $ locoProvider = new LocoProvider ('API_KEY ' , new MockHttpClient ($ responses ), new XliffRawLoader (), $ this ->createMock (LoggerInterface::class), 'en ' );
187
+ $ locoProvider = new LocoProvider ('API_KEY ' , new MockHttpClient ($ responses ), new XliffFileLoader (), $ this ->createMock (LoggerInterface::class), 'en ' );
188
188
$ locoProvider ->write ($ translatorBag );
189
189
}
190
190
@@ -209,7 +209,7 @@ public function testReadForOneLocaleAndOneDomain(string $locale, string $domain,
209
209
return $ response ;
210
210
});
211
211
212
- $ locoProvider = new LocoProvider ('API_KEY ' , $ httpClient , new XliffRawLoader (), $ this ->createMock (LoggerInterface::class), 'en ' );
212
+ $ locoProvider = new LocoProvider ('API_KEY ' , $ httpClient , new XliffFileLoader (), $ this ->createMock (LoggerInterface::class), 'en ' );
213
213
$ translatorBag = $ locoProvider ->read ([$ domain ], [$ locale ]);
214
214
215
215
$ arrayLoader = new ArrayLoader ();
@@ -243,7 +243,7 @@ public function testReadForManyLocalesAndManyDomains(array $locales, array $doma
243
243
return $ response ;
244
244
});
245
245
246
- $ locoProvider = new LocoProvider ('API_KEY ' , $ httpClient , new XliffRawLoader (), $ this ->createMock (LoggerInterface::class), 'en ' );
246
+ $ locoProvider = new LocoProvider ('API_KEY ' , $ httpClient , new XliffFileLoader (), $ this ->createMock (LoggerInterface::class), 'en ' );
247
247
$ translatorBag = $ locoProvider ->read ($ domains , [$ locale ]);
248
248
249
249
$ arrayLoader = new ArrayLoader ();
@@ -276,19 +276,10 @@ public function getProviderData(): \Generator
276
276
277
277
public function getLocoResponsesForOneLocaleAndOneDomain (): \Generator
278
278
{
279
- yield ['en ' , 'messages ' , <<&
10000
lt;XLIFF
279
+ yield ['en ' , 'messages ' , <<<' XLIFF'
280
280
<?xml version="1.0" encoding="UTF-8"?>
281
- <!--
282
- Loco xml export: XLIFF 1.2
283
- Project: symfony-translation-provider
284
- Release: Working copy
285
- Locale: en, English
286
- Tagged: messages
287
- Exported by: Firstname Lastname
288
- Exported at: Tue, 15 Dec 2020 17:10:28 +0100
289
- -->
290
281
<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">
291
- <file original="https://localise.biz/welcomattic /symfony-translation-provider" source-language="en" datatype="database" tool-id="loco">
282
+ <file original="https://localise.biz/user /symfony-translation-provider" source-language="en" datatype="database" tool-id="loco">
292
283
<header>
293
284
<tool tool-id="loco" tool-name="Loco" tool-version="1.0.25 20201211-1" tool-company="Loco"/>
294
285
</header>
@@ -304,26 +295,18 @@ public function getLocoResponsesForOneLocaleAndOneDomain(): \Generator
304
295
</body>
305
296
</file>
306
297
</xliff>
298
+
307
299
XLIFF,
308
300
[
309
301
'index.hello ' => 'Hello ' ,
310
302
'index.greetings ' => 'Welcome, {firstname}! ' ,
311
303
],
312
304
];
313
305
314
- yield ['fr ' , 'messages ' , <<<XLIFF
306
+ yield ['fr ' , 'messages ' , <<<' XLIFF'
315
307
<?xml version="1.0" encoding="UTF-8"?>
316
- <!--
317
- Loco xml export: XLIFF 1.2
318
- Project: symfony-translation-provider
319
- Release: Working copy
320
- Locale: fr, French
321
- Tagged: messages
322
- Exported by: Firstname Lastname
323
- Exported at: Tue, 15 Dec 2020 17:10:28 +0100
324
- -->
325
308
<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">
326
- <file original="https://localise.biz/welcomattic /symfony-translation-provider" source-language="en" datatype="database" tool-id="loco">
309
+ <file original="https://localise.biz/user /symfony-translation-provider" source-language="en" datatype="database" tool-id="loco">
327
310
<header>
328
311
<tool tool-id="loco" tool-name="Loco" tool-version="1.0.25 20201211-1" tool-company="Loco"/>
329
312
</header>
@@ -339,6 +322,7 @@ public function getLocoResponsesForOneLocaleAndOneDomain(): \Generator
339
322
</body>
340
323
</file>
341
324
</xliff>
325
+
342
326
XLIFF,
343
327
[
344
328
'index.hello ' => 'Bonjour ' ,
@@ -353,19 +337,10 @@ public function getLocoResponsesForManyLocalesAndManyDomains(): \Generator
353
337
['en ' , 'fr ' ],
354
338
['messages ' , 'validators ' ],
355
339
[
356
- 'en ' => <<<XLIFF
340
+ 'en ' => <<<' XLIFF'
357
341
<?xml version="1.0" encoding="UTF-8"?>
358
- <!--
359
- Loco xml export: XLIFF 1.2
360
- Project: symfony-translation-provider
361
- Release: Working copy
362
- Locale: en, English
363
- Tagged: messages
364
- Exported by: Firstname Lastname
365
- Exported at: Tue, 15 Dec 2020 17:10:28 +0100
366
- -->
367
342
<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">
368
- <file original="https://localise.biz/welcomattic /symfony-translation-provider" source-language="en" datatype="database" tool-id="loco">
343
+ <file original="https://localise.biz/user /symfony-translation-provider" source-language="en" datatype="database" tool-id="loco">
369
344
<header>
370
345
<tool tool-id="loco" tool-name="Loco" tool-version="1.0.25 20201211-1" tool-company="Loco"/>
371
346
</header>
@@ -381,20 +356,12 @@ public function getLocoResponsesForManyLocalesAndManyDomains(): \Generator
381
356
</body>
382
357
</file>
383
358
</xliff>
359
+
384
360
XLIFF,
385
- 'fr ' => <<<XLIFF
361
+ 'fr ' => <<<' XLIFF'
386
362
<?xml version="1.0" encoding="UTF-8"?>
387
- <!--
388
- Loco xml export: XLIFF 1.2
389
- Project: symfony-translation-provider
390
- Release: Working copy
391
- Locale: fr, French
392
- Tagged: messages
393
- Exported by: Firstname Lastname
394
- Exported at: Tue, 15 Dec 2020 17:10:28 +0100
395
- -->
396
363
<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">
397
- <file original="https://localise.biz/welcomattic /symfony-translation-provider" source-language="en" datatype="database" tool-id="loco">
364
+ <file original="https://localise.biz/user /symfony-translation-provider" source-language="en" datatype="database" tool-id="loco">
398
365
<header>
399
366
<tool tool-id="loco" tool-name="Loco" tool-version="1.0.25 20201211-1" tool-company="Loco"/>
400
367
</header>
@@ -410,6 +377,7 @@ public function getLocoResponsesForManyLocalesAndManyDomains(): \Generator
410
377
</body>
411
378
</file>
412
379
</xliff>
380
+
413
381
XLIFF,
414
382
],
415
383
[
0 commit comments