Changed placeholders

This commit is contained in:
florianv 2014-03-03 18:14:46 +01:00
parent 623d149cad
commit a04175ec9c
4 changed files with 9 additions and 9 deletions

View File

@ -29,7 +29,7 @@ abstract class FileDumper implements DumperInterface
* *
* @var string * @var string
*/ */
protected $relativePathTemplate = '{domain}.{locale}.{extension}'; protected $relativePathTemplate = '%domain%.%locale%.%extension%';
/** /**
* Sets the template for the relative paths to files. * Sets the template for the relative paths to files.
@ -95,9 +95,9 @@ abstract class FileDumper implements DumperInterface
private function getRelativePath($domain, $locale) private function getRelativePath($domain, $locale)
{ {
return strtr($this->relativePathTemplate, array( return strtr($this->relativePathTemplate, array(
'{domain}' => $domain, '%domain%' => $domain,
'{locale}' => $locale, '%locale%' => $locale,
'{extension}' => $this->getExtension() '%extension%' => $this->getExtension()
)); ));
} }
} }

View File

@ -23,7 +23,7 @@ class IcuResFileDumper extends FileDumper
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
protected $relativePathTemplate = '{domain}/{locale}.{extension}'; protected $relativePathTemplate = '%domain%/%locale%.%extension%';
/** /**
* {@inheritDoc} * {@inheritDoc}

View File

@ -46,7 +46,7 @@ class FileDumperTest extends \PHPUnit_Framework_TestCase
$catalogue->add(array('foo' => 'bar')); $catalogue->add(array('foo' => 'bar'));
$dumper = new ConcreteFileDumper(); $dumper = new ConcreteFileDumper();
$dumper->setRelativePathTemplate('test/translations/{domain}.{locale}.{extension}'); $dumper->setRelativePathTemplate('test/translations/%domain%.%locale%.%extension%');
$dumper->dump($catalogue, array('path' => $tempDir)); $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertTrue(file_exists($file)); $this->assertTrue(file_exists($file));

View File

@ -31,8 +31,8 @@ class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resourcebundle/res/en.res'), file_get_contents($tempDir.'/messages/en.res')); $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resourcebundle/res/en.res'), file_get_contents($tempDir.'/messages/en.res'));
unlink($tempDir.'/messages/en.res'); @unlink($tempDir.'/messages/en.res');
rmdir($tempDir.'/messages'); @rmdir($tempDir.'/messages');
rmdir($tempDir); @rmdir($tempDir);
} }
} }