r102856 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102855‎ | r102856 | r102857 >
Date:11:31, 12 November 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
[RL2] Make LocalGadgetRepo::getCategoryTitle() take a Language object too
Modified paths:
  • /branches/RL2/extensions/Gadgets/backend/LocalGadgetRepo.php (modified) (history)

Diff [purge]

Index: branches/RL2/extensions/Gadgets/backend/LocalGadgetRepo.php
@@ -165,7 +165,7 @@
166166 * If it doesn't exist, ucfirst( $category ) is returned.
167167 *
168168 * @param $category string Category ID
169 - * @param $lang string Language code. If null, $wgLang is used
 169+ * @param $lang string\Language|null Language code or Language object. If null, $wgLang is used
170170 * @return string Localized category title
171171 */
172172 public function getCategoryTitle( $category, $lang = null ) {
@@ -175,7 +175,7 @@
176176 }
177177 if ( !$msg->exists() ) {
178178 global $wgLang;
179 - $langObj = $lang === null ? $wgLang : Language::factory( $lang );
 179+ $langObj = $lang === null ? $wgLang : ( is_string( $lang ) ? Language::factory( $lang ) : $lang );
180180 return $langObj->ucfirst( $category );
181181 }
182182 return $msg->plain();

Comments

#Comment by Krinkle (talk | contribs)   00:57, 28 November 2011

Used by GadgetHooks::preferencesGetLegend

Status & tagging log