Skip to content

Commit

Permalink
Update default ignored folders. Update search path. Merge config from…
Browse files Browse the repository at this point in the history
… base file.
  • Loading branch information
PhiloNL committed Feb 2, 2015
1 parent fc1f534 commit 62fa20c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Philo/Translate/TranslateManager.php
Expand Up @@ -153,7 +153,7 @@ public function getTranslationVariables($line)
*/
public function findLineCount($group, $line)
{
return App::make('Finder')->files()->name('*.php')->in(app_path())->exclude($this->getIgnoredFolders())->contains("$group.$line")->count();
return App::make('Finder')->files()->name('*.php')->in(base_path())->exclude($this->getIgnoredFolders())->contains("$group.$line")->count();
}

/**
Expand Down Expand Up @@ -328,7 +328,7 @@ protected function getLanguagePath()
*/
protected function getIgnoredFiles()
{
return Config::get('translate::search_exclude_files');
return Config::get('translate.search_exclude_files');
}

/**
Expand All @@ -337,7 +337,7 @@ protected function getIgnoredFiles()
*/
protected function getIgnoredFolders()
{
return Config::get('translate::search_ignore_folders');
return Config::get('translate.search_ignore_folders');
}

/**
Expand All @@ -346,7 +346,7 @@ protected function getIgnoredFolders()
*/
protected function getDiggFolders()
{
return Config::get('translate::digg_folders');
return Config::get('translate.digg_folders');
}

}
4 changes: 4 additions & 0 deletions src/Philo/Translate/TranslateServiceProvider.php
Expand Up @@ -22,6 +22,10 @@ public function boot()
__DIR__.'/config.php' => config_path('translate.php'),
]);

$this->mergeConfigFrom(
__DIR__.'/config.php', 'translate'
);

$this->app->bind('Finder', function($app)
{
return new \Symfony\Component\Finder\Finder();
Expand Down
4 changes: 2 additions & 2 deletions src/Philo/Translate/config.php
@@ -1,7 +1,7 @@
<?php

return array(
'search_ignore_folders' => array('commands', 'config', 'database', 'lang', 'start', 'storage', 'tests'),
'search_exclude_files' => array('pagination', 'reminders', 'validation'),
'search_ignore_folders' => array('bootstrap', 'config', 'database', 'public', 'storage', 'tests', 'vendor'),
'search_exclude_files' => array('pagination', 'passwords', 'validation'),
'digg_folders' => array('app/models', 'app/views', 'app/controllers'),
);

0 comments on commit 62fa20c

Please sign in to comment.