Merge branch '2.3' into 2.7
* 2.3: [Translation] Fix the string casting in the XliffFileLoader Conflicts: src/Symfony/Component/Translation/Loader/XliffFileLoader.php
This commit is contained in:
commit
7f4f7131dd
|
@ -55,7 +55,7 @@ class XliffFileLoader implements LoaderInterface
|
|||
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
|
||||
// If the xlf file has another encoding specified, try to convert it because
|
||||
// simple_xml will always return utf-8 encoded values
|
||||
$target = $this->utf8ToCharset((string) isset($translation->target) ? $translation->target : $source, $encoding);
|
||||
$target = $this->utf8ToCharset((string) (isset($translation->target) ? $translation->target : $source), $encoding);
|
||||
|
||||
$catalogue->set((string) $source, $target, $domain);
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals('en', $catalogue->getLocale());
|
||||
$this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
|
||||
$this->assertSame(array(), libxml_get_errors());
|
||||
$this->assertContainsOnly('string', $catalogue->all('domain1'));
|
||||
}
|
||||
|
||||
public function testLoadWithInternalErrorsEnabled()
|
||||
|
|
Reference in New Issue