1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Enabled translation when not logged in

Reads from the Accept-Language HTTP header.
Also fixed some encoding for ES translations.

Fixes #375
This commit is contained in:
Dan Brown
2017-04-29 16:47:41 +01:00
parent 92108d710d
commit ad4642c2c4
6 changed files with 34 additions and 4 deletions

View File

@ -46,7 +46,7 @@ class HomeController extends Controller
* @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
*/
public function getTranslations() {
$locale = trans()->getLocale();
$locale = app()->getLocale();
$cacheKey = 'GLOBAL_TRANSLATIONS_' . $locale;
if (cache()->has($cacheKey) && config('app.env') !== 'development') {
$resp = cache($cacheKey);