Fix and complete tests

This commit is contained in:
Bubka
2022-03-31 08:38:35 +02:00
parent 5eee3de134
commit ee22e24cf1
34 changed files with 1179 additions and 227 deletions

View File

@ -27,11 +27,12 @@ class SetLanguage
$lang = SettingService::get('lang');
if($lang === 'browser') {
$lang = config('app.fallback_locale');
if ($request->hasHeader("Accept-Language")) {
// We only keep the primary language passed via the header.
$lang = head(explode(',', $request->header("Accept-Language")));
}
else $lang = config('app.fallback_locale');
}
// If the language is not available (or partial), strings will be translated using the fallback language.