r69686 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69685‎ | r69686 | r69687 >
Date:16:01, 21 July 2010
Author:raymond
Status:ok
Tags:
Comment:
Show the copyright message in user preference language for Wikimedia wikis, important especially for multi language projects like Commons.
Stick to content language for standard MediaWiki installations for the case that [[MediaWiki:Copyright]] is customized.
It is very unlikely that a third party installation translate its customization in 204 languages like we have done it at Translatewiki for WikimediaMessages
Modified paths:
  • /trunk/extensions/WikimediaMessages/WikimediaMessages.php (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1429,6 +1429,7 @@
14301430 $type: 'normal' or 'history' for old/diff views
14311431 &$msg: overridable message; usually 'copyright' or 'history_copyright'. This message must be in HTML format, not wikitext!
14321432 &$link: overridable HTML link to be passed into the message as $1
 1433+&$forContent: overridable flag if copyright footer is shown in content language.
14331434
14341435 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle()
14351436 $skin: Skin object
Index: trunk/phase3/includes/Skin.php
@@ -1525,11 +1525,16 @@
15261526 return $out;
15271527 }
15281528 // Allow for site and per-namespace customization of copyright notice.
 1529+ $forContent = true;
15291530 if( isset( $wgArticle ) ) {
1530 - wfRunHooks( 'SkinCopyrightFooter', array( $wgArticle->getTitle(), $type, &$msg, &$link ) );
 1531+ wfRunHooks( 'SkinCopyrightFooter', array( $wgArticle->getTitle(), $type, &$msg, &$link, &$forContent ) );
15311532 }
15321533
1533 - $out .= wfMsgForContent( $msg, $link );
 1534+ if ( $forContent ) {
 1535+ $out .= wfMsgForContent( $msg, $link );
 1536+ } else {
 1537+ $out .= wfMsg( $msg, $link );
 1538+ }
15341539 return $out;
15351540 }
15361541
Index: trunk/extensions/WikimediaMessages/WikimediaMessages.php
@@ -41,9 +41,10 @@
4242 return true;
4343 }
4444
45 -function efWikimediaSkinCopyrightFooter( $title, $type, &$msg, &$link ) {
 45+function efWikimediaSkinCopyrightFooter( $title, $type, &$msg, &$link, &$forContent ) {
4646 if( $type != 'history' ) {
4747 $msg = 'wikimedia-copyright';
 48+ $forContent = false;
4849 }
4950 return true;
5051 }

Status & tagging log