Localize the group names
authorRaimond Spekking <raymond@users.mediawiki.org>
Tue, 15 Apr 2008 12:54:07 +0000 (12:54 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Tue, 15 Apr 2008 12:54:07 +0000 (12:54 +0000)
includes/SpecialListgrouprights.php

index 842b6a5..b3a4a05 100644 (file)
@@ -38,11 +38,19 @@ class SpecialListGroupRights extends SpecialPage {
                );
 
                foreach( $wgGroupPermissions as $group => $permissions ) {
-                       $groupname = htmlspecialchars( $group );
+                       $groupname = ( $group == '*' ) ? 'all' : htmlspecialchars( $group ); // Replace * with a more descriptive groupname
+
+                       $msg = wfMsg( 'group-' . $groupname );
+                       if ( wfEmptyMsg( 'group-' . $groupname, $msg ) || $msg == '' ) {
+                               $groupnameLocalized = $groupname;
+                       } else {
+                               $groupnameLocalized = $msg;
+                       }
+
                        if ( in_array( $group, $wgImplicitGroups ) )
-                               $grouplink = $groupname;
+                               $grouplink = $groupnameLocalized;
                        else
-                               $grouplink = $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Listusers' ), $groupname, 'group=' . $group );
+                               $grouplink = $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Listusers' ), $groupnameLocalized, 'group=' . $group );
 
                        $wgOut->addHTML(
                                '<tr>