}
}
+/**
+ * Since wfMsg() and co suck, they don't return false if the message key they
+ * looked up didn't exist but a XHTML string, this function checks for the
+ * nonexistance of messages by looking at wfMsg() output
+ *
+ * @param $msg The message key looked up
+ * @param $wfMsgOut The output of wfMsg*()
+ * @return bool
+ */
+function wfNoMsg( $msg, $wfMsgOut ) {
+ return $wfMsgOut === "<$msg>";
+}
?>
$link = wfMsgForContent( $line[0] );
if ($link == '-')
continue;
+ if (wfNoMsg($line[1], $text = wfMsg($line[1])))
+ $text = $line[1];
+ if (wfNoMsg($line[0], $link))
+ $link = $line[0];
$bar[$heading][] = array(
- 'text' => wfMsg( $line[1] ),
+ 'text' => $text,
'href' => $this->makeInternalOrExternalUrl( $link ),
'id' => 'n-' . strtr($line[1], ' ', '-'),
);
<script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
<?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
<div class='portlet' id='p-<?php echo htmlspecialchars($bar) ?>'>
- <h5><?php $this->msg( $bar ) ?></h5>
+ <h5><?php $out = wfMsg( $bar ); if (wfNoMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
<div class='pBody'>
<ul>
<?php foreach($cont as $key => $val) { ?>