Index: branches/RL2/extensions/Gadgets/backend/LocalGadgetRepo.php |
— | — | @@ -165,7 +165,7 @@ |
166 | 166 | * If it doesn't exist, ucfirst( $category ) is returned. |
167 | 167 | * |
168 | 168 | * @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 |
170 | 170 | * @return string Localized category title |
171 | 171 | */ |
172 | 172 | public function getCategoryTitle( $category, $lang = null ) { |
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | } |
177 | 177 | if ( !$msg->exists() ) { |
178 | 178 | global $wgLang; |
179 | | - $langObj = $lang === null ? $wgLang : Language::factory( $lang ); |
| 179 | + $langObj = $lang === null ? $wgLang : ( is_string( $lang ) ? Language::factory( $lang ) : $lang ); |
180 | 180 | return $langObj->ucfirst( $category ); |
181 | 181 | } |
182 | 182 | return $msg->plain(); |