r97726 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97725‎ | r97726 | r97727 >
Date:13:03, 21 September 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
If babel-portal is empty, don't make a link. Made it empty by default.
Modified paths:
  • /trunk/extensions/Babel/Babel.class.php (modified) (history)
  • /trunk/extensions/Babel/Babel.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Babel/Babel.class.php
@@ -199,8 +199,13 @@
200200 */
201201 protected static function mGenerateBox( $code, $level ) {
202202 $lang = wfBCP47( $code );
203 - $portal = wfMsgForContent( 'babel-portal', $code );
204 - $header = "[[$portal|" . $lang . "]]<span class=\"mw-babel-box-level-$level\">-$level</span>";
 203+ $portal = wfMessage( 'babel-portal', $code )->plain();
 204+ if ( $portal !== '' ) {
 205+ $portal = "[[$portal|$lang]]";
 206+ } else {
 207+ $portal = $lang;
 208+ }
 209+ $header = "$portal<span class=\"mw-babel-box-level-$level\">-$level</span>";
205210
206211 $code = strtolower( $code );
207212 $name = BabelLanguageCodes::getName( $code );
Index: trunk/extensions/Babel/Babel.i18n.php
@@ -48,7 +48,7 @@
4949 'babel-cellspacing' => '0', # Do not translate or duplicate this message to other languages.
5050 'babel-cellpadding' => '0', # Do not translate or duplicate this message to other languages.
5151
52 - 'babel-portal' => '$1', # Do not translate or duplicate this message to other languages.
 52+ 'babel-portal' => '', # Do not translate or duplicate this message to other languages.
5353 'babel-template' => 'Template:$1', # Do not translate or duplicate this message to other languages.
5454
5555 'babel-footer' => 'Users by language',

Follow-up revisions

RevisionCommit summaryAuthorDate
r977271.18wmf1: MFT r97726, this brings Babel to trunk statecatrope13:06, 21 September 2011
r977281.17wmf1: MFT r97726, this brings Babel to trunk statecatrope13:07, 21 September 2011
r98023Followup r97726 - this should not depend on user languagenikerabbit20:22, 24 September 2011

Comments

#Comment by G.Hagedorn (talk | contribs)   12:22, 22 September 2011

please tag for 1.18, thanks!

#Comment by Nikerabbit (talk | contribs)   12:57, 22 September 2011

Why?

#Comment by G.Hagedorn (talk | contribs)   13:35, 22 September 2011

I suggest it to provide a working version for 1.18 users outside WMF as well. If it is a bug to WMF, then it also affects other wiki farms. Leave it if I am wrong and don't understand it enough.

#Comment by Nikerabbit (talk | contribs)   13:40, 22 September 2011

Babel in 1.18 might be so different it might not be worth it.

Status & tagging log