(bug 5387) Block log items on RecentChanges don't make use of possible translations:
authorRotem Liss <rotem@users.mediawiki.org>
Mon, 10 Sep 2007 01:53:24 +0000 (01:53 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Mon, 10 Sep 2007 01:53:24 +0000 (01:53 +0000)
* 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
includes/LogPage.php
includes/SpecialLog.php
languages/Language.php
languages/classes/LanguageFi.php

index 03e5052..31f517f 100644 (file)
@@ -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 ===
 
index 8982b59..ce53e85 100644 (file)
@@ -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] = '<span title="' . htmlspecialchars( $params[1] ). '">' . $wgLang->translateBlockExpiry( $params[1] ) . '</span>';
+                                               } else {
+                                                       $params[1] = $wgContLang->translateBlockExpiry( $params[1] );
                                                }
                                                $params[2] = isset( $params[2] )
                                                                                ? self::formatBlockFlags( $params[2] )
index f0794eb..09353d8 100644 (file)
@@ -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 = "<li>$time $userLink $action $comment $revert</li>\n";
                return $out;
        }
index 439856b..a5a210a 100644 (file)
@@ -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 '<span title="' . htmlspecialchars($str). '">' . htmlspecialchars( trim( $show ) ) . '</span>';
+                               return htmlspecialchars( trim( $show ) );
                        }
                }
 
index 0d02dfe..7c1778c 100644 (file)
@@ -139,11 +139,7 @@ class LanguageFi extends Language {
                        $final .= ' ' . $item;
                }
 
-               if ( $forContent ) {
-                       return htmlspecialchars( trim( $final ) );
-               } else {
-                       return '<span class="blockexpiry" title="' . htmlspecialchars($str). '">”' . trim( $final ) . '”</span>';
-               }
+               return htmlspecialchars( trim( $final ) );
        }
 
 }