From da19749098773017118370e952c2e882301cac72 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 19 Mar 2017 11:55:36 -0400 Subject: [PATCH] Fix phraseapp and move config location --- app/Providers/PhraseAppTranslationProvider.php | 2 +- config/app.php | 2 -- config/pterodactyl.php | 12 ++++++++++++ resources/themes/pterodactyl/layouts/auth.blade.php | 2 +- .../themes/pterodactyl/layouts/master.blade.php | 5 +++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/Providers/PhraseAppTranslationProvider.php b/app/Providers/PhraseAppTranslationProvider.php index e6ba42116..840234917 100644 --- a/app/Providers/PhraseAppTranslationProvider.php +++ b/app/Providers/PhraseAppTranslationProvider.php @@ -47,7 +47,7 @@ class PhraseAppTranslationProvider extends TranslationServiceProvider // configuration so we can easily get both of these values from there. $locale = $app['config']['app.locale']; - if ($app['config']['app.phrase_in_context']) { + if ($app['config']['pterodactyl.lang.in_context']) { $trans = new PhraseAppTranslator($loader, $locale); } else { $trans = new IlluminateTranslator($loader, $locale); diff --git a/config/app.php b/config/app.php index 4721bb3d2..9dd180dda 100644 --- a/config/app.php +++ b/config/app.php @@ -6,8 +6,6 @@ return [ 'version' => env('APP_VERSION', 'canary'), - 'phrase_in_context' => env('PHRASE_IN_CONTEXT', false), - /* |-------------------------------------------------------------------------- | Application Debug Mode diff --git a/config/pterodactyl.php b/config/pterodactyl.php index 20b74fc48..ddaee443e 100644 --- a/config/pterodactyl.php +++ b/config/pterodactyl.php @@ -91,4 +91,16 @@ return [ 'cache' => 60, 'url' => 'https://cdn.pterodactyl.io/releases/latest.json', ], + + /* + |-------------------------------------------------------------------------- + | Language Editor + |-------------------------------------------------------------------------- + | + | Set `PHRASE_IN_CONTEXT` to true to enable the PhaseApp in-context editor + | on this site which allows you to translate the panel, from the panel. + */ + 'lang' => [ + 'in_context' => env('PHRASE_IN_CONTEXT', false), + ], ]; diff --git a/resources/themes/pterodactyl/layouts/auth.blade.php b/resources/themes/pterodactyl/layouts/auth.blade.php index 4bbbdddf2..15f6eb8a3 100644 --- a/resources/themes/pterodactyl/layouts/auth.blade.php +++ b/resources/themes/pterodactyl/layouts/auth.blade.php @@ -60,6 +60,6 @@ {!! Theme::js('vendor/jquery/jquery.min.js') !!} {!! Theme::js('vendor/bootstrap/bootstrap.min.js') !!} - @if(config('app.phrase_in_context')) {!! Theme::js('vendor/phraseapp/phraseapp.js') !!} @endif + @if(config('pterodactyl.lang.in_context')) {!! Theme::js('vendor/phraseapp/phraseapp.js') !!} @endif diff --git a/resources/themes/pterodactyl/layouts/master.blade.php b/resources/themes/pterodactyl/layouts/master.blade.php index acbad8883..3a204523a 100644 --- a/resources/themes/pterodactyl/layouts/master.blade.php +++ b/resources/themes/pterodactyl/layouts/master.blade.php @@ -278,8 +278,9 @@ {!! Theme::js('vendor/adminlte/app.min.js') !!} {!! Theme::js('vendor/socketio/socket.io.min.js') !!} {!! Theme::js('vendor/bootstrap-notify/bootstrap-notify.min.js') !!} - - @if(config('app.phrase_in_context')) {!! Theme::js('js/phraseapp.js') !!} @endif + @if(config('pterodactyl.lang.in_context')) + {!! Theme::js('vendor/phraseapp/phraseapp.js') !!} + @endif @show