[Translation] Fix the string casting in the XliffFileLoader
This commit is contained in:
parent
fed77a3d80
commit
b856f62cd4
|
@ -53,7 +53,7 @@ class XliffFileLoader implements LoaderInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
|
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
|
||||||
$target = (string) isset($translation->target) ? $translation->target : $source;
|
$target = (string) (isset($translation->target) ? $translation->target : $source);
|
||||||
|
|
||||||
// If the xlf file has another encoding specified, try to convert it because
|
// If the xlf file has another encoding specified, try to convert it because
|
||||||
// simple_xml will always return utf-8 encoded values
|
// simple_xml will always return utf-8 encoded values
|
||||||
|
|
|
@ -25,6 +25,7 @@ class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->assertEquals('en', $catalogue->getLocale());
|
$this->assertEquals('en', $catalogue->getLocale());
|
||||||
$this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
|
$this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
|
||||||
$this->assertSame(array(), libxml_get_errors());
|
$this->assertSame(array(), libxml_get_errors());
|
||||||
|
$this->assertContainsOnly('string', $catalogue->all('domain1'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLoadWithInternalErrorsEnabled()
|
public function testLoadWithInternalErrorsEnabled()
|
||||||
|
|
Reference in New Issue