Localize the 'Categories:' link.
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 28 Apr 2004 06:03:45 +0000 (06:03 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 28 Apr 2004 06:03:45 +0000 (06:03 +0000)
Move getCategories() into Skin:: where it belongs (there was a problem
with the PHP caching used long long long long ago that temporarily
prevented changing the class on one computer at one time. That's not
a general problem.)
Added some eo local bits.

includes/Skin.php
includes/SkinPHPTal.php
languages/Language.php
languages/LanguageEo.php

index f6cbadd..8734b8b 100644 (file)
@@ -24,22 +24,6 @@ if( $wgUsePHPTal ) {
 
 include_once( "RecentChange.php" );
 
-# For some odd PHP bug, this function can't be part of a class
-function getCategories ()
-{
-  global $wgOut , $wgTitle , $wgUseCategoryMagic , $wgUser , $wgParser ;
-  if ( !isset ( $wgUseCategoryMagic ) || !$wgUseCategoryMagic ) return "" ;
-  if ( count ( $wgOut->mCategoryLinks ) == 0 ) return "" ;
-  if ( !$wgOut->isArticle() ) return "" ;
-  $sk = $wgUser->getSkin() ;
-  $s = "" ;
-  $s .= $sk->makeKnownLink ( "Special:Categories" , "Categories" , "article=".$wgTitle->getDBkey() ) ;
-  $t = implode ( " | " , $wgOut->mCategoryLinks ) ;
-  if ( $t != "" ) $s .= ": " ;
-  $s .= $t ;
-  return "<p class='catlinks'>$s</p>";
-}
-
 class RCCacheEntry extends RecentChange
 {
        var $secureName, $link;
@@ -368,10 +352,24 @@ class Skin {
 
                $s .= $this->pageTitle();
                $s .= $this->pageSubtitle() ;
-               $s .= getCategories(); // For some odd reason, zhis can't be a function of the object
+               $s .= $this->getCategories();
                wfProfileOut( $fname );
                return $s;
        }
+       
+       function getCategories () {
+               global $wgOut, $wgTitle, $wgUser, $wgParser;
+               global $wgUseCategoryMagic;
+               if( !$wgUseCategoryMagic ) return "" ;
+               if( count( $wgOut->mCategoryLinks ) == 0 ) return "";
+               if( !$wgOut->isArticle() ) return "";
+               
+               $t = implode ( " | " , $wgOut->mCategoryLinks ) ;
+               $s = $this->makeKnownLink( "Special:Categories",
+                       wfMsg( "categories" ), "article=" . urlencode( $wgTitle->getPrefixedDBkey() ) )
+                       . ": " . $t;
+               return "<p class='catlinks'>$s</p>";
+       }
 
        function getQuickbarCompensator( $rows = 1 )
        {
index ed42f8b..d0152e1 100644 (file)
@@ -88,7 +88,7 @@
                        
                        $tpl->setRef( "thispage", &$this->thispage );
                        $tpl->set( "subtitle", $out->getSubtitle() );
-                       $tpl->set( 'catlinks', getCategories());
+                       $tpl->set( 'catlinks', $this->getCategories());
                        if( $wgOut->isSyndicated() ) {
                                $feeds = array();
                                foreach( $wgFeedClasses as $format => $class ) {
index d170f9f..8f2271c 100644 (file)
@@ -459,7 +459,7 @@ $wgLanguageNamesEn =& $wgLanguageNames;
 
 # Bits of text used by many pages:
 #
-"categories" => "Page categories",
+"categories" => "Categories",
 "category" => "category",
 "category_header" => "Articles in category \"$1\"",
 "subcategories" => "Subcategories",
index ebee128..0b8d699 100644 (file)
@@ -159,12 +159,18 @@ $wgEditEncoding           = "x";
 
 # Teksteroj uzataj fare de diversaj paĝoj:
 #
+"categories" => "Kategorioj",
+"category" => "kategorio",
+"category_header" => "Artikoloj en kategorio \"$1\"",
+"subcategories" => "Subkategorioj",
+
 # Tiuj literoj, kiuj aperu kiel parto de la ligilo en formo "[[lingvo]]jn" ktp:
 "linktrail"     => "/^([a-z]+)(.*)\$/sD",
 "mainpage"             => "Ĉefpaĝo",
 "about"                        => "Enkonduko",
 "aboutwikipedia" => "Pri {{SITENAME}}", #FIXME
 "aboutpage"            => "{{ns:4}}:Enkonduko",
+'article'              => "Artikolo",
 "help"                 => "Helpo",
 "helppage"             => "{{ns:4}}:Helpo",
 "wikititlesuffix" => "{{SITENAME}}",
@@ -196,6 +202,7 @@ $wgEditEncoding             = "x";
 "search"               => "Serĉu",
 "go"                   => "Ek",
 "history"              => "Malnovaj versioj",
+"history_short"        => "Historio",
 "printableversion" => "Presebla versio", 
 "editthispage" => "Redaktu la paĝon",
 "deletethispage" => "Forigu la paĝon",
@@ -206,6 +213,8 @@ $wgEditEncoding             = "x";
 "postcomment"   => "Afiŝu komenton",
 "articlepage"  => "Vidu la artikolon",
 "subjectpage"  => "Vidu la artikolon", #FIXME: ?
+"talk"                 => "Diskuto",
+"toolbox"              => "Iloj",
 "userpage"             => "Vidu personan paĝon",
 "wikipediapage"        => "Vidu meta-paĝon",
 "imagepage"            => "Vidu dosieropaĝon",