Skip to content

Commit

Permalink
fixes some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
schmittjoh committed Sep 19, 2011
1 parent ac765fc commit 7a20b89
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@

/**
* TranslationLoader loads translation messages from translation files.
*
*
* @author Michel Salib <[email protected]>
*/
class TranslationLoader
{
/**
* Loaders used for import.
*
*
* @var array
*/
private $loaders = array();

/**
* Adds a loader to the translation extractor.
* @param string $format The format of the loader
* @param LoaderInterface $loader
* @param LoaderInterface $loader
*/
public function addLoader($format, LoaderInterface $loader)
{
$this->loaders[$format] = $loader;
}

/**
* Loads translation messages from a directory to the catalogue.
*
*
* @param string $directory the directory to look into
* @param MessageCatalogue $catalogue the catalogue
*/
Expand All @@ -50,10 +50,10 @@ public function loadMessages($directory, MessageCatalogue $catalogue)
foreach($this->loaders as $format => $loader) {
// load any existing translation files
$finder = new Finder();
$files = $finder->files()->name('*.'.$catalogue->getLocale().$format)->in($directory);
$files = $finder->files()->name('*.'.$catalogue->getLocale().'.'.$format)->in($directory);
foreach ($files as $file) {
$domain = substr($file->getFileName(), 0, strrpos($file->getFileName(), $input->getArgument('locale').$format) - 1);
$catalogue->addCatalogue($loader->load($file->getPathname(), $input->getArgument('locale'), $domain));
$domain = substr($file->getFileName(), 0, strrpos($file->getFileName(), $catalogue->getLocale().$format) - 1);
$catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain));
}
}
}
Expand Down

0 comments on commit 7a20b89

Please sign in to comment.