feat(core): use member names instead of group names in user menu (#656)

* Update Header.php

* Clean up and ucfirst group member name

---------

Co-authored-by: alistair3149 <alistair3149@users.noreply.github.com>
This commit is contained in:
沈澄心 2023-06-06 01:30:57 +08:00 committed by GitHub
parent eed8972d2b
commit 9a0ffcc186
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,16 +111,20 @@ final class Header extends Partial {
}
$html = '';
$msgName = 'group-%s';
$msgName = 'group-%s-member';
// There must be a cleaner way
foreach ( $groups as $group ) {
$id = sprintf( $msgName, $group );
$msg = $this->skin->msg( $id )->text();
$title = $this->title->newFromText(
$this->skin->msg( sprintf( $msgName, $group ) )->text(),
$msg,
NS_PROJECT
);
if ( $msg ) {
// Member names are in lowercase
$msg = ucfirst( $msg );
}
if ( $title ) {
$href = $title->getLinkURL();
$html .= <<< HTML