r33940 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33939‎ | r33940 | r33941 >
Date:15:00, 27 April 2008
Author:minuteelectron
Status:old
Tags:
Comment:
* Add headers to various files.
* Fix UTF-8 character in Babel file.
* Use new method of determining if a fallback was used as the old one has been removed.
Modified paths:
  • /trunk/extensions/Babel/Babel.css (modified) (history)
  • /trunk/extensions/Babel/Babel.i18n.php (modified) (history)
  • /trunk/extensions/Babel/Babel.php (modified) (history)
  • /trunk/extensions/Babel/Babel_body.php (modified) (history)
  • /trunk/extensions/Babel/LanguageTools.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Babel/Babel_body.php
@@ -1,5 +1,11 @@
22 <?php
33
 4+/**
 5+ * Main class for the Babel extension.
 6+ *
 7+ * @addtogroup Extensions
 8+ */
 9+
410 class Babel {
511
612 private $_LanguageTools;
@@ -400,10 +406,18 @@
401407 ":Category:{$this->addFixes( $code,'category' )}"
402408 );
403409
 410+ /* Get the fallback message for comparison.
 411+ */
 412+ $fallback = wfMsgExt( "babel-$level-n",
 413+ array( 'nofallback', 'language' => Language::getFallbackfor( $code ) ),
 414+ ":Category:{$this->addFixes( "$code-$level",'category' )}",
 415+ ":Category:{$this->addFixes( $code,'category' )}"
 416+ );
 417+
404418 /* Translation not found, use the generic translation of the
405419 * highest level fallback possible.
406420 */
407 - if( wfEmptyMsg( "babel-$level-n", $text ) ) {
 421+ if( $text == $fallback ) {
408422 $text = wfMsgExt( "babel-$level",
409423 array( 'language' => $code ),
410424 ":Category:{$this->addFixes( "$code-$level",'category')}",
Index: trunk/extensions/Babel/Babel.i18n.php
@@ -1,7 +1,7 @@
22 <?php
33
44 /**
5 - * Internationalisation file for extension AjaxShowEditors.
 5+ * Internationalisation file for Babel extension.
66 *
77 * @addtogroup Extensions
88 */
Index: trunk/extensions/Babel/LanguageTools.php
@@ -1,5 +1,12 @@
22 <?php
33
 4+/**
 5+ * LanguageTools class for Babel extension, handles language code validation and
 6+ * conversion.
 7+ *
 8+ * @addtogroup Extensions
 9+ */
 10+
411 class LanguageTools {
512
613 private $_cache;
Index: trunk/extensions/Babel/Babel.php
@@ -11,7 +11,7 @@
1212 * @link http://www.mediawiki.org/wiki/Extension:Babel
1313 *
1414 * @author MinuteElectron <minuteelectron@googlemail.com>
15 - * @copyright Copyright ? 2008 MinuteElectron.
 15+ * @copyright Copyright � 2008 MinuteElectron.
1616 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1717 */
1818
Index: trunk/extensions/Babel/Babel.css
@@ -1,3 +1,13 @@
 2+/**
 3+ * Stylesheet for Babel extension.
 4+ *
 5+ * This should be added to your MediaWiki:Common.css page when installing this
 6+ * extension and should not be modified. You may modify the CSS code on the
 7+ * MediaWiki:Common.css page to adjust colours etc.
 8+ *
 9+ * @addtogroup Extensions
 10+ */
 11+
212 table.mw-babel-wrapper {
313 width: 238px;
414 float: right;
@@ -32,7 +42,7 @@
3343 line-height: 1.25em;
3444 }
3545
36 -/* level colours */
 46+/* colours */
3747 div.mw-babel-box-0 {
3848 border: solid #B7B7B7 1px;
3949 }

Status & tagging log