Index: branches/REL1_5/phase3/skins/MonoBook.php |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script> |
128 | 128 | <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?> |
129 | 129 | <div class='portlet' id='p-<?php echo htmlspecialchars($bar) ?>'> |
130 | | - <h5><?php $this->msg( $bar ) ?></h5> |
| 130 | + <h5><?php $out = wfMsg( $bar ); if (wfNoMsg($bar, $out)) echo $bar; else echo $out; ?></h5> |
131 | 131 | <div class='pBody'> |
132 | 132 | <ul> |
133 | 133 | <?php foreach($cont as $key => $val) { ?> |
Index: branches/REL1_5/phase3/includes/GlobalFunctions.php |
— | — | @@ -1347,4 +1347,16 @@ |
1348 | 1348 | } |
1349 | 1349 | } |
1350 | 1350 | |
| 1351 | +/** |
| 1352 | + * Since wfMsg() and co suck, they don't return false if the message key they |
| 1353 | + * looked up didn't exist but a XHTML string, this function checks for the |
| 1354 | + * nonexistance of messages by looking at wfMsg() output |
| 1355 | + * |
| 1356 | + * @param $msg The message key looked up |
| 1357 | + * @param $wfMsgOut The output of wfMsg*() |
| 1358 | + * @return bool |
| 1359 | + */ |
| 1360 | +function wfNoMsg( $msg, $wfMsgOut ) { |
| 1361 | + return $wfMsgOut === "<$msg>"; |
| 1362 | +} |
1351 | 1363 | ?> |
Index: branches/REL1_5/phase3/includes/Skin.php |
— | — | @@ -1316,8 +1316,12 @@ |
1317 | 1317 | $link = wfMsgForContent( $line[0] ); |
1318 | 1318 | if ($link == '-') |
1319 | 1319 | continue; |
| 1320 | + if (wfNoMsg($line[1], $text = wfMsg($line[1]))) |
| 1321 | + $text = $line[1]; |
| 1322 | + if (wfNoMsg($line[0], $link)) |
| 1323 | + $link = $line[0]; |
1320 | 1324 | $bar[$heading][] = array( |
1321 | | - 'text' => wfMsg( $line[1] ), |
| 1325 | + 'text' => $text, |
1322 | 1326 | 'href' => $this->makeInternalOrExternalUrl( $link ), |
1323 | 1327 | 'id' => 'n-' . strtr($line[1], ' ', '-'), |
1324 | 1328 | ); |