Fix wrong dump for PO files
This commit is contained in:
parent
86210b3fa1
commit
b54abfc643
@ -40,7 +40,7 @@ class PoFileDumper extends FileDumper
|
||||
$newLine = true;
|
||||
}
|
||||
$output .= sprintf('msgid "%s"'."\n", $this->escape($source));
|
||||
$output .= sprintf('msgstr "%s"', $this->escape($target));
|
||||
$output .= sprintf('msgstr "%s"'."\n", $this->escape($target));
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
@ -20,7 +20,7 @@ class PoFileDumperTest extends TestCase
|
||||
public function testFormatCatalogue()
|
||||
{
|
||||
$catalogue = new MessageCatalogue('en');
|
||||
$catalogue->add(['foo' => 'bar']);
|
||||
$catalogue->add(['foo' => 'bar', 'bar' => 'foo']);
|
||||
|
||||
$dumper = new PoFileDumper();
|
||||
|
||||
|
@ -23,7 +23,7 @@ class PoFileLoaderTest extends TestCase
|
||||
$resource = __DIR__.'/../fixtures/resources.po';
|
||||
$catalogue = $loader->load($resource, 'en', 'domain1');
|
||||
|
||||
$this->assertEquals(['foo' => 'bar'], $catalogue->all('domain1'));
|
||||
$this->assertEquals(['foo' => 'bar', 'bar' => 'foo'], $catalogue->all('domain1'));
|
||||
$this->assertEquals('en', $catalogue->getLocale());
|
||||
$this->assertEquals([new FileResource($resource)], $catalogue->getResources());
|
||||
}
|
||||
|
@ -6,3 +6,6 @@ msgstr ""
|
||||
|
||||
msgid "foo"
|
||||
msgstr "bar"
|
||||
|
||||
msgid "bar"
|
||||
msgstr "foo"
|
||||
|
Reference in New Issue
Block a user