Changeset 659 for devel/lms

Show
Ignore:
Timestamp:
10/21/06 20:56:09 (2 years ago)
Author:
misja
Message:

Taking gettext to a new level, see message <http://lists.elgg.org/pipermail/development/2006-October/000590.html>. In a nutshell: all gettext calls are replaced by gettext, revamped gettext handling plus some additional fixes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/lms/join.php

    r269 r659  
    4646        // validate 
    4747        if (!preg_match("/^[A-Za-z0-9]{3,12}$/",$u->username)) { 
    48             $messages[] = gettext("Error! Your username must contain letters and numbers only, cannot be blank, and must be between 3 and 12 characters in length."); 
     48            $messages[] = __gettext("Error! Your username must contain letters and numbers only, cannot be blank, and must be between 3 and 12 characters in length."); 
    4949        } 
    5050 
    5151        if (record_exists('users','username',strtolower($u->username))) { 
    52             $messages[] = gettext("The username '$username' is already taken by another user. You will need to pick a different one."); 
     52            $messages[] = __gettext("The username '$username' is already taken by another user. You will need to pick a different one."); 
    5353        } 
    5454 
    5555        if ($u->password1 != $u->password2 || strlen($u->password1) < 6 || strlen($u->password2) > 16) { 
    56             $messages[] = gettext("Error! Invalid password. Your passwords must match and be between 6 and 16 characters in length."); 
     56            $messages[] = __gettext("Error! Invalid password. Your passwords must match and be between 6 and 16 characters in length."); 
    5757        } 
    5858 
    5959        if (empty($u->name)) { 
    60             $messages[] = gettext("Error! You must enter your fullname"); 
     60            $messages[] = __gettext("Error! You must enter your fullname"); 
    6161        } 
    6262 
     
    6969        $alias = $USER->alias; 
    7070        if (!authenticate_account($u->username, md5($u->password1))) { 
    71             $messages[] = gettext('Error! Your username and password does not match our record.'); 
     71            $messages[] = __gettext('Error! Your username and password does not match our record.'); 
    7272        } 
    7373        $USER->alias = $alias; 
    7474        $ident = $USER->ident; 
    7575    } elseif (!empty($mode)) { 
    76         $messages[] = gettext('Fatal Error! Unknown action requested.'); 
     76        $messages[] = __gettext('Fatal Error! Unknown action requested.'); 
    7777    } 
    7878 
     
    103103        unset($USER->alias); 
    104104        if ($mode == 'join') { // we don't need to do these if the user has already had an account. 
    105             $_SESSION['messages'][] = gettext('Your account creation was successful!'); 
     105            $_SESSION['messages'][] = __gettext('Your account creation was successful!'); 
    106106            // authenticate them. 
    107107            authenticate_account($u->username,$u->password); 
     
    115115    templates_page_setup(); 
    116116     
    117     $title = gettext('Join up'); 
     117    $title = __gettext('Join up'); 
    118118    ob_start(); 
    119119    require_once($CFG->dirroot.'lms/join.html'); 
     
    127127                               )); 
    128128 
    129     $title1 = gettext('Login'); 
     129    $title1 = __gettext('Login'); 
    130130    ob_start(); 
    131131    require_once($CFG->dirroot.'lms/login.html'); 
  • devel/lms/rss.php

    r269 r659  
    2626// now start doing the rss feed 
    2727$starttime = time()-(86400*30); 
    28 $rssdescription = sprintf(gettext("Activity for %s, hosted on %s."),$user->name,$CFG->sitename); 
     28$rssdescription = sprintf(__gettext("Activity for %s, hosted on %s."),$user->name,$CFG->sitename); 
    2929$mainurl = $CFG->wwwroot.'_activity/'; 
    3030echo ' 
    3131<rss version="2.0"   xmlns:dc="http://purl.org/dc/elements/1.1/"> 
    3232    <channel xml:base="'.$mainurl.'"> 
    33         <title><![CDATA['.$user->name.' : '.gettext("Activity").']]></title> 
     33        <title><![CDATA['.$user->name.' : '.__gettext("Activity").']]></title> 
    3434        <description><![CDATA['.$rssdescription.']]></description> 
    3535        <link>'.$mainurl.'</link> 
     
    4141                                   WHERE wc.posted >= ? AND wp.owner = ?  
    4242                                   ORDER BY wc.posted DESC LIMIT 10',array($starttime,$user->ident))) { 
    43     $postedby = gettext("%s posted on weblog post:"); 
     43    $postedby = __gettext("%s posted on weblog post:"); 
    4444    foreach($activities as $activity) { 
    4545        $title = sprintf($postedby,stripslashes($activity->postedname)) . " " . stripslashes($activity->weblogtitle); 
     
    6363                                   LEFT JOIN '.$CFG->prefix.'users u ON u.ident = wp.weblog  
    6464                                   WHERE wl.owner = ? AND wc.posted >= ? ORDER BY wc.posted DESC',array($user->ident,$starttime))) { 
    65     $postedby = gettext("%s posted on weblog post '%s'"); 
     65    $postedby = __gettext("%s posted on weblog post '%s'"); 
    6666    foreach($activities as $activity) { 
    6767        $title = sprintf($postedby,stripslashes($activity->postedname), stripslashes($activity->weblogtitle)); 
     
    8181} 
    8282if (empty($something)) { 
    83     $title = gettext('No activity'); 
     83    $title = __gettext('No activity'); 
    8484    $link = $mainurl; 
    8585    echo "