File tree Expand file tree Collapse file tree 3 files changed +47
-1
lines changed
Potsky/LaravelLocalizationHelpers/Commands Expand file tree Collapse file tree 3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,12 @@ Use the github issue system to open a issue and ask for something.
190190
191191## Change Log
192192
193+ ### v1.2.1
194+
195+ - add ` lang_folder_path ` parameter in configuration file to configure the custom location of your lang files
196+ - check lang files in ` app/lang ` by default for Laravel 4.x
197+ - check lang files in ` app/resources/lang ` by default for Laravel 5
198+
193199### v1.2
194200
195201- support for Laravel 5 (4.3)
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ public function __construct( Repository $configRepository )
7070 $ this ->trans_methods = \Config::get ('laravel-localization-helpers::config.trans_methods ' );
7171 $ this ->folders = \Config::get ('laravel-localization-helpers::config.folders ' );
7272 $ this ->ignore_lang_files = \Config::get ('laravel-localization-helpers::config.ignore_lang_files ' );
73+ $ this ->lang_folder_path = \Config::get ('laravel-localization-helpers::config.lang_folder_path ' );
7374 $ this ->never_obsolete_keys = \Config::get ('laravel-localization-helpers::config.never_obsolete_keys ' );
7475 $ this ->editor = \Config::get ('laravel-localization-helpers::config.editor_command_line ' );
7576 parent ::__construct ();
@@ -82,7 +83,32 @@ public function __construct( Repository $configRepository )
8283 */
8384 protected function get_lang_path ()
8485 {
85- return app_path () . DIRECTORY_SEPARATOR . 'lang ' ;
86+ if ( empty ( $ this ->lang_folder_path ) ) {
87+ $ paths = array (
88+ app_path () . DIRECTORY_SEPARATOR . 'lang ' ,
89+ app_path () . DIRECTORY_SEPARATOR . 'resources ' . DIRECTORY_SEPARATOR . 'lang ' ,
90+ );
91+ foreach ( $ paths as $ path ) {
92+ if ( file_exists ( $ path ) ) {
93+ return $ path ;
94+ }
95+ }
96+
97+ $ this ->error ( "No lang folder found in these paths: " );
98+ foreach ( $ paths as $ path ) {
99+ $ this ->error ( "- " . $ path );
100+ }
101+ $ this ->line ( '' );
102+ die ();
103+ }
104+ else {
105+ if ( file_exists ( $ this ->lang_folder_path ) ) {
106+ return $ this ->lang_folder_path ;
107+ }
108+ $ this ->error ( 'No lang folder found in your custom path: " ' . $ this ->lang_folder_path . '" ' );
109+ $ this ->line ( '' );
110+ die ();
111+ }
86112 }
87113
88114 /**
Original file line number Diff line number Diff line change 3636 ),
3737
3838
39+ /*
40+ |--------------------------------------------------------------------------
41+ | Lang folder
42+ |--------------------------------------------------------------------------
43+ |
44+ | You can overwrite where is located your lang folder
45+ | If null or missing, Localization::Missing will search :
46+ | - first in app_path() . DIRECTORY_SEPARATOR . 'lang',
47+ | - then in app_path() . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'lang',
48+ |
49+ */
50+ 'lang_folder_path ' => null ,
51+
52+
3953 /*
4054 |--------------------------------------------------------------------------
4155 | Methods or functions to search for
You can’t perform that action at this time.
0 commit comments