X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/919660678bec2b94eaa84ac60d0313f5ef07dfb7..refs/pull/1314/head:/app/Http/Controllers/HomeController.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index e9469fafb..5a5f34e4a 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,8 +1,7 @@ getLocale(); $cacheKey = 'GLOBAL_TRANSLATIONS_' . $locale; + if (cache()->has($cacheKey) && config('app.env') !== 'development') { $resp = cache($cacheKey); } else { @@ -90,15 +90,6 @@ class HomeController extends Controller 'entities' => trans('entities'), 'errors' => trans('errors') ]; - if ($locale !== 'en') { - $enTrans = [ - 'common' => trans('common', [], 'en'), - 'components' => trans('components', [], 'en'), - 'entities' => trans('entities', [], 'en'), - 'errors' => trans('errors', [], 'en') - ]; - $translations = array_replace_recursive($enTrans, $translations); - } $resp = 'window.translations = ' . json_encode($translations); cache()->put($cacheKey, $resp, 120); }