Skip to content

Commit

Permalink
feat(core): use member names instead of group names in user menu (#656)
Browse files Browse the repository at this point in the history
* Update Header.php

* Clean up and ucfirst group member name

---------

Co-authored-by: alistair3149 <alistair3149@users.noreply.github.com>
  • Loading branch information
Dringsim and alistair3149 committed Jun 5, 2023
1 parent eed8972 commit 9a0ffcc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions includes/Partials/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,20 @@ private function getUserGroupsHTML(): ?string {
}

$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
Expand Down

0 comments on commit 9a0ffcc

Please sign in to comment.