mirror of
https://github.com/grocy/grocy.git
synced 2025-09-29 19:12:24 +00:00
Locales: use http-accept-language or cookie (#976)
* Locales: use http-accept-language or "language"-cookie * Add user-setting "locale" Rename CULTURE to DEFAULT_LOCALE * Use LocaleMiddleware also in dev mode * CORS: don't require authentication on OPTIONS * Use a standard user-settings-control and start a new generic user settings page, not a separate page for the locale setting * Fixed (broken by myself) link-return handling * Clarify language settings * Removed unneeded files * Better user settings icon * Added localization hints Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
committed by
GitHub
parent
4a030b7ffc
commit
6f8ad9b76e
@@ -110,7 +110,7 @@ class BaseController
|
||||
|
||||
protected function getLocalizationService()
|
||||
{
|
||||
return LocalizationService::getInstance(GROCY_CULTURE);
|
||||
return LocalizationService::getInstance(GROCY_LOCALE);
|
||||
}
|
||||
|
||||
protected function getApplicationservice()
|
||||
|
@@ -44,4 +44,16 @@ class UsersController extends BaseController
|
||||
->where('parent IS NULL')->where('user_id', $args['userId']),
|
||||
]);
|
||||
}
|
||||
|
||||
public function UserSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'usersettings', [
|
||||
'languages' => array_filter(scandir(__DIR__.'/../localization'), function ($item){
|
||||
if($item == "." || $item == "..")
|
||||
return false;
|
||||
return is_dir(__DIR__.'/../localization/'.$item);
|
||||
})
|
||||
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user