From a047858d6ae2239649a7cc3d4126afde68f402e3 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 27 Aug 2005 03:47:47 +0000 Subject: [PATCH] support for setting tab names of extra namespaces --- includes/SkinTemplate.php | 10 ++++++++-- includes/Title.php | 9 +++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 732d38f23a..10e25e1f4a 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -502,9 +502,15 @@ class SkinTemplate extends Skin { $classes[] = 'new'; $query = 'action=edit'; } + + $text = wfMsg( $message ); + if ( $text == "<$message>" ) { + $text = wfMsg( 'nstab-main' ); + } + return array( 'class' => implode( ' ', $classes ), - 'text' => wfMsg( $message ), + 'text' => $text, 'href' => $title->getLocalUrl( $query ) ); } @@ -858,7 +864,7 @@ class SkinTemplate extends Skin { case NS_CATEGORY_TALK: return 'nstab-category'; default: - return 'nstab-main'; + return 'nstab-' . strtolower( $this->mTitle->getNsText() ); } } diff --git a/includes/Title.php b/includes/Title.php index 090dd907c8..0b58b60476 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -554,6 +554,15 @@ class Title { * @access public */ function getNamespace() { return $this->mNamespace; } + /** + * Get the namespace text + * @return string + * @access public + */ + function getNsText() { + global $wgLang; + return $wgLang->getNsText( $this->mNamespace ); + } /** * Get the interwiki prefix (or null string) * @return string -- 2.20.1