mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 11:48:55 +00:00
Squashed commit
Always execute migration 9999 (can be used to fix things manually) Optimized meal plan navigation / date range filtering Prepared next release Pulled translations from Transifex Various code optimizations
This commit is contained in:
@@ -21,7 +21,6 @@ class LocaleMiddleware extends BaseMiddleware
|
||||
if (defined('GROCY_AUTHENTICATED') && GROCY_AUTHENTICATED)
|
||||
{
|
||||
$locale = UsersService::getInstance()->GetUserSetting(GROCY_USER_ID, 'locale');
|
||||
|
||||
if (isset($locale) && !empty($locale))
|
||||
{
|
||||
if (in_array($locale, scandir(__DIR__ . '/../localization')))
|
||||
@@ -46,7 +45,6 @@ class LocaleMiddleware extends BaseMiddleware
|
||||
arsort($prefLocales);
|
||||
|
||||
$availableLocales = scandir(__DIR__ . '/../localization');
|
||||
|
||||
foreach ($prefLocales as $locale => $q)
|
||||
{
|
||||
if (in_array($locale, $availableLocales))
|
||||
@@ -60,7 +58,7 @@ class LocaleMiddleware extends BaseMiddleware
|
||||
return substr($locale, 0, 5);
|
||||
}
|
||||
|
||||
// e.g: cs
|
||||
// e.g. cs
|
||||
if (in_array(substr($locale, 0, 2), $availableLocales))
|
||||
{
|
||||
return substr($locale, 0, 2);
|
||||
|
Reference in New Issue
Block a user