r80891 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80890‎ | r80891 | r80892 >
Date:18:30, 24 January 2011
Author:roberthl
Status:ok
Tags:
Comment:
Babel:
- Define possible ability levels in configuration, rather than as logic.
- Removed $wgBabelUseLevelZeroCategory, $wgBabelUseSimpleCategories, and $wgBabelUseMainCategories - their functionality is now implemented via $wgBabelCategoryNames $wgBabelMainCategory, and $wgBabelDefaultLevel.
- Various code quality improvements.
Translate:
- Update message definitions for Babel extension.
Modified paths:
  • /trunk/extensions/Babel/Babel.class.php (modified) (history)
  • /trunk/extensions/Babel/Babel.i18n.magic.php (modified) (history)
  • /trunk/extensions/Babel/Babel.i18n.php (modified) (history)
  • /trunk/extensions/Babel/Babel.php (modified) (history)
  • /trunk/extensions/Babel/BabelAutoCreate.class.php (modified) (history)
  • /trunk/extensions/Babel/BabelLanguageCodes.class.php (modified) (history)
  • /trunk/extensions/Babel/BabelStatic.class.php (modified) (history)
  • /trunk/extensions/Translate/groups/mediawiki-defines.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/Babel/Babel.class.php
@@ -6,78 +6,72 @@
77 * @ingroup Extensions
88 */
99 class Babel {
 10+ static $title;
 11+
1012 /**
1113 * Render the Babel tower.
1214 *
1315 * @param $parser Object: Parser.
1416 * @return string: Babel tower.
1517 */
16 - public function Render( $parser ) {
 18+ public static function Render( $parser ) {
1719 $parameters = func_get_args();
1820 array_shift( $parameters );
 21+ self::$title = $parser->getTitle();
1922
20 - $this->mTemplateLinkBatch( $parameters );
 23+ self::mTemplateLinkBatch( $parameters );
2124
22 - $contents = '';
 25+ $content = '';
2326 foreach ( $parameters as $name ) {
 27+ $components = self::mParseParameter( $name );
 28+ $template = wfMsgForContent( 'babel-template', $name );
2429 if ( $name === '' ) {
2530 continue;
26 - } elseif ( $this->mTemplateExists( $name ) ) {
27 - $contents .= $parser->replaceVariables( "{{{$this->mAddFixes( $name,'template' )}}}" );
28 - } elseif ( $chunks = $this->mParseParameter( $name ) ) {
29 - $contents .= $this->mGenerateBox( $chunks['code'], $chunks['level'] );
30 - $contents .= $this->mGenerateCategories( $chunks['code'], $chunks['level'] );
31 - } elseif ( $this->mValidTitle( $name ) ) {
 31+ } elseif ( self::mPageExists( $template ) ) {
 32+ $content .= $parser->replaceVariables( "{{{$template}}}" );
 33+ } elseif ( $components !== false ) {
 34+ $content .= self::mGenerateBox( $components['code'], $components['level'] );
 35+ $content .= self::mGenerateCategories( $components['code'], $components['level'] );
 36+ } elseif ( self::mValidTitle( $template ) ) {
3237 // Non-existent page and invalid parameter syntax, red link.
33 - $contents .= "\n[[Template:{$this->mAddFixes( $name,'template' )}]]";
 38+ $content .= "\n[[Template:$template]]";
3439 } else {
3540 // Invalid title, output raw.
36 - $contents .= "\nTemplate:{$this->mAddFixes( $name,'template' )}";
 41+ $content .= "\nTemplate:$template";
3742 }
3843 }
3944
4045 $footer = wfMsgForContent( 'babel-footer' );
41 - if( wfEmptyMsg( $footer ) ) {
 46+ if ( wfEmptyMsg( $footer ) ) {
4247 $footer = '';
4348 } else {
4449 $footer = 'class="mw-babel-footer" | ' . $footer;
4550 }
4651
47 - global $wgTitle;
4852 $cellspacing = wfMsgForContent( 'babel-box-cellspacing' );
4953 $url = wfMsgForContent( 'babel-url' );
50 - $top = wfMsgExt( 'babel', array( 'parsemag', 'content' ), $wgTitle->getDBkey() );
51 - return <<<PHP
 54+ $top = wfMsgExt( 'babel', array( 'parsemag', 'content' ), self::$title->getDBkey() );
 55+ $tower = <<<EOT
5256 {| cellspacing="$cellspacing" class="mw-babel-wrapper"
5357 ! [[$url|$top]]
5458 |-
55 -| $contents
 59+| $content
5660 |-
5761 $footer
5862 |}
59 -PHP;
 63+EOT;
 64+ return $tower;
6065 }
6166
6267 /**
63 - * Adds prefixes and suffixes for a particular type to the string.
64 - *
65 - * @param $string String: Value to add prefixes and suffixes too.
66 - * @param $type String: Type of prefixes and suffixes (template/portal/category).
67 - * @return String: Value with prefixes and suffixes added.
68 - */
69 - protected function mAddFixes( $string, $type ) {
70 - return wfMsgForContent( "babel-$type-prefix" ) . $string . wfMsgForContent( "babel-$type-suffix" );
71 - }
72 -
73 - /**
7468 * Performs a link batch on a series of templates.
7569 *
7670 * @param $parameters Array: Templates to perform the link batch on.
7771 */
78 - protected function mTemplateLinkBatch( $parameters ) {
 72+ protected static function mTemplateLinkBatch( $parameters ) {
7973 $titles = array();
8074 foreach ( $parameters as $name ) {
81 - $title = Title::newFromText( $this->mAddFixes( $name, 'template' ), NS_TEMPLATE );
 75+ $title = Title::newFromText( wfMsgForContent( 'babel-template', $name ) );
8276 if ( is_object( $title ) ) {
8377 $titles[] = $title;
8478 }
@@ -88,24 +82,24 @@
8983 }
9084
9185 /**
92 - * Identify whether or not the template exists or not.
 86+ * Identify whether or not a page exists or not.
9387 *
94 - * @param $title String: Name of the template to check.
95 - * @return Boolean: Indication of whether the template exists.
 88+ * @param $name String: Name of the page to check.
 89+ * @return Boolean: Indication of whether the page exists.
9690 */
97 - protected function mTemplateExists( $title ) {
98 - $titleObj = Title::newFromText( $this->mAddFixes( $title, 'template' ), NS_TEMPLATE );
 91+ protected static function mPageExists( $name ) {
 92+ $titleObj = Title::newFromText( $name );
9993 return ( is_object( $titleObj ) && $titleObj->exists() );
10094 }
10195
10296 /**
103 - * Identify whether or not the passed string would make a valid title.
 97+ * Identify whether or not the passed string would make a valid page name.
10498 *
105 - * @param $title string: Name of title to check.
 99+ * @param $name string: Name of page to check.
106100 * @return Boolean: Indication of whether or not the title is valid.
107101 */
108 - protected function mValidTitle( $title ) {
109 - $titleObj = Title::newFromText( $this->mAddFixes( $title, 'template' ), NS_TEMPLATE );
 102+ protected static function mValidTitle( $name ) {
 103+ $titleObj = Title::newFromText( $name );
110104 return is_object( $titleObj );
111105 }
112106
@@ -115,13 +109,15 @@
116110 * @param $parameter String: Parameter.
117111 * @return Array: { 'code' => xx, 'level' => xx }
118112 */
119 - protected function mParseParameter( $parameter ) {
 113+ protected static function mParseParameter( $parameter ) {
 114+ global $wgBabelDefaultLevel, $wgBabelCategoryNames;
120115 $return = array();
121116
122 - // Try treating the paramter as a language code (for native).
123 - if ( BabelLanguageCodes::getCode( $parameter ) ) {
124 - $return['code'] = BabelLanguageCodes::getCode( $parameter );
125 - $return['level'] = 'N';
 117+ // Try treating the paramter as a language code (for default level).
 118+ $code = BabelLanguageCodes::getCode( $parameter );
 119+ if ( $code !== false ) {
 120+ $return['code'] = $code;
 121+ $return['level'] = $wgBabelDefaultLevel;
126122 return $return;
127123 }
128124 // Try splitting the paramter in to language and level, split on last hyphen.
@@ -134,12 +130,12 @@
135131
136132 // Validate code.
137133 $return['code'] = BabelLanguageCodes::getCode( $code );
138 - if ( !$return['code'] ) {
 134+ if ( $return['code'] === false ) {
139135 return false;
140136 }
141137 // Validate level.
142 - $intLevel = (int) $level;
143 - if ( ( $intLevel < 0 || $intLevel > 5 ) && $level !== 'N' ) {
 138+ $level = strtoupper( $level );
 139+ if( !isset( $wgBabelCategoryNames[$level] ) ) {
144140 return false;
145141 }
146142 $return['level'] = $level;
@@ -154,25 +150,27 @@
155151 * @param $level String or Integer: Level of ability to use.
156152 * @return String: A single babel box, in wikitext format.
157153 */
158 - protected function mGenerateBox( $code, $level ) {
159 - $header = "[[{$this->mAddFixes( $code,'portal' )}|" . wfBCP47( $code ) . "]]<span class=\"mw-babel-box-level-$level\">-$level</span>";
 154+ protected static function mGenerateBox( $code, $level ) {
 155+ $portal = wfMsgForContent( 'babel-portal', $code );
 156+ $header = "[[$portal|" . wfBCP47( $code ) . "]]<span class=\"mw-babel-box-level-$level\">-$level</span>";
160157
161158 $name = BabelLanguageCodes::getName( $code );
162159 $code = BabelLanguageCodes::getCode( $code );
163 - $text = $this->mGetText( $name, $code, $level );
 160+ $text = self::mGetText( $name, $code, $level );
164161
165162 $dir_content = wfMsgForContent( 'babel-directionality' );
166163 $dir_current = wfMsgExt( 'babel-directionality', array( 'language' => $code ) );
167164 $cellspacing = wfMsgForContent( 'babel-cellspacing' );
168165
169 - return <<<PHP
 166+ $box = <<<EOT
170167 <div class="mw-babel-box mw-babel-box-$level" dir="$dir_content">
171168 {| cellspacing="$cellspacing"
172169 ! dir="$dir_content" | $header
173170 | dir="$dir_current" | $text
174171 |}
175172 </div>
176 -PHP;
 173+EOT;
 174+ return $box;
177175 }
178176
179177 /**
@@ -183,30 +181,35 @@
184182 * @param $level String: Level to use.
185183 * @return String: Text for display, in wikitext format.
186184 */
187 - protected function mGetText( $name, $language, $level ) {
188 - global $wgTitle, $wgBabelUseLevelZeroCategory, $wgBabelCategoryNames;
 185+ protected static function mGetText( $name, $language, $level ) {
 186+ global $wgBabelMainCategory, $wgBabelCategoryNames;
189187
190 - $categoryLevel = ':Category:' . $this->mReplaceCategoryVariables( $wgBabelCategoryNames[$level], $language );
191 - $categorySuper = ':Category:' . $this->mReplaceCategoryVariables( $wgBabelCategoryNames['main'], $language );
 188+ if ( $wgBabelCategoryNames[$level] === false ) {
 189+ $categoryLevel = self::$title->getFullText();
 190+ } else {
 191+ $categoryLevel = ':Category:' . self::mReplaceCategoryVariables( $wgBabelCategoryNames[$level], $language );
 192+ }
192193
193 - if ( !$wgBabelUseLevelZeroCategory && $level === '0' ) {
194 - $categoryLevel = $wgTitle->getFullText();
 194+ if ( $wgBabelMainCategory === false ) {
 195+ $categoryMain = self::$title->getFullText();
 196+ } else {
 197+ $categoryMain = ':Category:' . self::mReplaceCategoryVariables( $wgBabelMainCategory, $language );
195198 }
196199
197200 $text = wfMsgExt( "babel-$level-n",
198201 array( 'language' => $language, 'parsemag' ),
199 - $categoryLevel, $categorySuper, '', $wgTitle->getDBkey()
 202+ $categoryMain, $categoryMain, '', self::$title->getDBkey()
200203 );
201204
202205 $fallback = wfMsgExt( "babel-$level-n",
203206 array( 'language' => Language::getFallbackfor( $language ), 'parsemag' ),
204 - $categoryLevel, $categorySuper, '', $wgTitle->getDBkey()
 207+ $categoryMain, $categoryMain, '', self::$title->getDBkey()
205208 );
206209
207210 if ( $text == $fallback ) {
208211 $text = wfMsgExt( "babel-$level",
209212 array( 'language' => $language, 'parsemag' ),
210 - $categoryLevel, $categorySuper, $name, $wgTitle->getDBkey()
 213+ $categoryMain, $categoryMain, $name, self::$title->getDBkey()
211214 );
212215 }
213216
@@ -220,20 +223,19 @@
221224 * @param $level String or Integer: Level of ability to use.
222225 * @return String: Wikitext to add categories.
223226 */
224 - protected function mGenerateCategories( $code, $level ) {
225 - global $wgBabelUseMainCategories, $wgBabelUseLevelZeroCategory,
226 - $wgBabelUseSimpleCategories, $wgBabelCategoryNames, $wgLanguageCode;
 227+ protected static function mGenerateCategories( $code, $level ) {
 228+ global $wgBabelMainCategory, $wgBabelCategoryNames, $wgLanguageCode;
227229
228230 $r = '';
229231
230 - if ( $wgBabelUseMainCategories && ( $level === 'N' || ( $wgBabelUseLevelZeroCategory && $level === '0' ) || $level > 0 ) ) {
231 - $category = $this->mReplaceCategoryVariables( $wgBabelCategoryNames['main'], $code );
 232+ if ( $wgBabelMainCategory !== false && $wgBabelCategoryNames[$level] !== false ) {
 233+ $category = self::mReplaceCategoryVariables( $wgBabelMainCategory, $code );
232234 $r .= "[[Category:$category|$level]]";
233235 BabelAutoCreate::create( $category, BabelLanguageCodes::getName( $code, $wgLanguageCode ) );
234236 }
235237
236 - if ( !$wgBabelUseSimpleCategories && ( $level === 'N' || ( $wgBabelUseLevelZeroCategory && $level === '0' ) || $level > 0 ) ) {
237 - $category = $this->mReplaceCategoryVariables( $wgBabelCategoryNames[$level], $code );
 238+ if ( $wgBabelCategoryNames[$level] !== false ) {
 239+ $category = self::mReplaceCategoryVariables( $wgBabelCategoryNames[$level], $code );
238240 $r .= "[[Category:$category]]";
239241 BabelAutoCreate::create( $category, BabelLanguageCodes::getName( $code, $wgLanguageCode ), $level );
240242 }
@@ -249,7 +251,7 @@
250252 * @param $code String: Language code of category.
251253 * @return String: Category name with variables replaced.
252254 */
253 - protected function mReplaceCategoryVariables( $category, $code ) {
 255+ protected static function mReplaceCategoryVariables( $category, $code ) {
254256 global $wgLanguageCode;
255257 $vars = array(
256258 '%code%' => $code,
Index: trunk/extensions/Babel/BabelLanguageCodes.class.php
@@ -1,41 +1,38 @@
22 <?php
33
44 /**
5 - * Handle language code (and name) processing for the Babel extension, can also
 5+ * Handle language code and name processing for the Babel extension, it can also
66 * be used by other extension which need such functionality.
77 *
88 * @ingroup Extensions
99 */
1010 class BabelLanguageCodes {
1111 /**
12 - * Take a code as input, then use various magic to return a "better"
13 - * code if available. The following order is used
14 - * - MediaWiki language codes.
15 - * - ISO 639-1 and 639-3 language codes constant database.
 12+ * Takes a language code, and attempt to obtain a better variant of it,
 13+ * checks the MediaWiki language codes for a match, otherwise checks the
 14+ * Babel language codes CDB (preferring ISO 639-1 over ISO 639-3).
1615 *
1716 * @param $code String: Code to try and get a "better" code for.
1817 * @return String (language code) or false (invalid language code).
1918 */
2019 public static function getCode( $code ) {
21 - // Try MediaWiki language files.
22 - global $wgLang;
 20+ global $wgLang, $wgBabelLanguageCodesCdb;
 21+
2322 $mediawiki = $wgLang->getLanguageName( $code );
2423 if ( $mediawiki !== '' ) {
2524 return $code;
2625 }
2726
28 - // Try ISO codes constant database.
29 - global $wgBabelLanguageCodesCdb;
3027 $codes = CdbReader::open( $wgBabelLanguageCodesCdb );
3128 return $codes->get( $code );
3229 }
3330
3431 /**
3532 * Take a code as input, and attempt to find a language name for it in
36 - * a language that is as native as possible. The following order is used:
37 - * - CLDR extension.
38 - * - MediaWiki native.
39 - * - Names constant database.
 33+ * a a given language, uses the order:
 34+ * - CLDR extension
 35+ * - MediaWiki language names
 36+ * - Babel language names CDB
4037 *
4138 * @param $code String: Code to get name for.
4239 * @param $language String: Code of language to attempt to get name in,
@@ -43,7 +40,8 @@
4441 * @return String (name of language) or false (invalid language code).
4542 */
4643 public static function getName( $code, $language = null ) {
47 - $cacheType = 'name';
 44+ global $wgBabelLanguageNamesCdb;
 45+
4846 // Get correct code, even though it should already be correct.
4947 $code = self::getCode( $code );
5048 if ( $code === false ) {
@@ -54,18 +52,20 @@
5553 $language = $code;
5654 }
5755
58 - // Try CLDR extension, then MediaWiki native.
 56+ // Try CLDR extension, then MediaWiki language names.
5957 if ( class_exists( 'LanguageNames' ) ) {
60 - $names = LanguageNames::getNames( $language, LanguageNames::FALLBACK_NORMAL, LanguageNames::LIST_MW_AND_CLDR );
 58+ $names = LanguageNames::getNames(
 59+ $language,
 60+ LanguageNames::FALLBACK_NORMAL,
 61+ LanguageNames::LIST_MW_AND_CLDR
 62+ );
6163 } else {
6264 $names = Language::getLanguageNames();
6365 }
64 - if ( array_key_exists( $code, $names ) ) {
 66+ if ( isset( $names[$code] ) ) {
6567 return $names[ $code ];
6668 }
6769
68 - // Use English names, from names constant database.
69 - global $wgBabelLanguageNamesCdb;
7070 $names = CdbReader::open( $wgBabelLanguageNamesCdb );
7171 return $names->get( $code );
7272 }
Index: trunk/extensions/Babel/BabelStatic.class.php
@@ -10,22 +10,8 @@
1111 * Registers the parser function hook.
1212 * @return Boolean: True.
1313 */
14 - public static function Setup( &$parser ) {
15 - $parser->setFunctionHook( 'babel', array( 'BabelStatic', 'Render' ) );
 14+ public static function Setup( $parser ) {
 15+ $parser->setFunctionHook( 'babel', array( 'Babel', 'Render' ) );
1616 return true;
1717 }
18 -
19 - /**
20 - * Return Babel tower, initializing the Babel object if necessery,
21 - * @param $parser Object: Parser.
22 - * @return String: Babel tower.
23 - */
24 - public static function Render( $parser ) {
25 - global $wgLanguageCodesFiles, $wgBabel;
26 - if ( !is_object( $wgBabel ) ) {
27 - $wgBabel = new Babel( $wgLanguageCodesFiles );
28 - }
29 - $arguments = func_get_args();
30 - return call_user_func_array( array( $wgBabel, 'render' ), $arguments );
31 - }
3218 }
Index: trunk/extensions/Babel/Babel.i18n.magic.php
@@ -1,4 +1,5 @@
22 <?php
 3+
34 /**
45 * Internationalisation file for Babel extension.
56 *
@@ -86,4 +87,4 @@
8788 /** Simplified Chinese (‪中文(简体)‬) */
8889 $magicWords['zh-hans'] = array(
8990 'babel' => array( 0, '巴别', 'babel' ),
90 -);
\ No newline at end of file
 91+);
Index: trunk/extensions/Babel/Babel.i18n.php
@@ -43,10 +43,8 @@
4444
4545 'babel-box-cellspacing' => '0', # Do not translate or duplicate this message to other languages.
4646
47 - 'babel-portal-prefix' => '', # Do not translate or duplicate this message to other languages.
48 - 'babel-portal-suffix' => '', # Do not translate or duplicate this message to other languages.
49 - 'babel-template-prefix' => '', # Do not translate or duplicate this message to other languages.
50 - 'babel-template-suffix' => '', # Do not translate or duplicate this message to other languages.
 47+ 'babel-portal' => '$1', # Do not translate or duplicate this message to other languages.
 48+ 'babel-template' => 'Template:$1', # Do not translate or duplicate this message to other languages.
5149
5250 'babel-footer' => '', # Do not translate or duplicate this message to other languages.
5351 );
Index: trunk/extensions/Babel/Babel.php
@@ -21,7 +21,7 @@
2222 $wgExtensionCredits['parserhook'][] = array(
2323 'path' => __FILE__,
2424 'name' => 'Babel',
25 - 'version' => '1.6.0',
 25+ 'version' => '1.7.0',
2626 'author' => 'Robert Leverington',
2727 'url' => 'http://www.mediawiki.org/wiki/Extension:Babel',
2828 'descriptionmsg' => 'babel-desc',
@@ -30,41 +30,43 @@
3131 $wgHooks['ParserFirstCallInit'][] = 'BabelStatic::Setup';
3232 $wgHooks['AbortNewAccount'][] = 'BabelAutoCreate::RegisterAbort';
3333
34 -$dir = dirname( __FILE__ );
 34+$dir = dirname( __FILE__ ) . '/';
3535
36 -$wgExtensionMessagesFiles['Babel'] = $dir . '/Babel.i18n.php';
37 -$wgExtensionMessagesFiles['BabelMagic'] = $dir . '/Babel.i18n.magic.php';
 36+$wgExtensionMessagesFiles['Babel'] = $dir . 'Babel.i18n.php';
 37+$wgExtensionMessagesFiles['BabelMagic'] = $dir . 'Babel.i18n.magic.php';
3838
39 -$wgAutoloadClasses['Babel'] = $dir . '/Babel.class.php';
40 -$wgAutoloadClasses['BabelLanguageCodes'] = $dir . '/BabelLanguageCodes.class.php';
41 -$wgAutoloadClasses['BabelStatic'] = $dir . '/BabelStatic.class.php';
42 -$wgAutoloadClasses['BabelAutoCreate'] = $dir . '/BabelAutoCreate.class.php';
 39+$wgAutoloadClasses['Babel'] = $dir . 'Babel.class.php';
 40+$wgAutoloadClasses['BabelLanguageCodes'] = $dir . 'BabelLanguageCodes.class.php';
 41+$wgAutoloadClasses['BabelStatic'] = $dir . 'BabelStatic.class.php';
 42+$wgAutoloadClasses['BabelAutoCreate'] = $dir . 'BabelAutoCreate.class.php';
4343
4444 // Configuration setttings.
45 -// A boolean (true or false) indicating whether users should be entered in to a category if they use xx-0; defaults to false.
46 -$wgBabelUseLevelZeroCategory = false;
47 -// A boolean (true or false) indicating whether categories for abilities should be used; defaults to false.
48 -$wgBabelUseSimpleCategories = false;
49 -// A boolean (true or false) indicating whether main categories featuring all users who specify a level for that language should be added to a xx category; defaults to true.
50 -$wgBabelUseMainCategories = true;
5145 // Language names and codes constant database files, the defaults should suffice.
52 -$wgBabelLanguageCodesCdb = $dir . '/codes.cdb';
53 -$wgBabelLanguageNamesCdb = $dir . '/names.cdb';
54 -// Format of category names - variables: %code% %wikiname% %nativename%
 46+$wgBabelLanguageCodesCdb = $dir . 'codes.cdb';
 47+$wgBabelLanguageNamesCdb = $dir . 'names.cdb';
 48+// Array of possible levels, and their category name - variables: %code% %wikiname% %nativename%
 49+// Set to false to disable categories for a particular level.
 50+// Alphabetical levels should be in upper case.
5551 $wgBabelCategoryNames = array(
56 - 0 => '%code%-0',
57 - 1 => '%code%-1',
58 - 2 => '%code%-2',
59 - 3 => '%code%-3',
60 - 4 => '%code%-4',
61 - 5 => '%code%-5',
62 - 'N' => '%code%-N',
63 - 'main' => '%code%'
 52+ '0' => '%code%-0',
 53+ '1' => '%code%-1',
 54+ '2' => '%code%-2',
 55+ '3' => '%code%-3',
 56+ '4' => '%code%-4',
 57+ '5' => '%code%-5',
 58+ 'N' => '%code%-N'
6459 );
 60+// Category name for the main (non-level) category of each language.
 61+// Set to false to disable main category.
 62+$wgBabelMainCategory = '%code%';
 63+// Default level.
 64+$wgBabelDefaultLevel = 'N';
 65+// A boolean (true or false) indicating whether ISO 639-3 codes should be preferred over ISO 639-1 codes.
 66+$wgBabelPreferISO639_3 = false; // Not yet used.
6567
6668 /* Other settings, to be made in-wiki:
67 -MediaWiki:Babel-template-prefix and MediaWiki:Babel-template-suffix
68 - The prefix and suffix to be prepended or appended to the template name when one is being included.
69 -MediaWiki:Babel-portal-prefix and MediaWiki:Babel-portal-suffix
70 - The prefix and suffix to be prepended or appended to the target of the link from the language code.
 69+MediaWiki:Babel-template
 70+ The name format of template names used in the babel extension.
 71+MediaWiki:Babel-portal
 72+ The name format of the portal link for each language.
7173 */
Index: trunk/extensions/Babel/BabelAutoCreate.class.php
@@ -34,7 +34,13 @@
3535 $text = wfMsgForContent( 'babel-autocreate-text-levels', $level, $language );
3636 }
3737 $article = new Article( $title );
38 - $article->doEdit( $text, wfMsgForContent( 'babel-autocreate-reason', wfMsgForContent( 'babel-url' ) ), EDIT_FORCE_BOT, false, self::user() );
 38+ $article->doEdit(
 39+ $text,
 40+ wfMsgForContent( 'babel-autocreate-reason', wfMsgForContent( 'babel-url' ) ),
 41+ EDIT_FORCE_BOT,
 42+ false,
 43+ self::user()
 44+ );
3945 }
4046
4147 /**
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt
@@ -83,8 +83,8 @@
8484 optional = babel-3-n-male, babel-4-n-male, babel-5-n-male, babel-N-n-male
8585 optional = babel-autocreate-user
8686 ignored = babel-box-cellspacing
87 -ignored = babel-portal-prefix, babel-portal-suffix, babel-template-prefix
88 -ignored = babel-template-suffix, babel-footer
 87+ignored = babel-portal, babel-template
 88+ignored = babel-footer
8989
9090 Back and Forth
9191 file = BackAndForth/BackAndForth.i18n.php

Status & tagging log