Skip to content

Commit

Permalink
Ability to modify names of the translation helper methods in the conf…
Browse files Browse the repository at this point in the history
…ig file.
  • Loading branch information
subotkevic committed Oct 17, 2018
1 parent 3967d58 commit 259fb95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Command/TranslationHelperCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ private function getTranslationKeysFromDir(&$keys, $dirPath, $fileExt = 'php')
foreach ($files as $file) {
$content = $this->getSanitizedContent($file);

$this->getTranslationKeysFromFunction($keys, 'lang', $content);
$this->getTranslationKeysFromFunction($keys, '__', $content);
foreach (config('translation-helper.translation_methods') as $translationMethod) {
$this->getTranslationKeysFromFunction($keys, $translationMethod, $content);
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/config/translation-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@
* Directory where your JSON translation files are located.
*/
'output_directory' => resource_path('lang'),

/**
* Translation helper methods to scan
* for in your application's code.
*/
'translation_methods' => [
'lang',
'__',
],
];

0 comments on commit 259fb95

Please sign in to comment.