r25709 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25708‎ | r25709 | r25710 >
Date:01:53, 10 September 2007
Author:rotem
Status:old
Tags:
Comment:
(bug 5387) Block log items on RecentChanges don't make use of possible translations:
* Removing span from Language::translateBlockExpiry.
* Adding span conditionally in LogPage::actionText, and using appropriate language (interface and content).
* Removing translate parameter from LogPage::actionText: no longer needed, always translate.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialLog.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)
  • /trunk/phase3/languages/classes/LanguageFi.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialLog.php
@@ -408,7 +408,7 @@
409409 }
410410 }
411411
412 - $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true );
 412+ $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true );
413413 $out = "<li>$time $userLink $action $comment $revert</li>\n";
414414 return $out;
415415 }
Index: trunk/phase3/includes/LogPage.php
@@ -138,7 +138,7 @@
139139 /**
140140 * @static
141141 */
142 - static function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false, $translate=false ) {
 142+ static function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false ) {
143143 global $wgLang, $wgContLang, $wgLogActions;
144144
145145 $key = "$type/$action";
@@ -199,8 +199,10 @@
200200 } else {
201201 array_unshift( $params, $titleLink );
202202 if ( $key == 'block/block' ) {
203 - if ( $translate ) {
204 - $params[1] = $wgLang->translateBlockExpiry( $params[1] );
 203+ if ( $skin ) {
 204+ $params[1] = '<span title="' . htmlspecialchars( $params[1] ). '">' . $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
 205+ } else {
 206+ $params[1] = $wgContLang->translateBlockExpiry( $params[1] );
205207 }
206208 $params[2] = isset( $params[2] )
207209 ? self::formatBlockFlags( $params[2] )
Index: trunk/phase3/languages/Language.php
@@ -1382,11 +1382,10 @@
13831383 /**
13841384 * For translaing of expiry times
13851385 * @param string The validated block time in English
1386 - * @param $forContent, avoid html?
13871386 * @return Somehow translated block time
13881387 * @see LanguageFi.php for example implementation
13891388 */
1390 - function translateBlockExpiry( $str, $forContent=false ) {
 1389+ function translateBlockExpiry( $str ) {
13911390
13921391 $scBlockExpiryOptions = $this->getMessageFromDB( 'ipboptions' );
13931392
@@ -1399,10 +1398,7 @@
14001399 continue;
14011400 list($show, $value) = explode(":", $option);
14021401 if ( strcmp ( $str, $value) == 0 ) {
1403 - if ( $forContent )
1404 - return htmlspecialchars($str) . htmlspecialchars( trim( $show ) );
1405 - else
1406 - return '<span title="' . htmlspecialchars($str). '">' . htmlspecialchars( trim( $show ) ) . '</span>';
 1402+ return htmlspecialchars( trim( $show ) );
14071403 }
14081404 }
14091405
Index: trunk/phase3/languages/classes/LanguageFi.php
@@ -139,11 +139,7 @@
140140 $final .= ' ' . $item;
141141 }
142142
143 - if ( $forContent ) {
144 - return htmlspecialchars( trim( $final ) );
145 - } else {
146 - return '<span class="blockexpiry" title="' . htmlspecialchars($str). '">”' . trim( $final ) . '”</span>';
147 - }
 143+ return htmlspecialchars( trim( $final ) );
148144 }
149145
150146 }
Index: trunk/phase3/RELEASE-NOTES
@@ -32,6 +32,8 @@
3333 getUserPermissionsErrors.
3434 * Login and signup forms are now more correct for right-to-left languages.
3535 * Fix inconsistent section edit link size for some browsers.
 36+* (bug 5387) Block log items on RecentChanges don't make use of possible
 37+ translations
3638
3739 === API changes in 1.12 ===
3840

Follow-up revisions

RevisionCommit summaryAuthorDate
r25754Merged revisions 25607-25751 via svnmerge from...david23:02, 10 September 2007

Status & tagging log