Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f9dc36b

Browse files
authoredMar 6, 2017
Merge pull request #91 from evilangelmd/master
Bug: Cannot process messages in Laravel 4 structure
2 parents bd651e0 + bb0b6fb commit f9dc36b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

Diff for: ‎src/Mariuzzo/LaravelJsLocalization/LaravelJsLocalizationServiceProvider.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,16 @@ public function register()
6565
{
6666
// Bind the Laravel JS Localization command into the app IOC.
6767
$this->app->singleton('localization.js', function ($app) {
68+
$app = $this->app;
69+
$laravelMajorVersion = (int) $app::VERSION;
70+
6871
$files = $app['files'];
69-
$langs = $app['path.base'].'/resources/lang';
72+
73+
if ($laravelMajorVersion === 4) {
74+
$langs = $app['path.base'].'/app/lang';
75+
} elseif ($laravelMajorVersion === 5) {
76+
$langs = $app['path.base'].'/resources/lang';
77+
}
7078
$messages = $app['config']->get('localization-js.messages');
7179
$generator = new Generators\LangJsGenerator($files, $langs, $messages);
7280

0 commit comments

Comments
 (0)