support installation specific translations (#1099)

This commit is contained in:
Kevin Papst
2019-09-11 23:18:35 +02:00
committed by GitHub
parent 8c503a226e
commit 7f1a206a52
12 changed files with 349 additions and 16 deletions

View File

@@ -340,11 +340,20 @@ class User extends BaseUser implements UserInterface
return $this->hasRole(static::ROLE_ADMIN);
}
public function getDisplayName(): ?string
{
if (!empty($this->getAlias())) {
return $this->getAlias();
}
return $this->getUsername();
}
/**
* @return string
*/
public function __toString()
{
return $this->getAlias() ?: $this->getUsername();
return $this->getDisplayName();
}
}