Changed placeholders
This commit is contained in:
parent
623d149cad
commit
a04175ec9c
@ -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()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class IcuResFileDumper extends FileDumper
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
protected $relativePathTemplate = '{domain}/{locale}.{extension}';
|
protected $relativePathTemplate = '%domain%/%locale%.%extension%';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -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));
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user