Skip to content

Commit

Permalink
[Translation] Fix the string casting in the XliffFileLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Aug 26, 2015
1 parent fed77a3 commit b856f62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -53,7 +53,7 @@ public function load($resource, $locale, $domain = 'messages')
}

$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
// simple_xml will always return utf-8 encoded values
Expand Down
Expand Up @@ -25,6 +25,7 @@ public function testLoad()
$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()
Expand Down

0 comments on commit b856f62

Please sign in to comment.