Ticket #1007: more.translation.enchancement.patch

File more.translation.enchancement.patch, 8.1 KB (added by Simek, 14 years ago)
  • team.inc

     
    174174        }
    175175    }
    176176    row2(tra('New members in last day'), $x);
    177     row2(tra('Total members'), "$team->nusers (<a href=team_members.php?teamid=$team->id&amp;offset=0&amp;sort_by=expavg_credit>".tra('view')."</a>)");
    178     row2(tra('Active members'), "$team->nusers_active (<a href=team_members.php?teamid=$team->id&amp;offset=0&amp;sort_by=expavg_credit>".tra('view')."</a>)");
    179     row2(tra('Members with credit'), "$team->nusers_worked (<a href=team_members.php?teamid=$team->id&amp;offset=0&amp;sort_by=total_credit>".tra('view')."</a>)");
     177        $listurl = "team_members.php?teamid=$team->id&amp;offset=0&amp;sort_by=";
     178    row2(tra('Total members'), '$team->nusers (<a href="'.$listurl.'expavg_credit">'.tra("view").'</a>)');
     179    row2(tra('Active members'), '$team->nusers_active (<a href="'.$listurl.'expavg_credit">'.tra("view").'</a>)');
     180    row2(tra('Members with credit'), '$team->nusers_worked (<a href="'.$listurl.'total_credit">'.tra("view").'</a>)');
    180181    end_table();
    181182}
    182183
     
    211212            if ($sort_by == "total_credit") {
    212213                echo '<th>'.tra('Total credit').'</th>';
    213214            } else {
    214                 echo "<th><a href=team_members.php?teamid=$team->id&amp;sort_by=total_credit&amp;offset=$offset>".tra('Total credit')."</a></th>";
     215                echo '<th><a href="team_members.php?teamid=$team->id&amp;sort_by=total_credit&amp;offset=$offset">'.tra("Total credit").'</a></th>';
    215216            }
    216217            if ($sort_by == "expavg_credit") {
    217218                echo '<th>'.tra('Recent average credit').'</th>';
    218219            } else {
    219                 echo "<th><a href=team_members.php?teamid=$team->id&amp;sort_by=expavg_credit&amp;offset=$offset>".tra('Recent average credit').'</a></th>';
     220                echo '<th><a href="team_members.php?teamid=$team->id&amp;sort_by=expavg_credit&amp;offset=$offset">'.tra("Recent average credit").'</a></th>';
    220221            }
    221222        }
    222223    }
     
    541542    $name_html = BoincDb::escape_string($name_html);
    542543    $description = BoincDb::escape_string($description);
    543544    if (!is_valid_country($country)) {
    544         $country = 'None';
     545        $country = tra("None");
    545546    }
    546547    $country = BoincDb::escape_string($country);  // for Cote d'Ivoire
    547548
  • user.inc

     
    181181    case NOTIFY_SUBSCRIBED_POST:
    182182        return subscribed_post_web_line($notify);
    183183    }
    184     return "Unknown notification type: $notify->type";
     184    return tra("Unknown notification type:")." ".$notify->type;
    185185}
    186186
    187187function weak_auth($user) {
     
    195195    if (is_valid_email_addr($user->email_addr)) {
    196196        $email_text = $user->email_addr;
    197197    } else {
    198         $email_text = "Verification pending";
     198        $email_text = tra("Verification pending");
    199199    }
    200200
    201201    row1(tra("Account information"));
  • util.inc

     
    8989
    9090function show_login($user) {
    9191    if ($user) {
    92         echo "Logged in as %s.\n", $user->name;
    93         echo "<br><a href=\"login_form.php\">Log in as someone else.</a>\n";
     92        echo tra("Logged in as")." ".$user->name.".\n";
     93        echo "<br><a href=\"login_form.php\">".tra("Log in as someone else.")."</a>\n";
    9494    } else {
    95         echo "Not logged in.";
     95        echo tra("Not logged in.");
    9696    }
    9797}
    9898
     
    173173
    174174function db_error_page() {
    175175    page_head("Database error");
    176     echo "A database error occurred while handling your request.
    177         <br>Please try again later.
    178     ";
     176    echo tra("A database error occurred while handling your request.")."<br>".tra("Please try again later.");
    179177    page_tail();
    180178}
    181179
     
    200198    $seconds = (int)($x % 60);
    201199
    202200    $datestring = "";
    203     if ($days) {
    204         $datestring .= "$days days ";
    205     }
    206     if ($hours || strlen($datestring)) {
    207         $datestring .= "$hours hours ";
    208     }
    209     if ($minutes || strlen($datestring)) {
    210         $datestring .= "$minutes min ";
    211     }
    212     if ($seconds) {
    213         $datestring .= "$seconds sec";
    214     }
     201    if ($days)
     202        $datestring .= "$days ".tra("days")." ";
    215203
     204    if ($hours || strlen($datestring))
     205        $datestring .= "$hours ".tra("hours")." ";
     206
     207    if ($minutes || strlen($datestring))
     208        $datestring .= "$minutes ".tra("min")." ";
     209
     210    if ($seconds)
     211        $datestring .= "$seconds ".tra("sec")." ";
     212
    216213    return $datestring;
    217214}
    218215
     
    365362
    366363function check_tokens($auth) {
    367364    if (valid_tokens($auth)) return;
    368     error_page(
    369         "Link has timed out. Please click Back, refresh the page,
    370         and try again."
    371     );
     365    error_page(tra("Link has timed out. Please click Back, refresh the page, and try again."));
    372366}
    373367
    374368function no_computing() {
     
    398392            $trunc = true;
    399393            break;
    400394        }
    401         if ($result) {
     395               
     396        if ($result)
    402397            $result .= " $word";
    403         } else {
     398        else
    404399            $result = $word;
    405         }
    406400    }
    407401
    408     if ($ellipsis && $trunc) {
     402    if ($ellipsis && $trunc)
    409403        $result .= "...";
    410     }
    411404
    412405    return $result;
    413406}
     
    436429        } else {
    437430            $img_url = URL_BASE."img/head_20.png";
    438431        }
    439         $x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img class="userimg" title="View the profile of '.$user->name.'" align="top" src="'.$img_url.'" alt="Profile"></a><br>';
     432        $x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img class="userimg" title="'.tra("View the profile of").' '.$user->name.'" align="top" src="'.$img_url.'" alt="'.tra("Profile").'"></a><br>';
    440433    }
    441     $x .= " <a href=\"".URL_BASE."show_user.php?userid=".$user->id."\">".$user->name."</a>";
     434    $x .= ' <a href="'.URL_BASE.'show_user.php?userid='.$user->id.'">'.$user->name.'</a>';
    442435    if ($user->donated == 1) {
    443436        require_once("../project/donations.inc");
    444437        $x .= DONATION_LINK;
     
    455448    $x = "";
    456449    if ($user->has_profile) {
    457450        $img_url = URL_BASE."img/head_20.png";
    458         $x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img class="userimg" title="View the profile of '.$user->name.'" align="top" src="'.$img_url.'" alt="Profile"></a>';
     451        $x .= ' <a href="'.URL_BASE.'view_profile.php?userid='.$user->id.'"><img class="userimg" title="View the profile of '.$user->name.'" align="top" src="'.$img_url.'" alt="'.tra("Profile").'"></a>';
    459452    }
    460     $x .= " <a href=\"".URL_BASE."show_user.php?userid=".$user->id."\">".$user->name."</a>";
     453    $x .= ' <a href="'.URL_BASE.'show_user.php?userid='.$user->id.'">'.$user->name.'</a>';
    461454    if ($user->donated == 1) {
    462455        require_once("../project/donations.inc");
    463456        $x .= DONATION_LINK;
     
    685678        if ($generating_xml) {
    686679            xml_error(-183);
    687680        } else {
    688             page_head("Project down for maintenance");
    689             echo "This page requires database access.
     681            page_head(tra("Project down for maintenance"));
     682            echo tra("This page requires database access.
    690683                Our database server is temporarily shut down for maintenance.
    691684                Please try again later.
    692             ";
     685            ");
    693686            page_tail();
    694687            exit();
    695688        }
     
    705698    check_web_stopped();
    706699    $retval = db_init_aux($try_replica);
    707700    if ($retval == 1) {
    708         echo "Unable to connect to database - please try again later\n";
    709         echo "Error: ", mysql_errno(), mysql_error();
     701        echo tra("Unable to connect to database - please try again later")."\n";
     702        echo tra("Error:")." ", mysql_errno(), mysql_error();
    710703        exit();
    711704    }
    712705    if ($retval == 2) {
    713         echo "Unable to select database - please try again later";
     706        echo tra("Unable to select database - please try again later");
    714707        echo mysql_error();
    715708        exit();
    716709    }