Changeset 659

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/_activity/index.php

    r567 r659  
    2222cleanup_messages(time() - (86400 * 30)); 
    2323 
    24 $title = run("profile:display:name") . " :: " . gettext("Recent activity"); 
     24$title = run("profile:display:name") . " :: " . __gettext("Recent activity"); 
    2525 
    2626// If we haven't specified a start time, start time = 1 day ago 
    2727$starttime = optional_param('starttime',time()-86400,PARAM_INT); 
    2828 
    29 $body = "<p>" . gettext("Currently viewing recent activity since ") . gmstrftime("%B %d, %Y", $starttime) . ".</p>"; 
     29$body = "<p>" . __gettext("Currently viewing recent activity since ") . gmstrftime("%B %d, %Y", $starttime) . ".</p>"; 
    3030 
    31 $body .= "<p>" . gettext("You may view recent activity during the following time-frames:") . "</p>"; 
     31$body .= "<p>" . __gettext("You may view recent activity during the following time-frames:") . "</p>"; 
    3232 
    33 $body .= "<ul><li><a href=\"index.php?starttime=" . (time() - 86400) . "\">" . gettext("The last 24 hours") . "</a></li>"; 
    34 $body .= "<li><a href=\"index.php?starttime=" . (time() - (86400 * 2)) . "\">" . gettext("The last 48 hours") . "</a></li>"; 
    35 $body .= "<li><a href=\"index.php?starttime=" . (time() - (86400 * 7)) . "\">" . gettext("The last week") . "</a></li>"; 
    36 $body .= "<li><a href=\"index.php?starttime=" . (time() - (86400 * 30)) . "\">" . gettext("The last month") . "</a></li></ul>"; 
     33$body .= "<ul><li><a href=\"index.php?starttime=" . (time() - 86400) . "\">" . __gettext("The last 24 hours") . "</a></li>"; 
     34$body .= "<li><a href=\"index.php?starttime=" . (time() - (86400 * 2)) . "\">" . __gettext("The last 48 hours") . "</a></li>"; 
     35$body .= "<li><a href=\"index.php?starttime=" . (time() - (86400 * 7)) . "\">" . __gettext("The last week") . "</a></li>"; 
     36$body .= "<li><a href=\"index.php?starttime=" . (time() - (86400 * 30)) . "\">" . __gettext("The last month") . "</a></li></ul>"; 
    3737 
    38 $body .= "<h2>" . gettext("Your recent messages") . "</h2>"; 
     38$body .= "<h2>" . __gettext("Your recent messages") . "</h2>"; 
    3939 
    4040$user_messages = get_messages($page_owner,null,(time() - $starttime)); 
     
    4747} 
    4848 
    49 $body .= "<h2>" . gettext("Activity on weblog posts you have marked as interesting") . "</h2>"; 
     49$body .= "<h2>" . __gettext("Activity on weblog posts you have marked as interesting") . "</h2>"; 
    5050 
    5151if ($activities = get_records_sql('SELECT wc.*, u.username, u.name as weblogname, wp.weblog, wp.ident AS weblogpost, wp.title AS weblogtitle, wp.weblog AS weblog  
     
    5858    foreach($activities as $activity) { 
    5959        $commentbody = stripslashes($activity->body); 
    60         $commentbody .= "<br /><br /><a href=\"" . url . $activity->username . "/weblog/" . $activity->weblogpost . ".html\">" . gettext("Read more") . "</a>"; 
     60        $commentbody .= "<br /><br /><a href=\"" . url . $activity->username . "/weblog/" . $activity->weblogpost . ".html\">" . __gettext("Read more") . "</a>"; 
    6161        $activity->postedname = stripslashes($activity->postedname); 
    6262        $activity->weblogname = stripslashes($activity->weblogname); 
    6363        if ($activity->weblog == $USER->ident) { 
    64             $activity->weblogname = gettext("your blog"); 
     64            $activity->weblogname = __gettext("your blog"); 
    6565        } 
    6666        if ($activity->owner == $USER->ident) { 
    67             $commentposter = sprintf(gettext("<b>You</b> commented on weblog post '%s' in %s:"), stripslashes($activity->weblogtitle), $activity->weblogname); 
     67            $commentposter = sprintf(__gettext("<b>You</b> commented on weblog post '%s' in %s:"), stripslashes($activity->weblogtitle), $activity->weblogname); 
    6868        } else { 
    69             $commentposter = sprintf(gettext("<b>%s</b> commented on weblog post '%s' in %s:"), $activity->postedname, stripslashes($activity->weblogtitle), $activity->weblogname); 
     69            $commentposter = sprintf(__gettext("<b>%s</b> commented on weblog post '%s' in %s:"), $activity->postedname, stripslashes($activity->weblogtitle), $activity->weblogname); 
    7070        } 
    7171        $body .= templates_draw(array( 
     
    7777    } 
    7878} else { 
    79     $body .= "<p>" . gettext("No activity during this time period.") . "</p>"; 
     79    $body .= "<p>" . __gettext("No activity during this time period.") . "</p>"; 
    8080} 
    8181 
  • devel/_admin/antispam.php

    r296 r659  
    1515                                 
    1616        echo templates_page_draw( array( 
    17                     gettext("Manage users"), 
     17                    __gettext("Manage users"), 
    1818                    templates_draw(array( 
    1919                        'context' => 'contentholder', 
    20                         'title' => gettext("Spam blocking"),  
     20                        'title' => __gettext("Spam blocking"),  
    2121                        'body' => run("admin:spam") 
    2222                    ) 
  • devel/_admin/flags.php

    r296 r659  
    1515                                 
    1616        echo templates_page_draw( array( 
    17                     gettext("Content flags"), 
     17                    __gettext("Content flags"), 
    1818                    templates_draw(array( 
    1919                        'context' => 'contentholder', 
    20                         'title' => gettext("Content flags"),  
     20                        'title' => __gettext("Content flags"),  
    2121                        'body' => run("admin:contentflags") 
    2222                    ) 
  • devel/_admin/index.php

    r296 r659  
    1515                                 
    1616        echo templates_page_draw( array( 
    17                     gettext("Administration"), 
     17                    __gettext("Administration"), 
    1818                    templates_draw(array( 
    1919                        'context' => 'contentholder', 
    20                         'title' => gettext("Administration"),  
     20                        'title' => __gettext("Administration"),  
    2121                        'body' => run("admin:main") 
    2222                    ) 
  • devel/_admin/users.php

    r296 r659  
    1515                                 
    1616        echo templates_page_draw( array( 
    17                     gettext("Manage users"), 
     17                    __gettext("Manage users"), 
    1818                    templates_draw(array( 
    1919                        'context' => 'contentholder', 
    20                         'title' => gettext("Manage users"),  
     20                        'title' => __gettext("Manage users"),  
    2121                        'body' => run("admin:users") 
    2222                    ) 
  • devel/_admin/users_add.php

    r296 r659  
    1515                                 
    1616        echo templates_page_draw( array( 
    17                     gettext("Add multiple users"), 
     17                    __gettext("Add multiple users"), 
    1818                    templates_draw(array( 
    1919                        'context' => 'contentholder', 
    20                         'title' => gettext("Add multiple users"),  
     20                        'title' => __gettext("Add multiple users"),  
    2121                        'body' => run("admin:users:add") 
    2222                    ) 
  • devel/_communities/index.php

    r296 r659  
    2020    //    protect(1); 
    2121         
    22         $title = run("profile:display:name") . " :: " . gettext("Communities"); 
     22        $title = run("profile:display:name") . " :: " . __gettext("Communities"); 
    2323                                 
    2424        echo templates_page_draw( array( 
  • devel/_communities/members.php

    r296 r659  
    2020    //    protect(1); 
    2121         
    22         $title = run("profile:display:name") . " :: " . gettext("Members"); 
     22        $title = run("profile:display:name") . " :: " . __gettext("Members"); 
    2323                                 
    2424        echo templates_page_draw( array( 
  • devel/_communities/owned.php

    r296 r659  
    2020    //    protect(1); 
    2121         
    22         $title = run("profile:display:name") . " :: " . gettext("Owned Communities"); 
     22        $title = run("profile:display:name") . " :: " . __gettext("Owned Communities"); 
    2323                                 
    2424        echo templates_page_draw( array( 
  • devel/_communities/requests.php

    r399 r659  
    2121    //    protect(1); 
    2222         
    23         $title = run("profile:display:name") . " :: ". gettext("Membership requests"); 
     23        $title = run("profile:display:name") . " :: ". __gettext("Membership requests"); 
    2424                                 
    2525        echo templates_page_draw(array( 
  • devel/_elggadmin/configdef.php

    r615 r659  
    11<?php 
    22 
    3             $DEFCFG->config['sitename']->name = gettext("Site name"); 
    4             $DEFCFG->config['sitename']->description = gettext("Name of the site (eg Elgg, Apcala, University of Bogton's Social Network, etc)"); 
    5             $DEFCFG->config['tagline']->name = gettext("Tagline"); 
    6             $DEFCFG->config['tagline']->description = gettext("A tagline for your site (eg 'Social network for Bogton')"); 
    7             $DEFCFG->config['wwwroot']->name = gettext("Web root"); 
    8             $DEFCFG->config['wwwroot']->description = gettext("External URL to the site (eg http://elgg.bogton.edu/). NB: **MUST** have a final slash at the end"); 
    9             $DEFCFG->config['dirroot']->name = gettext("Elgg install root"); 
    10             $DEFCFG->config['dirroot']->description = gettext("Physical path to the files (eg /home/elggserver/httpdocs/). NB: **MUST** have a final slash at the end"); 
    11             $DEFCFG->config['dataroot']->name = gettext("Elgg data root"); 
    12             $DEFCFG->config['dataroot']->description = gettext("This is where uploaded files will go (and sessions for now). If possible, this should live outside your dirroot; **MUST** have a final slash at the end"); 
    13             $DEFCFG->config['sysadminemail']->name = gettext("System administrator email"); 
    14             $DEFCFG->config['sysadminemail']->description = gettext("The email address your site will send email from (eg elgg-admin@bogton.edu)"); 
    15             $DEFCFG->config['newsinitialpassword']->name = gettext("News account initial password"); 
    16             $DEFCFG->config['newsinitialpassword']->description = gettext("The initial password for the 'news' account. This will be the first administrator user within your system, and you should change the password immediately after the first time you log in"); 
    17             $DEFCFG->config['defaultlocale']->name = gettext("Default locale"); 
    18             $DEFCFG->config['defaultlocale']->description = gettext("Country code to set language to if you have gettext installed"); 
    19             $DEFCFG->config['publicreg']->name = gettext("Public registration"); 
    20             $DEFCFG->config['publicreg']->description = gettext("Can general members of the public register for this system?"); 
     3            $DEFCFG->config['sitename']->name = __gettext("Site name"); 
     4            $DEFCFG->config['sitename']->description = __gettext("Name of the site (eg Elgg, Apcala, University of Bogton's Social Network, etc)"); 
     5            $DEFCFG->config['tagline']->name = __gettext("Tagline"); 
     6            $DEFCFG->config['tagline']->description = __gettext("A tagline for your site (eg 'Social network for Bogton')"); 
     7            $DEFCFG->config['wwwroot']->name = __gettext("Web root"); 
     8            $DEFCFG->config['wwwroot']->description = __gettext("External URL to the site (eg http://elgg.bogton.edu/). NB: **MUST** have a final slash at the end"); 
     9            $DEFCFG->config['dirroot']->name = __gettext("Elgg install root"); 
     10            $DEFCFG->config['dirroot']->description = __gettext("Physical path to the files (eg /home/elggserver/httpdocs/). NB: **MUST** have a final slash at the end"); 
     11            $DEFCFG->config['dataroot']->name = __gettext("Elgg data root"); 
     12            $DEFCFG->config['dataroot']->description = __gettext("This is where uploaded files will go (and sessions for now). If possible, this should live outside your dirroot; **MUST** have a final slash at the end"); 
     13            $DEFCFG->config['sysadminemail']->name = __gettext("System administrator email"); 
     14            $DEFCFG->config['sysadminemail']->description = __gettext("The email address your site will send email from (eg elgg-admin@bogton.edu)"); 
     15            $DEFCFG->config['newsinitialpassword']->name = __gettext("News account initial password"); 
     16            $DEFCFG->config['newsinitialpassword']->description = __gettext("The initial password for the 'news' account. This will be the first administrator user within your system, and you should change the password immediately after the first time you log in"); 
     17            $DEFCFG->config['defaultlocale']->name = __gettext("Default locale"); 
     18            $DEFCFG->config['defaultlocale']->description = __gettext("Country code to set language to if you have gettext installed"); 
     19            $DEFCFG->config['publicreg']->name = __gettext("Public registration"); 
     20            $DEFCFG->config['publicreg']->description = __gettext("Can general members of the public register for this system?"); 
    2121            $DEFCFG->config['publicreg']->type = "boolean"; 
    22             $DEFCFG->config['publicinvite']->name = gettext("Public invitations"); 
    23             $DEFCFG->config['publicinvite']->description = gettext("Can users of this system invite other users in?"); 
     22            $DEFCFG->config['publicinvite']->name = __gettext("Public invitations"); 
     23            $DEFCFG->config['publicinvite']->description = __gettext("Can users of this system invite other users in?"); 
    2424            $DEFCFG->config['publicinvite']->type = "boolean"; 
    25             $DEFCFG->config['maxusers']->name = gettext("Maximum users"); 
    26             $DEFCFG->config['maxusers']->description = gettext("The maximum number of users in your system. If you set this to 0, you will have an unlimited number of users"); 
     25            $DEFCFG->config['maxusers']->name = __gettext("Maximum users"); 
     26            $DEFCFG->config['maxusers']->description = __gettext("The maximum number of users in your system. If you set this to 0, you will have an unlimited number of users"); 
    2727            $DEFCFG->config['maxusers']->type = "integer"; 
    28             $DEFCFG->config['maxspace']->name = gettext("Maximum disk space"); 
    29             $DEFCFG->config['maxspace']->description = gettext("The maximum disk space taken up by all uploaded files"); 
     28            $DEFCFG->config['maxspace']->name = __gettext("Maximum disk space"); 
     29            $DEFCFG->config['maxspace']->description = __gettext("The maximum disk space taken up by all uploaded files"); 
    3030            $DEFCFG->config['maxspace']->type = "integer"; 
    31             $DEFCFG->config['walledgarden']->name = gettext("Walled garden"); 
    32             $DEFCFG->config['walledgarden']->description = gettext("If your site is a walled garden, nobody can see anything from the outside. This will also mean that RSS feeds won't work"); 
     31            $DEFCFG->config['walledgarden']->name = __gettext("Walled garden"); 
     32            $DEFCFG->config['walledgarden']->description = __gettext("If your site is a walled garden, nobody can see anything from the outside. This will also mean that RSS feeds won't work"); 
    3333            $DEFCFG->config['walledgarden']->type = "boolean"; 
    34             $DEFCFG->config['emailfilter']->name = gettext("Email filter"); 
    35             $DEFCFG->config['emailfilter']->description = gettext("Anything you enter here must be present in the email address of anyone who registers; e.g. @mycompany.com will only allow email address from mycompany.com to register"); 
    36             $DEFCFG->config['default_access']->name = gettext("Default access"); 
    37             $DEFCFG->config['default_access']->description = gettext("The default access level for all new items in the system"); 
    38             $DEFCFG->config['default_access']->type = gettext("access"); 
    39             $DEFCFG->config['disable_usertemplates']->name = gettext("Disable user templates"); 
    40             $DEFCFG->config['disable_usertemplates']->description = gettext("If this is set, users can only choose from available templates rather than defining their own"); 
     34            $DEFCFG->config['emailfilter']->name = __gettext("Email filter"); 
     35            $DEFCFG->config['emailfilter']->description = __gettext("Anything you enter here must be present in the email address of anyone who registers; e.g. @mycompany.com will only allow email address from mycompany.com to register"); 
     36            $DEFCFG->config['default_access']->name = __gettext("Default access"); 
     37            $DEFCFG->config['default_access']->description = __gettext("The default access level for all new items in the system"); 
     38            $DEFCFG->config['default_access']->type = __gettext("access"); 
     39            $DEFCFG->config['disable_usertemplates']->name = __gettext("Disable user templates"); 
     40            $DEFCFG->config['disable_usertemplates']->description = __gettext("If this is set, users can only choose from available templates rather than defining their own"); 
    4141