Changeset 1561 for trunk/gregarius/cls

Show
Ignore:
Timestamp:
09/09/06 14:52:23 (2 years ago)
Author:
mbonetti
Message:

Yay for gettext localization! This will probably break things big time.
Note that until intl/*.php isn't adapted the the new method, the trunk
won't be localized!

Location:
trunk/gregarius/cls
Files:
13 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/cls/categories.php

    r1549 r1561  
    5858        $this->loadCollapsedState(); 
    5959        $this -> populate(); 
    60         $this ->    columnTitle = LBL_TAG_FOLDERS; 
     60        $this ->    columnTitle = __('Categories'); 
    6161        $GLOBALS['rss']-> feedList = $this; 
    6262    } 
     
    8585     
    8686    function getStats() { 
    87         return sprintf(LBL_CATCNT_PF, $this -> taggedFeedCnt, $this -> tagCnt, 0); 
     87        return sprintf(__('<strong>%d</strong> feeds in <strong>%d</strong> categories'), $this -> taggedFeedCnt, $this -> tagCnt, 0); 
    8888    } 
    8989     
  • trunk/gregarius/cls/channels.php

    r1544 r1561  
    9797 
    9898        if ($unreadCount > 0) { 
    99             $this->rdLbl= sprintf(LBL_UNREAD_PF, "cid$id","",$unreadCount); 
     99            $this->rdLbl= sprintf(__('<strong id="%s" style="%s">(%d unread)</strong>'), "cid$id","",$unreadCount); 
    100100            $this->class_= "feed title unread"; 
    101101        } else { 
     
    151151    var $activeId; 
    152152    var $feedCount = 0; 
    153     var $columnTitle = LBL_H2_CHANNELS; 
     153    var $columnTitle; 
    154154    var $stats; 
    155155     
    156156    function FeedList($activeId) { 
    157157        _pf('FeedList() ctor'); 
     158        $this ->columnTitle= __('Feeds'); 
    158159        $this->activeId = $activeId; 
    159160        $this->loadCollapsedState(); 
     
    191192        _pf(' ... done: feedsCount');                
    192193         
    193         $this ->stats = sprintf(LBL_ITEMCOUNT_PF, $total, $unread, $channelcount); 
     194        $this ->stats = sprintf(__('<strong>%d</strong> items (<strong id="fucnt">%d</strong> unread) in <strong>%d</strong> feeds'), $total, $unread, $channelcount); 
    194195        _pf('done: getStats()'); 
    195196        return $this -> stats; 
  • trunk/gregarius/cls/header.php

    r1181 r1561  
    6060            is_array($cidfid) &&  
    6161            ($uc = getUnreadCount($cidfid['cid'], $cidfid['fid']))) { 
    62             $this->docTitle .= " ($uc ".LBL_UNREAD.")"; 
     62            $this->docTitle .= " ($uc ".__('unread').")"; 
    6363        } 
    6464 
     
    9595         
    9696        $GLOBALS['rss'] -> sideMenu = new SideMenu(); 
    97         $GLOBALS['rss'] -> sideMenu -> addMenu(LBL_H2_CHANNELS,'FeedList' , "_side('FeedList')"); 
    98         $GLOBALS['rss'] -> sideMenu -> addMenu(LBL_TAG_FOLDERS, 'CatList', "_side('CatList')"); 
    99         $GLOBALS['rss'] -> sideMenu -> addMenu(LBL_TAG_TAGS, 'TagList', "_side('TagList')"); 
     97        $GLOBALS['rss'] -> sideMenu -> addMenu(__('Feeds'),'FeedList' , "_side('FeedList')"); 
     98        $GLOBALS['rss'] -> sideMenu -> addMenu(__('Categories'), 'CatList', "_side('CatList')"); 
     99        $GLOBALS['rss'] -> sideMenu -> addMenu(__('Tags'), 'TagList', "_side('TagList')"); 
    100100    } 
    101101 
  • trunk/gregarius/cls/items.php

    r1543 r1561  
    485485    var $_parent; 
    486486    var $pages; 
    487     function ItemListNavigation($il) { 
     487    function ItemListNavigation(&$il) { 
    488488        $this -> _parent = $il; 
    489489        $this -> pages = array(); 
     
    535535            . $this -> _sqlActualWhere; 
    536536        list($this -> numItems) = rss_fetch_row(rss_query($sql)); 
    537         $this -> navigation = new ItemListNavigation(& $this); 
     537        $this -> navigation = new ItemListNavigation($this); 
    538538    } 
    539539} 
  • trunk/gregarius/cls/nav.php

    r1347 r1561  
    6060    function Navigation() { 
    6161     
    62         $this->appendNavItem(getPath(),LBL_NAV_HOME,LOCATION_HOME); 
    63         $this->appendNavItem(getPath().'update.php',LBL_NAV_UPDATE,LOCATION_UPDATE); 
    64         $this->appendNavItem(getPath().'search.php',LBL_NAV_SEARCH,LOCATION_SEARCH); 
    65         $this->appendNavItem(getPath().'admin/',LBL_NAV_CHANNEL_ADMIN,LOCATION_ADMIN); 
     62        $this->appendNavItem(getPath(),__('<span>H</span>ome'),LOCATION_HOME); 
     63        $this->appendNavItem(getPath().'update.php',__('<span>R</span>efresh'),LOCATION_UPDATE); 
     64        $this->appendNavItem(getPath().'search.php',__('<span>S</span>earch'),LOCATION_SEARCH); 
     65        $this->appendNavItem(getPath().'admin/',__('A<span>d</span>min'),LOCATION_ADMIN); 
    6666         
    6767        if (($an = rss_plugin_hook('rss.plugins.afternav', null)) != null) { 
  • trunk/gregarius/cls/search.php

    r1528 r1561  
    211211        if ($this->resultsPerPage != INFINE_RESULTS && $this->itemCount >  $this->resultsPerPage) { 
    212212            $nav .= "<div class=\"readmore\">"; 
    213             $nav .= LBL_SEARCH_RESULTS; 
     213            $nav .= __('Results: '); 
    214214 
    215215            // first page 
  • trunk/gregarius/cls/taglist.php

    r1181 r1561  
    6767    function TagList() { 
    6868        $this -> populate(); 
    69         $this ->    columnTitle = LBL_TAG_TAGS; 
     69        $this ->    columnTitle = __('Tags'); 
    7070        $GLOBALS['rss']-> feedList = $this; 
    7171    } 
     
    8484     
    8585    function getStats() { 
    86         return sprintf(LBL_TAGCOUNT_PF, $this -> countTaggedItems, $this->tagCount); 
     86        return sprintf(__('<strong>%d</strong> tagged items, in <strong>%d</strong> tags'), $this -> countTaggedItems, $this->tagCount); 
    8787    } 
    8888     
  • trunk/gregarius/cls/update.php

    r1544 r1561  
    116116        if ($error & MAGPIE_FEED_ORIGIN_CACHE) { 
    117117            if ($error & MAGPIE_FEED_ORIGIN_HTTP_304) { 
    118                 $label = LBL_UPDATE_NOT_MODIFIED; 
     118                $label = __('OK (304 Not modified)'); 
    119119                $cls = ERROR_NOERROR; 
    120120            } 
    121121            elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_TIMEOUT) { 
    122                 $label = LBL_UPDATE_CACHE_TIMEOUT; 
     122                $label = __('HTTP Timeout (Local cache)'); 
    123123                $cls = ERROR_WARNING; 
    124124            } 
    125125            elseif ($error & MAGPIE_FEED_ORIGIN_NOT_FETCHED) { 
    126                 $label = LBL_UPDATE_STATUS_CACHED; 
     126                $label = __('OK (Local cache)'); 
    127127                $cls = ERROR_NOERROR; 
    128128            } 
    129129            elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_404) { 
    130                 $label = LBL_UPDATE_NOT_FOUND; 
     130                $label = __('404 Not Found (Local cache)'); 
    131131                $cls = ERROR_ERROR; 
    132132            } 
     
    137137        } 
    138138        elseif ($error & MAGPIE_FEED_ORIGIN_HTTP_200) { 
    139             $label = LBL_UPDATE_STATUS_OK; 
     139            $label = __('OK (HTTP 200)'); 
    140140            $cls = ERROR_NOERROR; 
    141141        } 
    142142        else { 
    143143            if (is_numeric($error)) { 
    144                 $label = LBL_UPDATE_STATUS_ERROR; 
     144                $label = __('ERROR'); 
    145145                $cls = ERROR_ERROR; 
    146146            } else { 
     
    177177 
    178178        echo 
    179         "<h2>".sprintf(LBL_UPDATE_H2, count($this -> chans))."</h2>\n" 
     179        "<h2>".sprintf(__('Updating %d Feeds...'), count($this -> chans))."</h2>\n" 
    180180        ."<table id=\"updatetable\">\n" 
    181181        ."<tr>\n" 
    182         ."<th class=\"lc\">".LBL_UPDATE_CHANNEL."</th>\n" 
    183         ."<th class=\"mc\">".LBL_UPDATE_STATUS."</th>\n" 
    184         ."<th class=\"rc\">".LBL_UPDATE_UNREAD."</th>\n" 
     182        ."<th class=\"lc\">".__('Feed')."</th>\n" 
     183        ."<th class=\"mc\">".__('Status')."</th>\n" 
     184        ."<th class=\"rc\">".__('New Items')."</th>\n" 
    185185        ."</tr>"; 
    186186 
     
    239239    function render() { 
    240240 
    241         echo "<h2 style=\"margin-bottom:1em;\">". sprintf(LBL_UPDATE_H2,count($this -> chans)) ."</h2>\n"; 
     241        echo "<h2 style=\"margin-bottom:1em;\">". sprintf(__('Updating %d Feeds...'),count($this -> chans)) ."</h2>\n"; 
    242242 
    243243        echo "<table id=\"updatetable\">\n" 
    244244        ."<tr>\n" 
    245         ."<th class=\"lc\">".LBL_UPDATE_CHANNEL."</th>\n" 
    246         ."<th class=\"mc\">".LBL_UPDATE_STATUS."</th>\n" 
    247         ."<th class=\"rc\">".LBL_UPDATE_UNREAD."</th>\n" 
     245        ."<th class=\"lc\">".__('Feed')."</th>\n" 
     246        ."<th class=\"mc\">".__('Status')."</th>\n" 
     247        ."<th class=\"rc\">".__('New Items')."</th>\n" 
    248248        ."</tr>\n"; 
    249249 
     
    296296 
    297297            list($label,$cls) = parent::magpieError($error); 
    298             echo "\n$label, $unread " . LBL_UPDATE_UNREAD . "\n\n"; 
     298            echo "\n$label, $unread " . __('New Items') . "\n\n"; 
    299299            flush(); 
    300300 
     
    325325            $unread = count($unreadIds); 
    326326            list($label,$cls) = parent::magpieError($error); 
    327             echo "\n$label, $unread " . LBL_UPDATE_UNREAD . "<br />"; 
     327            echo "\n$label, $unread " . __('New Items') . "<br />"; 
    328328            flush(); 
    329329    } 
     
    357357                                echo "$title ...\t"; 
    358358                                flush(); 
    359                                 echo "\n$label, $unread " . LBL_UPDATE_UNREAD . "\n\n"; 
     359                                echo "\n$label, $unread " . __('New Items') . "\n\n"; 
    360360                                flush(); 
    361361                        } 
  • trunk/gregarius/cls/wrappers/feeds.php

    r1315 r1561  
    6060} 
    6161 
    62 function rss_feeds_folders_unread_count($label=LBL_UNREAD_PF) { 
     62function rss_feeds_folders_unread_count($label=null) { 
     63    if ($label === null) { 
     64        $label=__('<strong id="%s" style="%s">(%d unread)</strong>'); 
     65    } 
    6366    if (array_key_exists($GLOBALS['rss']->currentFeedsFolder->id,$GLOBALS['rss']->feedList->collapsed_folders)) {  
    6467        $sCls = ($GLOBALS['rss']->currentFeedsFolder->isCollapsed?"display:inline":"display:none"); 
     
    6871 
    6972        switch( $GLOBALS['rss']->feedList -> columnTitle ) { 
    70             case LBL_TAG_FOLDERS: 
     73            case __('Categories'): 
    7174                $ret = rss_plugin_hook("rss.plugins.sidemenu.categoryunreadlabel", $ret); 
    7275                break; 
    73             case LBL_H2_CHANNELS: 
     76            case __('Feeds'): 
    7477                $ret = rss_plugin_hook("rss.plugins.sidemenu.folderunreadlabel", $ret); 
    7578                break; 
  • trunk/gregarius/cls/wrappers/header.php

    r1500 r1561  
    132132function rss_footer_last_modif() { 
    133133    $ts = getLastModif(); 
    134     return ($ts ? rss_locale_date ("%c", $ts) : LBL_FOOTER_LAST_MODIF_NEVER); 
     134    return ($ts ? rss_locale_date ("%c", $ts) : __('Never')); 
    135135} 
    136136 
     
    140140     
    141141    if (rss_user_level() > RSS_USER_LEVEL_NOLEVEL) { 
    142         $ret .= sprintf(LBL_LOGGED_IN_AS, rss_user_name()) 
    143                 ."&nbsp;|&nbsp;<a href=\"".getPath()."?logout\">".LBL_LOG_OUT."</a>\n"; 
     142        $ret .= sprintf(__('Logged in as <strong>%s</strong>'), rss_user_name()) 
     143                ."&nbsp;|&nbsp;<a href=\"".getPath()."?logout\">".__('Logout')."</a>\n"; 
    144144    } else { 
    145         $ret .= LBL_NOT_LOGGED_IN 
    146                 ."&nbsp;|&nbsp;<a href=\"#\" onclick=\"miniloginform(); return false;\">".LBL_LOG_IN."</a>"; 
     145        $ret .= __('Not logged in') 
     146                ."&nbsp;|&nbsp;<a href=\"#\" onclick=\"miniloginform(); return false;\">".__('Login')."</a>"; 
    147147        $ret .= "<div style=\"display:none\" id=\"loginformcontainer\">" 
    148148                         . '<form ' . 'onsubmit="return loginHandler();" ' . 'method="post" action="'.getPath().'">' 
    149149                         . '<div style="display:inline"><input style=" width:50px;" name="username" id="username" type="text" /></div>' 
    150150                         . '<div style="display:inline"><input style=" width:50px;" name="password" id="password"  type="password" /></div>' 
    151                          . '<div style="display:inline"><input type="submit" value="'.LBL_LOG_IN.'" /></div>' 
     151                         . '<div style="display:inline"><input type="submit" value="'.__('Login').'" /></div>' 
    152152                         . '</form>' 
    153153                 ."</div>\n"; 
  • trunk/gregarius/cls/wrappers/item.php

    r1536 r1561  
    4141} 
    4242 
    43 function rss_item_pl_title($label=LBL_PL_FOR) { 
    44      
     43function rss_item_pl_title($label=null){ 
     44    if (null === $label) { 
     45        $label = __('Permalink for '); 
     46    } 
    4547    if (getConfig('rss.output.usepermalinks')) { 
    4648        list ($ply, $plm, $pld) = explode(":", rss_date("Y:m:d", $GLOBALS['rss'] -> currentItem -> date, false)); 
     
    197199        }        
    198200*/ 
    199         return (($GLOBALS['rss']->currentItem->isPubDate?LBL_POSTED:LBL_FETCHED). $date_lbl);            
     201        return (($GLOBALS['rss']->currentItem->isPubDate?__('Posted: '):__('Fetched: ')). $date_lbl);            
    200202    } 
    201203} 
     
    218220            $a = "<a href=\"".getPath() ."author.php?author=$ea\">$a</a>"; 
    219221        } 
    220     return LBL_BY . $a; 
     222    return __(' by ') . $a; 
    221223  } 
    222224} 
  • trunk/gregarius/cls/wrappers/searchform.php

    r1544 r1561  
    8585    ."\t\t\t<option value=\"".INFINE_RESULTS."\"" 
    8686    .((array_key_exists(QUERY_RESULTS,$_REQUEST) && $_REQUEST[QUERY_RESULTS] == INFINE_RESULTS?" selected=\"selected\"":"")) 
    87     .">".LBL_ALL."</option>\n" 
     87    .">".__('All')."</option>\n" 
    8888    ."\t\t</select>"; 
    8989} 
     
    9494      ."\t\t\t<option value=\"". ALL_CHANNELS_ID ."\"" 
    9595      .((!array_key_exists(QUERY_CHANNEL,$_REQUEST) || $_REQUEST[QUERY_CHANNEL] == ALL_CHANNELS_ID)?" selected=\"selected\"":"") 
    96       .">" . LBL_ALL  . "</option>\n"; 
     96      .">" . __('All')  . "</option>\n"; 
    9797 
    9898    $sql = "select " 
     
    120120            } 
    121121            if ($parent_ == "") { 
    122                 $parent_ = LBL_HOME_FOLDER; 
     122                $parent_ = __('Root'); 
    123123            } 
    124124            $ret .= "\t\t\t<optgroup label=\"$parent_ /\">\n"; 
  • trunk/gregarius/cls/wrappers/toolkit.php

    r1551 r1561  
    4040        $ret .= "\t<option value=\"$id\"" 
    4141        .($selected > -1 && $selected == $id ? " selected=\"selected\"":"") 
    42         .">" .  (($name == "")?LBL_HOME_FOLDER:$name)  ."</option>\n"; 
     42        .">" .  (($name == "")?__('Root'):$name)  ."</option>\n"; 
    4343    } 
    4444    $ret .= "</select>\n"; 
     
    5151      ."\t\t\t<option value=\"". $all_channels_id ."\"" 
    5252      .(0 == $selected?" selected=\"selected\"":"") 
    53     .">" . LBL_ALL  . "</option>\n"; 
     53    .">" . __('All')  . "</option>\n"; 
    5454 
    5555  $sql = "select " 
     
    7979      } 
    8080      if ($parent_ == "") { 
    81         $parent_ = LBL_HOME_FOLDER; 
     81        $parent_ = __('Root'); 
    8282      } 
    8383      $ret .= "\t\t\t<optgroup label=\"$parent_ /\">\n";