1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-09 10:22:51 +03:00

Locales: More use of locale objects, Addressed failing tests

This commit is contained in:
Dan Brown
2023-09-17 16:20:21 +01:00
parent ac9a65945f
commit 8994c1b9d9
17 changed files with 92 additions and 66 deletions

View File

@@ -12,6 +12,7 @@ use BookStack\Api\ApiToken;
use BookStack\App\Model;
use BookStack\App\Sluggable;
use BookStack\Entities\Tools\SlugGenerator;
use BookStack\Translation\LocaleDefinition;
use BookStack\Translation\LocaleManager;
use BookStack\Uploads\Image;
use Carbon\Carbon;
@@ -342,11 +343,11 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
}
/**
* Get the system language for this user.
* Get the locale for this user.
*/
public function getLanguage(): string
public function getLocale(): LocaleDefinition
{
return app()->make(LocaleManager::class)->getForUser($this)->appLocale();
return app()->make(LocaleManager::class)->getForUser($this);
}
/**