From b7f816feeeb18957bd76eefb8a37fd74500dd150 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 9 Nov 2023 10:49:32 +0200 Subject: [PATCH] language proxy --- .../Core/Authentication/Authentication.php | 5 +- .../Core/Utils/Language/LanguageProxy.php | 55 +++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 application/Espo/Core/Utils/Language/LanguageProxy.php diff --git a/application/Espo/Core/Authentication/Authentication.php b/application/Espo/Core/Authentication/Authentication.php index eccda910bd..94ba6062eb 100644 --- a/application/Espo/Core/Authentication/Authentication.php +++ b/application/Espo/Core/Authentication/Authentication.php @@ -29,10 +29,9 @@ namespace Espo\Core\Authentication; - use Espo\Core\Exceptions\Forbidden; use Espo\Core\Exceptions\NotFound; -use Espo\Core\Utils\Language; +use Espo\Core\Utils\Language\LanguageProxy; use Espo\Repositories\UserData as UserDataRepository; use Espo\Entities\Portal; use Espo\Entities\User; @@ -89,7 +88,7 @@ class Authentication private LogoutFactory $logoutFactory, private MethodProvider $methodProvider, private Util $util, - private Language $language + private LanguageProxy $language ) {} /** diff --git a/application/Espo/Core/Utils/Language/LanguageProxy.php b/application/Espo/Core/Utils/Language/LanguageProxy.php new file mode 100644 index 0000000000..9861f8d125 --- /dev/null +++ b/application/Espo/Core/Utils/Language/LanguageProxy.php @@ -0,0 +1,55 @@ +container + ->getByClass(Language::class) + ->translateLabel($label, $category, $scope); + } +}