I18n improvements (#1060)
* Add a default locale * Use html lang and dir attributes * Fix translations * Add pluralize forms
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user