I18n improvements (#1060)

* Add a default locale
* Use html lang and dir attributes
* Fix translations
* Add pluralize forms
This commit is contained in:
Alexis Saettler
2018-03-26 22:00:36 +02:00
committed by GitHub
parent 7f07c1baa2
commit 006ce9ad3e
69 changed files with 4227 additions and 3927 deletions
@@ -55,9 +55,23 @@ class SettingsController extends Controller
public function index()
{
return view('settings.index')
->withLocales($this->getLocaleList())
->withHours(\App\Helpers\DateHelper::getListOfHours());
}
private function getLocaleList()
{
$locales = collect([]);
foreach (config('lang-detector.languages') as $lang) {
$locales->push([
'lang' => $lang,
'name' => trans('settings.locale_'.$lang),
]);
}
return $locales->sortBy('name');
}
/**
* Save user settings.
*