Index: trunk/extensions/Babel/BabelAutoCreate.class.php |
— | — | @@ -23,19 +23,21 @@ |
24 | 24 | * Create category. |
25 | 25 | * |
26 | 26 | * @param $category String: Name of category to create. |
27 | | - * @param $language String: Name of language that the category is for. |
| 27 | + * @param $language String: Code of language that the category is for. |
28 | 28 | * @param $level String: Level that the category is for. |
29 | 29 | */ |
30 | | - public static function create( $category, $language, $level = null ) { |
| 30 | + public static function create( $category, $code, $level = null ) { |
31 | 31 | $category = strip_tags( $category ); |
32 | 32 | $title = Title::makeTitleSafe( NS_CATEGORY, $category ); |
33 | 33 | if ( $title === null || $title->exists() ) { |
34 | 34 | return; |
35 | 35 | } |
| 36 | + global $wgLanguageCode; |
| 37 | + $language = BabelLanguageCodes::getName( $code, $wgLanguageCode ); |
36 | 38 | if ( $level === null ) { |
37 | | - $text = wfMsgForContent( 'babel-autocreate-text-main', $language ); |
| 39 | + $text = wfMsgForContent( 'babel-autocreate-text-main', $language, $code ); |
38 | 40 | } else { |
39 | | - $text = wfMsgForContent( 'babel-autocreate-text-levels', $level, $language ); |
| 41 | + $text = wfMsgForContent( 'babel-autocreate-text-levels', $level, $language, $code ); |
40 | 42 | } |
41 | 43 | $article = new Article( $title, 0 ); |
42 | 44 | |
Index: trunk/extensions/Babel/Babel.class.php |
— | — | @@ -280,20 +280,20 @@ |
281 | 281 | * @return String: Wikitext to add categories. |
282 | 282 | */ |
283 | 283 | protected static function mGenerateCategories( $code, $level ) { |
284 | | - global $wgBabelMainCategory, $wgBabelCategoryNames, $wgLanguageCode; |
| 284 | + global $wgBabelMainCategory, $wgBabelCategoryNames; |
285 | 285 | |
286 | 286 | $r = ''; |
287 | 287 | |
288 | 288 | if ( $wgBabelMainCategory !== false && $wgBabelCategoryNames[$level] !== false ) { |
289 | 289 | $category = self::mReplaceCategoryVariables( $wgBabelMainCategory, $code ); |
290 | 290 | $r .= "[[Category:$category|$level]]"; |
291 | | - BabelAutoCreate::create( $category, BabelLanguageCodes::getName( $code, $wgLanguageCode ) ); |
| 291 | + BabelAutoCreate::create( $category, $code ); |
292 | 292 | } |
293 | 293 | |
294 | 294 | if ( $wgBabelCategoryNames[$level] !== false ) { |
295 | 295 | $category = self::mReplaceCategoryVariables( $wgBabelCategoryNames[$level], $code ); |
296 | 296 | $r .= "[[Category:$category]]"; |
297 | | - BabelAutoCreate::create( $category, BabelLanguageCodes::getName( $code, $wgLanguageCode ), $level ); |
| 297 | + BabelAutoCreate::create( $category, $code, $level ); |
298 | 298 | } |
299 | 299 | |
300 | 300 | return $r; |