From d51c7cdacea3473cc480c0891495a9c01f513ddf Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Mon, 10 Sep 2007 01:53:24 +0000 Subject: [PATCH] (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. --- RELEASE-NOTES | 2 ++ includes/LogPage.php | 8 +++++--- includes/SpecialLog.php | 2 +- languages/Language.php | 8 ++------ languages/classes/LanguageFi.php | 6 +----- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 03e5052c49..31f517f709 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -32,6 +32,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN getUserPermissionsErrors. * Login and signup forms are now more correct for right-to-left languages. * Fix inconsistent section edit link size for some browsers. +* (bug 5387) Block log items on RecentChanges don't make use of possible + translations === API changes in 1.12 === diff --git a/includes/LogPage.php b/includes/LogPage.php index 8982b59fdb..ce53e85989 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -138,7 +138,7 @@ class LogPage { /** * @static */ - static function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false, $translate=false ) { + static function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false ) { global $wgLang, $wgContLang, $wgLogActions; $key = "$type/$action"; @@ -199,8 +199,10 @@ class LogPage { } else { array_unshift( $params, $titleLink ); if ( $key == 'block/block' ) { - if ( $translate ) { - $params[1] = $wgLang->translateBlockExpiry( $params[1] ); + if ( $skin ) { + $params[1] = '' . $wgLang->translateBlockExpiry( $params[1] ) . ''; + } else { + $params[1] = $wgContLang->translateBlockExpiry( $params[1] ); } $params[2] = isset( $params[2] ) ? self::formatBlockFlags( $params[2] ) diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index f0794eb56b..09353d8156 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -408,7 +408,7 @@ class LogViewer { } } - $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true ); + $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true ); $out = "
  • $time $userLink $action $comment $revert
  • \n"; return $out; } diff --git a/languages/Language.php b/languages/Language.php index 439856b5b1..a5a210a55a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1382,11 +1382,10 @@ class Language { /** * For translaing of expiry times * @param string The validated block time in English - * @param $forContent, avoid html? * @return Somehow translated block time * @see LanguageFi.php for example implementation */ - function translateBlockExpiry( $str, $forContent=false ) { + function translateBlockExpiry( $str ) { $scBlockExpiryOptions = $this->getMessageFromDB( 'ipboptions' ); @@ -1399,10 +1398,7 @@ class Language { continue; list($show, $value) = explode(":", $option); if ( strcmp ( $str, $value) == 0 ) { - if ( $forContent ) - return htmlspecialchars($str) . htmlspecialchars( trim( $show ) ); - else - return '' . htmlspecialchars( trim( $show ) ) . ''; + return htmlspecialchars( trim( $show ) ); } } diff --git a/languages/classes/LanguageFi.php b/languages/classes/LanguageFi.php index 0d02dfe7c4..7c1778cc8e 100644 --- a/languages/classes/LanguageFi.php +++ b/languages/classes/LanguageFi.php @@ -139,11 +139,7 @@ class LanguageFi extends Language { $final .= ' ' . $item; } - if ( $forContent ) { - return htmlspecialchars( trim( $final ) ); - } else { - return '”' . trim( $final ) . '”'; - } + return htmlspecialchars( trim( $final ) ); } } -- 2.20.1