r97708 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97707‎ | r97708 | r97709 >
Date:09:03, 21 September 2011
Author:ialex
Status:ok (Comments)
Tags:
Comment:
Wrap the copyright when its language is not the user's language; avoids problem when direction of the two languages is different
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -729,7 +729,7 @@
730730 }
731731
732732 function getCopyright( $type = 'detect' ) {
733 - global $wgRightsPage, $wgRightsUrl, $wgRightsText;
 733+ global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgContLang;
734734
735735 if ( $type == 'detect' ) {
736736 if ( !$this->isRevisionCurrent() && wfMsgForContent( 'history_copyright' ) !== '-' ) {
@@ -763,7 +763,11 @@
764764 wfRunHooks( 'SkinCopyrightFooter', array( $this->getTitle(), $type, &$msg, &$link, &$forContent ) );
765765
766766 if ( $forContent ) {
767 - return wfMsgForContent( $msg, $link );
 767+ $msg = wfMsgForContent( $msg, $link );
 768+ if ( $this->getLang()->getCode() !== $wgContLang->getCode() ) {
 769+ $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $msg );
 770+ }
 771+ return $msg;
768772 } else {
769773 return wfMsg( $msg, $link );
770774 }

Comments

#Comment by Nikerabbit (talk | contribs)   09:19, 21 September 2011

Ugh raw html messages.

#Comment by Krinkle (talk | contribs)   21:44, 21 September 2011

Language-dependent html structure is not very pretty. Perhaps just wrap it always regardless of the language ?

Status & tagging log