Allow __transNames to be empty

This commit is contained in:
celestora 2022-11-14 16:47:34 +02:00 committed by GitHub
parent 3c632f3910
commit 55ec291650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,8 @@ class User extends RowModel
function getFirstName(bool $pristine = false): string
{
$name = ($this->isDeleted() && !$this->isDeactivated() ? "DELETED" : mb_convert_case($this->getRecord()->first_name, MB_CASE_TITLE));
if((($ts = tr("__transNames")) !== "@__transNames") && !$pristine)
$tsn = tr("__transNames");
if(( $tsn !== "@__transNames" && !empty($tsn) ) && !$pristine)
return mb_convert_case(transliterator_transliterate($ts, $name), MB_CASE_TITLE);
else
return $name;
@ -157,7 +158,8 @@ class User extends RowModel
function getLastName(bool $pristine = false): string
{
$name = ($this->isDeleted() && !$this->isDeactivated() ? "DELETED" : mb_convert_case($this->getRecord()->last_name, MB_CASE_TITLE));
if((($ts = tr("__transNames")) !== "@__transNames") && !$pristine)
$tsn = tr("__transNames");
if(( $tsn !== "@__transNames" && !empty($tsn) ) && !$pristine)
return mb_convert_case(transliterator_transliterate($ts, $name), MB_CASE_TITLE);
else
return $name;