summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-06-22 20:57:07 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-06-22 20:57:07 +0200
commit58907e0bffb5a7d2d0bfc05cec28f366432bb3e8 (patch)
treed0567e509e8769d2b1363af45c1b48cf18563715
parentadbb59308024bfb6386eaa4a9d1a2eb6591b8456 (diff)
downloadaur-gettext.tar.gz
aur-gettext.tar.xz
use php's gettext modulegettext
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--web/html/account.php24
-rw-r--r--web/html/addvote.php28
-rw-r--r--web/html/index.php16
-rw-r--r--web/html/packages.php8
-rw-r--r--web/html/passreset.php32
-rw-r--r--web/html/pkgsubmit.php44
-rw-r--r--web/html/tu.php22
-rw-r--r--web/lib/acctfuncs.inc.php124
-rw-r--r--web/lib/aur.inc.php11
-rw-r--r--web/lib/gettext.php432
-rw-r--r--web/lib/pkgfuncs.inc.php86
-rw-r--r--web/lib/translator.inc.php50
-rw-r--r--web/template/actions_form.php20
-rw-r--r--web/template/header.php16
-rw-r--r--web/template/login_form.php14
-rw-r--r--web/template/pkg_comment_form.php8
-rw-r--r--web/template/pkg_comments.php6
-rw-r--r--web/template/pkg_details.php28
-rw-r--r--web/template/pkg_search_form.php30
-rw-r--r--web/template/pkg_search_results.php52
-rw-r--r--web/template/search_accounts_form.php36
-rw-r--r--web/template/stats/general_stats_table.php18
-rw-r--r--web/template/stats/updates_table.php2
-rw-r--r--web/template/stats/user_table.php6
-rw-r--r--web/template/template.phps4
-rw-r--r--web/template/tu_details.php32
-rw-r--r--web/template/tu_list.php20
27 files changed, 344 insertions, 825 deletions
diff --git a/web/html/account.php b/web/html/account.php
index ca05d1ac..fe1a45fc 100644
--- a/web/html/account.php
+++ b/web/html/account.php
@@ -8,12 +8,12 @@ include_once('acctfuncs.inc.php'); # access Account specific functions
set_lang(); # this sets up the visitor's language
check_sid(); # see if they're still logged in
-html_header(__('Accounts'));
+html_header(_('Accounts'));
# Main page processing here
#
echo "<div class=\"pgbox\">\n";
-echo " <div class=\"pgboxtitle\"><span class=\"f3\">".__("Accounts")."</span></div>\n";
+echo " <div class=\"pgboxtitle\"><span class=\"f3\">"._("Accounts")."</span></div>\n";
echo " <div class=\"pgboxbody\">\n";
$action = in_request("Action");
@@ -38,7 +38,7 @@ if (isset($_COOKIE["AURSID"])) {
} else {
# a non-privileged user is trying to access the search page
#
- print __("You are not allowed to access this area.")."<br />\n";
+ print _("You are not allowed to access this area.")."<br />\n";
}
} elseif ($action == "DisplayAccount") {
@@ -50,7 +50,7 @@ if (isset($_COOKIE["AURSID"])) {
$q.= "AND Users.ID = ".intval(in_request("ID"));
$result = db_query($q, $dbh);
if (!mysql_num_rows($result)) {
- print __("Could not retrieve information for the specified user.");
+ print _("Could not retrieve information for the specified user.");
} else {
$row = mysql_fetch_assoc($result);
@@ -58,7 +58,7 @@ if (isset($_COOKIE["AURSID"])) {
# double check to make sure logged in user can edit this account
#
if ($atype == "User" || ($atype == "Trusted User" && $row["AccountType"] == "Developer")) {
- print __("You do not have permission to edit this account.");
+ print _("You do not have permission to edit this account.");
} else {
display_account_form($atype, "UpdateAccount", $row["Username"],
@@ -77,7 +77,7 @@ if (isset($_COOKIE["AURSID"])) {
$q.= "AND Users.ID = ".intval(in_request("ID"));
$result = db_query($q, $dbh);
if (!mysql_num_rows($result)) {
- print __("Could not retrieve information for the specified user.");
+ print _("Could not retrieve information for the specified user.");
} else {
$row = mysql_fetch_assoc($result);
display_account_info($row["Username"],
@@ -99,7 +99,7 @@ if (isset($_COOKIE["AURSID"])) {
if ($atype == "Trusted User" || $atype == "Developer") {
# display the search page if they're a TU/dev
#
- print __("Use this form to search existing accounts.")."<br />\n";
+ print _("Use this form to search existing accounts.")."<br />\n";
search_accounts_form();
} else {
@@ -114,16 +114,16 @@ if (isset($_COOKIE["AURSID"])) {
$q.= mysql_real_escape_string($_COOKIE["AURSID"])."'";
$result = db_query($q, $dbh);
if (!mysql_num_rows($result)) {
- print __("Could not retrieve information for the specified user.");
+ print _("Could not retrieve information for the specified user.");
} else {
$row = mysql_fetch_assoc($result);
# don't need to check if they have permissions, this is a
# normal user editing themselves.
#
- print __("Use this form to update your account.");
+ print _("Use this form to update your account.");
print "<br />";
- print __("Leave the password fields blank to keep your same password.");
+ print _("Leave the password fields blank to keep your same password.");
display_account_form($atype, "UpdateAccount", $row["Username"],
$row["AccountType"], $row["Suspended"], $row["Email"],
"", "", $row["RealName"], $row["LangPreference"],
@@ -136,7 +136,7 @@ if (isset($_COOKIE["AURSID"])) {
# visitor is not logged in
#
if ($action == "AccountInfo") {
- print __("You must log in to view user information.");
+ print _("You must log in to view user information.");
} elseif ($action == "NewAccount") {
# process the form input for creating a new account
#
@@ -148,7 +148,7 @@ if (isset($_COOKIE["AURSID"])) {
} else {
# display the account request form
#
- print __("Use this form to create an account.");
+ print _("Use this form to create an account.");
display_account_form("", "NewAccount");
}
}
diff --git a/web/html/addvote.php b/web/html/addvote.php
index fe3037d5..bde0f19d 100644
--- a/web/html/addvote.php
+++ b/web/html/addvote.php
@@ -30,7 +30,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
}
if ($check == 0) {
- $error.= __("Username does not exist.");
+ $error.= _("Username does not exist.");
} else {
$qcheck = "SELECT * FROM TU_VoteInfo WHERE User = '" . mysql_real_escape_string($_POST['user']) . "'";
$qcheck.= " AND End > UNIX_TIMESTAMP()";
@@ -43,16 +43,16 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
}
if ($check != 0) {
- $error.= __("%s already has proposal running for them.", htmlentities($_POST['user']));
+ $error.= sprintf(_("%s already has proposal running for them."), htmlentities($_POST['user']));
}
}
}
if (!empty($_POST['length'])) {
if (!is_numeric($_POST['length'])) {
- $error.= __("Length must be a number.") ;
+ $error.= _("Length must be a number.") ;
} else if ($_POST['length'] < 1) {
- $error.= __("Length must be at least 1.");
+ $error.= _("Length must be at least 1.");
} else {
$len = (60*60*24)*$_POST['length'];
}
@@ -61,7 +61,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
}
if (empty($_POST['agenda'])) {
- $error.= __("Proposal cannot be empty.");
+ $error.= _("Proposal cannot be empty.");
}
}
@@ -73,7 +73,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$q.= ", " . uid_from_sid($_COOKIE["AURSID"]) . ")";
db_query($q, $dbh);
- print "<p class=\"pkgoutput\">" . __("New proposal submitted.") . "</p>\n";
+ print "<p class=\"pkgoutput\">" . _("New proposal submitted.") . "</p>\n";
} else {
?>
@@ -82,24 +82,24 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
<?php endif; ?>
<div class="pgbox">
-<div class="pgboxtitle"><?php print __("Submit a proposal to vote on.") ?></div>
+<div class="pgboxtitle"><?php print _("Submit a proposal to vote on.") ?></div>
<div class="pgboxbody">
<form action='addvote.php' method='post'>
<p>
-<b><?php print __('Applicant/TU') ?></b>
+<b><?php print _('Applicant/TU') ?></b>
<input type='text' name='user' value='<?php if (!empty($_POST['user'])) { print htmlentities($_POST['user'], ENT_QUOTES); } ?>' />
-<?php print __("(empty if not applicable)") ?>
+<?php print _("(empty if not applicable)") ?>
</p>
<p>
-<b><?php print __('Length in days') ?></b>
+<b><?php print _('Length in days') ?></b>
<input type='text' name='length' value='<?php if (!empty($_POST['length'])) { print htmlentities($_POST['length'], ENT_QUOTES); } ?>' />
-<?php print __("(defaults to 7 if empty)") ?>
+<?php print _("(defaults to 7 if empty)") ?>
</p>
<p>
-<b><?php print __('Proposal') ?></b><br />
+<b><?php print _('Proposal') ?></b><br />
<textarea name='agenda' rows='25' cols='80'><?php if (!empty($_POST['agenda'])) { print htmlentities($_POST['agenda']); } ?></textarea><br />
<input type='hidden' name='addVote' value='1' />
-<input type='submit' class='button' value='<?php print __('Submit'); ?>' />
+<input type='submit' class='button' value='<?php print _('Submit'); ?>' />
</p>
</form>
</div>
@@ -107,7 +107,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
<?php
}
} else {
- print __("You are not allowed to access this area.");
+ print _("You are not allowed to access this area.");
}
html_footer(AUR_VERSION);
diff --git a/web/html/index.php b/web/html/index.php
index ffc5f008..4cda1394 100644
--- a/web/html/index.php
+++ b/web/html/index.php
@@ -8,7 +8,7 @@ check_sid();
include_once('stats.inc.php');
-html_header( __("Home") );
+html_header( _("Home") );
include('pkg_search_form.php');
@@ -18,13 +18,13 @@ $dbh = db_connect();
<div class="pgbox">
<div class="pgboxtitle">
-<span class="f3">AUR <?php print __("Home"); ?></span>
+<span class="f3">AUR <?php print _("Home"); ?></span>
</div>
<div class="frontpgboxbody">
<p>
<?php
-echo __(
+echo _(
'Welcome to the AUR! Please read the %hAUR User Guidelines%h and %hAUR TU Guidelines%h for more information.',
'<a href="http://wiki.archlinux.org/index.php/AUR_User_Guidelines">',
'</a>',
@@ -36,7 +36,7 @@ echo __(
<br />
<?php
-echo __(
+echo _(
'Contributed PKGBUILDs %hmust%h conform to the %hArch Packaging Standards%h otherwise they will be deleted!',
'<b>', '</b>',
'<a href="http://wiki.archlinux.org/index.php/Arch_Packaging_Standards">',
@@ -46,9 +46,9 @@ echo __(
</p>
<p>
-<?php echo __('Remember to vote for your favourite packages!'); ?>
+<?php echo _('Remember to vote for your favourite packages!'); ?>
<br />
-<?php echo __('Some packages may be provided as binaries in [community].'); ?>
+<?php echo _('Some packages may be provided as binaries in [community].'); ?>
</p>
<table border='0' cellpadding='0' cellspacing='3' width='90%'>
<tr>
@@ -72,8 +72,8 @@ general_stats_table($dbh);
<br />
<div class="important"><?php
-echo __('DISCLAIMER') . ':<br />';
-echo __('Unsupported packages are user produced content. Any use of the provided files is at your own risk.');
+echo _('DISCLAIMER') . ':<br />';
+echo _('Unsupported packages are user produced content. Any use of the provided files is at your own risk.');
?></div>
</div>
diff --git a/web/html/packages.php b/web/html/packages.php
index 4a1fa881..26fe84be 100644
--- a/web/html/packages.php
+++ b/web/html/packages.php
@@ -11,9 +11,9 @@ check_sid(); # see if they're still logged in
if (isset($_GET['ID']) && ($pkgname = pkgname_from_id($_GET['ID']))) {
$title = $pkgname;
} else if (!empty($_GET['K'])) {
- $title = __("Search Criteria") . ": " . $_GET['K'];
+ $title = _("Search Criteria") . ": " . $_GET['K'];
} else {
- $title = __("Packages");
+ $title = _("Packages");
}
# Retrieve account type
@@ -54,7 +54,7 @@ if (current_action("do_Flag")) {
unset($_GET['ID']);
}
else {
- $output = __("The selected packages have not been deleted, check the confirmation checkbox.");
+ $output = _("The selected packages have not been deleted, check the confirmation checkbox.");
}
} elseif (current_action("do_Notify")) {
$output = pkg_notify($atype, $ids);
@@ -77,7 +77,7 @@ html_header($title);
if (isset($_GET['ID'])) {
include('pkg_search_form.php');
if (!$_GET['ID'] = intval($_GET['ID'])) {
- print __("Error trying to retrieve package details.")."<br />\n";
+ print _("Error trying to retrieve package details.")."<br />\n";
} else {
if (isset($_COOKIE["AURSID"])) {
package_details($_GET['ID'], $_COOKIE["AURSID"]);
diff --git a/web/html/passreset.php b/web/html/passreset.php
index ed5d4d31..90878319 100644
--- a/web/html/passreset.php
+++ b/web/html/passreset.php
@@ -22,11 +22,11 @@ if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confir
$uid = uid_from_email($email);
if (empty($email) || empty($password)) {
- $error = __('Missing a required field.');
+ $error = _('Missing a required field.');
} elseif ($password != $confirm) {
- $error = __('Password fields do not match.');
+ $error = _('Password fields do not match.');
} elseif ($uid == NULL || $uid == 'None') {
- $error = __('Invalid e-mail.');
+ $error = _('Invalid e-mail.');
}
if (empty($error)) {
@@ -44,7 +44,7 @@ if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confir
AND Email = '".mysql_real_escape_string($email)."'";
$result = db_query($q, $dbh);
if (!mysql_affected_rows($dbh)) {
- $error = __('Invalid e-mail and reset key combination.');
+ $error = _('Invalid e-mail and reset key combination.');
} else {
header('Location: passreset.php?step=complete');
exit();
@@ -62,7 +62,7 @@ if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confir
WHERE ID = " . $uid;
db_query($q, $dbh);
# Send email with confirmation link
- $body = __('A password reset request was submitted for the account '.
+ $body = _('A password reset request was submitted for the account '.
'associated with your e-mail address. If you wish to reset '.
'your password follow the link below, otherwise ignore '.
'this message and nothing will happen.').
@@ -80,13 +80,13 @@ if (isset($_GET['resetkey'], $_POST['email'], $_POST['password'], $_POST['confir
$step = isset($_GET['step']) ? $_GET['step'] : NULL;
-html_header(__("Password Reset"));
+html_header(_("Password Reset"));
?>
<div class="pgbox">
<div class="pgboxtitle">
- <span class="f3"><?php print __("Password Reset"); ?></span>
+ <span class="f3"><?php print _("Password Reset"); ?></span>
</div>
<div class="pgboxbody">
<?php
@@ -96,39 +96,39 @@ html_header(__("Password Reset"));
?>
<?php
if ($step == 'confirm') {
- echo __('Check your e-mail for the confirmation link.');
+ echo _('Check your e-mail for the confirmation link.');
} elseif ($step == 'complete') {
- echo __('Your password has been reset successfully.');
+ echo _('Your password has been reset successfully.');
} elseif (isset($_GET['resetkey'])) {
?>
<form action="" method="post">
<table>
<tr>
- <td><?php echo __("Confirm your e-mail address:"); ?></td>
+ <td><?php echo _("Confirm your e-mail address:"); ?></td>
<td><input type="text" name="email" size="30" maxlength="64" /></td>
</tr>
<tr>
- <td><?php echo __("Enter your new password:"); ?></td>
+ <td><?php echo _("Enter your new password:"); ?></td>
<td><input type="password" name="password" size="30" maxlength="32" /></td>
</tr>
<tr>
- <td><?php echo __("Confirm your new password:"); ?></td>
+ <td><?php echo _("Confirm your new password:"); ?></td>
<td><input type="password" name="confirm" size="30" maxlength="32" /></td>
</tr>
</table>
<br />
- <input type="submit" class="button" value="<?php echo __('Continue') ?>" />
+ <input type="submit" class="button" value="<?php echo _('Continue') ?>" />
</form>
<?php
} else {
?>
- <p><?php echo __('If you have forgotten the e-mail address you used to register, please send a message to the %haur-general%h mailing list.',
+ <p><?php echo _('If you have forgotten the e-mail address you used to register, please send a message to the %haur-general%h mailing list.',
'<a href="http://mailman.archlinux.org/mailman/listinfo/aur-general">',
'</a>'); ?></p>
<form action="" method="post">
- <p><?php echo __("Enter your e-mail address:"); ?>
+ <p><?php echo _("Enter your e-mail address:"); ?>
<input type="text" name="email" size="30" maxlength="64" /></p>
- <input type="submit" class="button" value="<?php echo __('Continue') ?>" />
+ <input type="submit" class="button" value="<?php echo _('Continue') ?>" />
</form>
<?php } ?>
</div>
diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php
index b5fe3b7e..5a83c215 100644
--- a/web/html/pkgsubmit.php
+++ b/web/html/pkgsubmit.php
@@ -29,7 +29,7 @@ if ($uid):
# Before processing, make sure we even have a file
if ($_FILES['pfile']['size'] == 0){
- $error = __("Error - No file uploaded");
+ $error = _("Error - No file uploaded");
}
# Check whether the file is gzip'ed
@@ -39,7 +39,7 @@ if ($uid):
list(, $magic) = unpack('v', fread($fh, 2));
if ($magic != 0x8b1f) {
- $error = __("Error - unsupported file format (please submit gzip'ed tarballs generated by makepkg(8) only).");
+ $error = _("Error - unsupported file format (please submit gzip'ed tarballs generated by makepkg(8) only).");
}
}
@@ -49,7 +49,7 @@ if ($uid):
list(, $filesize_uncompressed) = unpack('V', fread($fh, 4));
if ($filesize_uncompressed > $MAX_FILESIZE_UNCOMPRESSED) {
- $error = __("Error - uncompressed file size too large.");
+ $error = _("Error - uncompressed file size too large.");
}
}
@@ -70,22 +70,22 @@ if ($uid):
}
elseif (preg_match('/^[^\/]+\/$/', $tar_file['filename'])) {
if (++$dircount > 1) {
- $error = __("Error - source tarball may not contain more than one directory.");
+ $error = _("Error - source tarball may not contain more than one directory.");
break;
}
}
elseif (preg_match('/^[^\/]+$/', $tar_file['filename'])) {
- $error = __("Error - source tarball may not contain files outside a directory.");
+ $error = _("Error - source tarball may not contain files outside a directory.");
break;
}
elseif (preg_match('/^[^\/]+\/[^\/]+\//', $tar_file['filename'])) {
- $error = __("Error - source tarball may not contain nested subdirectories.");
+ $error = _("Error - source tarball may not contain nested subdirectories.");
break;
}
}
if (!$error && empty($pkgbuild_raw)) {
- $error = __("Error trying to unpack upload - PKGBUILD does not exist.");
+ $error = _("Error trying to unpack upload - PKGBUILD does not exist.");
}
}
@@ -179,7 +179,7 @@ if ($uid):
$req_vars = array("url", "pkgdesc", "license", "pkgrel", "pkgver", "arch", "pkgname");
foreach ($req_vars as $var) {
if (!array_key_exists($var, $pkgbuild)) {
- $error = __('Missing %s variable in PKGBUILD.', $var);
+ $error = sprintf(_('Missing %s variable in PKGBUILD.', $var);
break;
}
}
@@ -195,7 +195,7 @@ if ($uid):
if (!$error) {
$parsed_url = parse_url($pkgbuild['url']);
if (!$parsed_url['scheme']) {
- $error = __("Package URL is missing a protocol (ie. http:// ,ftp://)");
+ $error = _("Package URL is missing a protocol (ie. http:// ,ftp://)");
}
}
@@ -251,7 +251,7 @@ if ($uid):
$presult = preg_match("/^[a-z0-9][a-z0-9\.+_-]*$/", $pkg_name);
if (!$presult) {
- $error = __("Invalid name: only lowercase letters are allowed.");
+ $error = _("Invalid name: only lowercase letters are allowed.");
}
}
@@ -269,17 +269,17 @@ if ($uid):
}
if (!@mkdir($incoming_pkgdir)) {
- $error = __( "Could not create directory %s.", $incoming_pkgdir);
+ $error = sprintf(_( "Could not create directory %s."), $incoming_pkgdir);
}
} else {
- $error = __( "You are not allowed to overwrite the %h%s%h package.", "<b>", $pkg_name, "</b>");
+ $error = sprintf(_( "You are not allowed to overwrite the %h%s%h package."), "<b>", $pkg_name, "</b>");
}
if (!$error) {
# Check if package name is blacklisted.
if (!$pkg_exists && pkgname_is_blacklisted($pkg_name)) {
if (!canSubmitBlacklisted(account_from_sid($_COOKIE["AURSID"]))) {
- $error = __( "%s is on the package blacklist, please check if it's available in the official repos.", $pkg_name);
+ $error = sprintf(_( "%s is on the package blacklist, please check if it's available in the official repos."), $pkg_name);
}
}
}
@@ -287,7 +287,7 @@ if ($uid):
if (!$error) {
if (!@chdir($incoming_pkgdir)) {
- $error = __("Could not change directory to %s.", $incoming_pkgdir);
+ $error = sprintf(_("Could not change directory to %s."), $incoming_pkgdir);
}
file_put_contents('PKGBUILD', $pkgbuild_raw);
@@ -407,10 +407,10 @@ html_header("Submit");
<div class="pgbox">
<div class="pgboxtitle">
- <span class="f3"><?php print __("Submit"); ?></span>
+ <span class="f3"><?php print _("Submit"); ?></span>
</div>
<div class="pgboxbody">
- <p><?php echo __("Upload your source packages here. Create source packages with `makepkg --source`.") ?></p>
+ <p><?php echo _("Upload your source packages here. Create source packages with `makepkg --source`.") ?></p>
<?php
if (empty($_REQUEST['pkgsubmit']) || $error):
@@ -425,10 +425,10 @@ html_header("Submit");
<div> <input type='hidden' name='pkgsubmit' value='1' /> </div>
<table border='0' cellspacing='5'>
<tr>
- <td class='f4' align='right'><?php print __("Package Category"); ?>:</td>
+ <td class='f4' align='right'><?php print _("Package Category"); ?>:</td>
<td class='f4' align='left'>
<select name='category'>
- <option value='1'><?php print __("Select Category"); ?></option>
+ <option value='1'><?php print _("Select Category"); ?></option>
<?php
foreach ($pkg_categories as $num => $cat):
print "<option value='" . $num . "'";
@@ -442,14 +442,14 @@ html_header("Submit");
</td>
</tr>
<tr>
- <td class='f4' align='right'><?php print __("Upload package file"); ?>:</td>
+ <td class='f4' align='right'><?php print _("Upload package file"); ?>:</td>
<td class='f4' align='left'>
<input type='file' name='pfile' size='30' />
</td>
</tr>
<tr>
<td align='left'>
- <input class='button' type='submit' value='<?php print __("Upload"); ?>' />
+ <input class='button' type='submit' value='<?php print _("Upload"); ?>' />
</td>
</tr>
</table>
@@ -457,7 +457,7 @@ html_header("Submit");
<?php
else:
- print __("Sorry, uploads are not permitted by this server.");
+ print _("Sorry, uploads are not permitted by this server.");
?>
<br />
@@ -467,7 +467,7 @@ html_header("Submit");
endif;
else:
# Visitor is not logged in
- print __("You must create an account before you can upload packages.");
+ print _("You must create an account before you can upload packages.");
exit();
?>
diff --git a/web/html/tu.php b/web/html/tu.php
index 6e202c80..c16ca5e6 100644
--- a/web/html/tu.php
+++ b/web/html/tu.php
@@ -29,7 +29,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$row = mysql_fetch_assoc($results);
if (empty($row)) {
- print __("Could not retrieve proposal details.");
+ print _("Could not retrieve proposal details.");
} else {
$isrunning = $row['End'] > time() ? 1 : 0;
@@ -62,13 +62,13 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$errorvote = "";
if ($isrunning == 0) {
$canvote = 0;
- $errorvote = __("Voting is closed for this proposal.");
+ $errorvote = _("Voting is closed for this proposal.");
} else if ($row['User'] == username_from_sid($_COOKIE["AURSID"])) {
$canvote = 0;
- $errorvote = __("You cannot vote in an proposal about you.");
+ $errorvote = _("You cannot vote in an proposal about you.");
} else if ($hasvoted != 0) {
$canvote = 0;
- $errorvote = __("You've already voted for this proposal.");
+ $errorvote = _("You've already voted for this proposal.");
}
if ($canvote == 1) {
@@ -89,7 +89,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
# Can't vote anymore
#
$canvote = 0;
- $errorvote = __("You've already voted for this proposal.");
+ $errorvote = _("You've already voted for this proposal.");
# Update if they voted
$result = db_query($qvoted, $dbh);
if ($result) {
@@ -105,7 +105,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
include("tu_details.php");
}
} else {
- print __("Vote ID not valid.");
+ print _("Vote ID not valid.");
}
} else {
@@ -137,7 +137,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order;
$result = db_query($q, $dbh);
- $type = __("Current Votes");
+ $type = _("Current Votes");
include("tu_list.php");
?>
@@ -145,21 +145,21 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$q = "SELECT * FROM TU_VoteInfo WHERE End < " . time() . " ORDER BY Submitted " . $order . $lim;
$result = db_query($q, $dbh);
- $type = __("Past Votes");
+ $type = _("Past Votes");
include("tu_list.php");
$qnext = "SELECT ID FROM TU_VoteInfo";
$nextresult = db_query($qnext, $dbh);
?>
<div class="pgbox">
-<p><a href='addvote.php'><?php print __("Add Proposal") ?></a></p>
+<p><a href='addvote.php'><?php print _("Add Proposal") ?></a></p>
<?php if (mysql_num_rows($result)) { $by = htmlentities($by, ENT_QUOTES); ?>
<?php if ($off != 0) { $back = (($off - $limit) <= 0) ? 0 : $off - $limit; ?>
- <a href='tu.php?off=<?php print $back ?>&amp;by=<?php print $by ?>'><?php print __("Back") ?></a>
+ <a href='tu.php?off=<?php print $back ?>&amp;by=<?php print $by ?>'><?php print _("Back") ?></a>
<?php } ?>
<?php if (($off + $limit) < mysql_num_rows($nextresult)) { $forw = $off + $limit; ?>
- <a href='tu.php?off=<?php print $forw ?>&amp;by=<?php print $by ?>'><?php print __("Next") ?></a>
+ <a href='tu.php?off=<?php print $forw ?>&amp;by=<?php print $by ?>'><?php print _("Next") ?></a>
<?php } ?>
<?php } ?>
</div>
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index b2f0548e..3bdd8d0c 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -39,34 +39,34 @@ function display_account_form($UTYPE,$A,$U="",$T="",$S="",
print "<tr><td colspan='2'>&nbsp;</td></tr>\n";
print "<tr>";
- print "<td align='left'>".__("Username").":</td>";
+ print "<td align='left'>"._("Username").":</td>";
print "<td align='left'><input type='text' size='30' maxlength='64'";
- print " name='U' value='".htmlspecialchars($U,ENT_QUOTES)."' /> (".__("required").")</td>";
+ print " name='U' value='".htmlspecialchars($U,ENT_QUOTES)."' /> ("._("required").")</td>";
print "</tr>\n";
# Only TUs or Devs can promote/demote/suspend a user
if ($UTYPE == "Trusted User" || $UTYPE == "Developer") {
print "<tr>";
- print "<td align='left'>".__("Account Type").":</td>";
+ print "<td align='left'>"._("Account Type").":</td>";
print "<td align='left'><select name=T>\n";
print "<option value='1'";
$T == "User" ? print " selected>" : print ">";
- print __("Normal user")."\n";
+ print _("Normal user")."\n";
print "<option value='2'";
$T == "Trusted User" ? print " selected>" : print ">";
- print __("Trusted user")."\n";
+ print _("Trusted user")."\n";
# Only developers can make another account a developer
if ($UTYPE == "Developer") {
print "<option value='3'";
$T == "Developer" ? print " selected>" : print ">";
- print __("Developer")."\n";
+ print _("Developer")."\n";
}
print "</select></td>";
print "</tr>\n";
print "<tr>";
- print "<td align='left'>".__("Account Suspended").":</td>";
+ print "<td align='left'>"._("Account Suspended").":</td>";
print "<td align='left'><input type='checkbox' name='S'";
if ($S) {
print " checked=\"checked\" />";
@@ -77,43 +77,43 @@ function display_account_form($UTYPE,$A,$U="",$T="",$S="",
}
print "<tr>";
- print "<td align='left'>".__("Email Address").":</td>";
+ print "<td align='left'>"._("Email Address").":</td>";
print "<td align='left'><input type='text' size='30' maxlength='64'";
- print " name='E' value='".htmlspecialchars($E,ENT_QUOTES)."' /> (".__("required").")</td>";
+ print " name='E' value='".htmlspecialchars($E,ENT_QUOTES)."' /> ("._("required").")</td>";
print "</tr>\n";
print "<tr>";
- print "<td align='left'>".__("Password").":</td>";
+ print "<td align='left'>"._("Password").":</td>";
print "<td align='left'><input type='password' size='30' maxlength='32'";
print " name='P' value='".$P."' />";
if ($A != "UpdateAccount") {
- print " (".__("required").")";
+ print " ("._("required").")";
}
print "</td></tr>\n";
print "<tr>";
- print "<td align='left'>".__("Re-type password").":</td>";
+ print "<td align='left'>"._("Re-type password").":</td>";
print "<td align='left'><input type='password' size='30' maxlength='32'";
print " name='C' value='".$C."' />";
if ($A != "UpdateAccount") {
- print " (".__("required").")";
+ print " ("._("required").")";
}
print "</td></tr>\n";
print "<tr>";
- print "<td align='left'>".__("Real Name").":</td>";
+ print "<td align='left'>"._("Real Name").":</td>";
print "<td align='left'><input type='text' size='30' maxlength='32'";
print " name='R' value='".htmlspecialchars($R,ENT_QUOTES)."' /></td>";
print "</tr>\n";
print "<tr>";
- print "<td align='left'>".__("IRC Nick").":</td>";
+ print "<td align='left'>"._("IRC Nick").":</td>";
print "<td align='left'><input type='text' size='30' maxlength='32'";
print " name='I' value='".htmlspecialchars($I,ENT_QUOTES)."' /></td>";
print "</tr>\n";
print "<tr>";
- print "<td align='left'>".__("Language").":</td>";
+ print "<td align='left'>"._("Language").":</td>";
print "<td align='left'><select name=L>\n";
reset($SUPPORTED_LANGS);
@@ -134,12 +134,12 @@ function display_account_form($UTYPE,$A,$U="",$T="",$S="",
if ($A == "UpdateAccount") {
print "<input type='submit' class='button'";
- print " value='".__("Update")."' /> &nbsp; ";
+ print " value='"._("Update")."' /> &nbsp; ";
} else {
print "<input type='submit' class='button'";
- print " value='".__("Create")."' /> &nbsp; ";
+ print " value='"._("Create")."' /> &nbsp; ";
}
- print "<input type='reset' class='button' value='".__("Reset")."' />";
+ print "<input type='reset' class='button' value='"._("Reset")."' />";
print "</td>";
print "</tr>\n";
@@ -181,44 +181,44 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
$dbh = db_connect();
$error = "";
if (empty($E) || empty($U)) {
- $error = __("Missing a required field.");
+ $error = _("Missing a required field.");
}
if ($TYPE == "new") {
# they need password fields for this type of action
#
if (empty($P) || empty($C)) {
- $error = __("Missing a required field.");
+ $error = _("Missing a required field.");
}
} else {
if (!$UID) {
- $error = __("Missing User ID");
+ $error = _("Missing User ID");
}
}
if (!$error && !valid_username($U) && !user_is_privileged($editor_user))
- $error = __("The username is invalid.") . "<ul>\n"
- ."<li>" . __("It must be between %s and %s characters long",
+ $error = _("The username is invalid.") . "<ul>\n"
+ ."<li>" . _("It must be between %s and %s characters long",
USERNAME_MIN_LEN, USERNAME_MAX_LEN )
. "</li>"
- . "<li>" . __("Start and end with a letter or number") . "</li>"
- . "<li>" . __("Can contain only one period, underscore or hyphen.")
+ . "<li>" . _("Start and end with a letter or number") . "</li>"
+ . "<li>" . _("Can contain only one period, underscore or hyphen.")
. "</li>\n</ul>";
if (!$error && $P && $C && ($P != $C)) {
- $error = __("Password fields do not match.");
+ $error = _("Password fields do not match.");
}
if (!$error && $P != '' && !good_passwd($P))
- $error = __("Your password must be at least %s characters.",PASSWD_MIN_LEN);
+ $error = _("Your password must be at least %s characters.",PASSWD_MIN_LEN);
if (!$error && !valid_email($E)) {
- $error = __("The email address is invalid.");
+ $error = _("The email address is invalid.");
}
if ($UTYPE == "Trusted User" && $T == 3) {
- $error = __("A Trusted User cannot assign Developer status.");
+ $error = _("A Trusted User cannot assign Developer status.");
}
if (!$error && !array_key_exists($L, $SUPPORTED_LANGS)) {
- $error = __("Language is not currently supported.");
+ $error = _("Language is not currently supported.");
}
if (!$error) {
# check to see if this username is available
@@ -233,7 +233,7 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
if ($result) {
$row = mysql_fetch_array($result);
if ($row[0]) {
- $error = __("The username, %h%s%h, is already in use.",
+ $error = _("The username, %h%s%h, is already in use.",
"<b>", htmlspecialchars($U,ENT_QUOTES), "</b>");
}
}
@@ -251,7 +251,7 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
if ($result) {
$row = mysql_fetch_array($result);
if ($row[0]) {
- $error = __("The address, %h%s%h, is already in use.",
+ $error = _("The address, %h%s%h, is already in use.",
"<b>", htmlspecialchars($E,ENT_QUOTES), "</b>");
}
}
@@ -273,15 +273,15 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
"VALUES (1, 0, '" . implode("', '", $escaped) . "')";
$result = db_query($q, $dbh);
if (!$result) {
- print __("Error trying to create account, %h%s%h: %s.",
+ print _("Error trying to create account, %h%s%h: %s.",
"<b>", htmlspecialchars($U,ENT_QUOTES), "</b>", mysql_error($dbh));
} else {
# account created/modified, tell them so.
#
- print __("The account, %h%s%h, has been successfully created.",
+ print _("The account, %h%s%h, has been successfully created.",
"<b>", htmlspecialchars($U,ENT_QUOTES), "</b>");
print "<p>\n";
- print __("Click on the Home link above to login.");
+ print _("Click on the Home link above to login.");
print "</p>\n";
}
@@ -310,10 +310,10 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="",
$q.= " WHERE ID = ".intval($UID);
$result = db_query($q, $dbh);
if (!$result) {
- print __("Error trying to modify account, %h%s%h: %s.",
+ print _("Error trying to modify account, %h%s%h: %s.",
"<b>", htmlspecialchars($U,ENT_QUOTES), "</b>", mysql_error($dbh));
} else {
- print __("The account, %h%s%h, has been successfully modified.",
+ print _("The account, %h%s%h, has been successfully modified.",
"<b>", htmlspecialchars($U,ENT_QUOTES), "</b>");
}
}
@@ -411,7 +411,7 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
$result = db_query($q, $dbh);
if (!$result) {
- print __("No results matched your search criteria.");
+ print _("No results matched your search criteria.");
} else {
$num_rows = mysql_num_rows($result);
if ($num_rows) {
@@ -424,19 +424,19 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
print " cellspacing='0' width='100%'>\n";
print "<tr>";
print "<th class='header'>";
- print "<span class='f2'>".__("Username")."</span></th>";
+ print "<span class='f2'>"._("Username")."</span></th>";
print "<th class='header'>";
- print "<span class='f2'>".__("Type")."</span></th>";
+ print "<span class='f2'>"._("Type")."</span></th>";
print "<th class='header'>";
- print "<span class='f2'>".__("Status")."</span></th>";
+ print "<span class='f2'>"._("Status")."</span></th>";
print "<th class='header'>";
- print "<span class='f2'>".__("Real Name")."</span></th>";
+ print "<span class='f2'>"._("Real Name")."</span></th>";
print "<th class='header'>";
- print "<span class='f2'>".__("IRC Nick")."</span></th>";
+ print "<span class='f2'>"._("IRC Nick")."</span></th>";
print "<th class='header'>";
- print "<span class='f2'>".__("Last Voted")."</span></th>";
+ print "<span class='f2'>"._("Last Voted")."</span></th>";
print "<th class='header'>";
- print "<span class='f2'>".__("Edit Account")."</span></th>";
+ print "<span class='f2'>"._("Edit Account")."</span></th>";
print "</tr>\n";
$i = 0;
while ($row = mysql_fetch_assoc($result)) {
@@ -453,9 +453,9 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
print "</span></td>";
print "<td class='".$c."'><span class='f5'>";
if ($row["Suspended"]) {
- print __("Suspended");
+ print _("Suspended");
} else {
- print __("Active");
+ print _("Active");
}
print "</span></td>";
print "<td class='".$c."'><span class='f5'>";
@@ -467,7 +467,7 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
print "<td class='".$c."'><span class='f5'>";
$row["LastVoted"]
? print date("Ymd", $row["LastVoted"])
- : print __("Never");
+ : print _("Never");
print "</span></td>";
print "<td class='".$c."'><span class='f5'>";
if ($UTYPE == "Trusted User" && $row["AccountType"] == "Developer") {
@@ -498,7 +498,7 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
print " value='".${$ind}."' />\n";
}
print "<input type='submit' class='button'";
- print " value='&lt;-- ".__("Less")."' />";
+ print " value='&lt;-- "._("Less")."' />";
print "</fieldset>";
print "</form>\n";
print "</td>";
@@ -514,7 +514,7 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
print " value='".${$ind}."' />\n";
}
print "<input type='submit' class='button'";
- print " value='".__("More")." --&gt;' />";
+ print " value='"._("More")." --&gt;' />";
print "</fieldset>";
print "</form>\n";
print "</td>";
@@ -522,7 +522,7 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
print "</table>\n";
} else {
print "<p style=\"text-align:center;\">\n";
- print __("No more results to display.");
+ print _("No more results to display.");
print "</p>\n";
}
}
@@ -546,40 +546,40 @@ function display_account_info($U="", $T="", $E="", $R="", $I="") {
print " </tr>\n";
print " <tr>\n";
- print " <td align='left'>".__("Username").":</td>\n";
+ print " <td align='left'>"._("Username").":</td>\n";
print " <td align='left'>".$U."</td>\n";
print " </tr>\n";
print " <tr>\n";
- print " <td align='left'>".__("Account Type").":</td>\n";
+ print " <td align='left'>"._("Account Type").":</td>\n";
print " <td align='left'>";
if ($T == "User") {
- print __("User");
+ print _("User");
} elseif ($T == "Trusted User") {
- print __("Trusted User");
+ print _("Trusted User");
} elseif ($T == "Developer") {
- print __("Developer");
+ print _("Developer");
}
print " </td>\n";
print " </tr>\n";
print " <tr>\n";
- print " <td align='left'>".__("Email Address").":</td>\n";
+ print " <td align='left'>"._("Email Address").":</td>\n";
print " <td align='left'><a href='mailto:".htmlspecialchars($E,ENT_QUOTES)."'>".htmlspecialchars($E,ENT_QUOTES)."</a></td>\n";
print " </tr>\n";
print " <tr>\n";
- print " <td align='left'>".__("Real Name").":</td>\n";
+ print " <td align='left'>"._("Real Name").":</td>\n";
print " <td align='left'>".htmlspecialchars($R,ENT_QUOTES)."</td>\n";
print " </tr>\n";
print " <tr>\n";
- print " <td align='left'>".__("IRC Nick").":</td>\n";
+ print " <td align='left'>"._("IRC Nick").":</td>\n";
print " <td align='left'>".htmlspecialchars($I,ENT_QUOTES)."</td>\n";
print " </tr>\n";
print " <tr>\n";
- print " <td colspan='2'><a href='packages.php?K=".$U."&amp;SeB=m'>".__("View this user's packages")."</a></td>\n";
+ print " <td colspan='2'><a href='packages.php?K=".$U."&amp;SeB=m'>"._("View this user's packages")."</a></td>\n";
print " </tr>\n";
print "</table>\n";
@@ -668,7 +668,7 @@ function try_login() {
}
}
else {
- $login_error = __("Bad username or password.");
+ $login_error = _("Bad username or password.");
}
}
return array('SID' => $new_sid, 'error' => $login_error);
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php
index 382578c0..8b5787bd 100644
--- a/web/lib/aur.inc.php
+++ b/web/lib/aur.inc.php
@@ -7,10 +7,10 @@ header('Pragma: no-cache');
date_default_timezone_set('UTC');
-include_once('translator.inc.php');
+include_once("config.inc.php");
+
set_lang();
-include_once("config.inc.php");
include_once("version.inc.php");
include_once("acctfuncs.inc.php");
include_once("cachefuncs.inc.php");
@@ -295,9 +295,10 @@ function set_lang() {
setcookie("AURLANG", $LANG, $cookie_time, "/");
}
- $streamer = new FileReader('../locale/' . $LANG .
- '/LC_MESSAGES/aur.mo');
- $l10n = new gettext_reader($streamer, true);
+ var_dump(setlocale(LC_MESSAGES, $LANG.".UTF-8"));
+ bindtextdomain("aur", '../locale');
+ textdomain("aur");
+ bind_textdomain_codeset("aur", 'UTF-8');
return;
}
diff --git a/web/lib/gettext.php b/web/lib/gettext.php
deleted file mode 100644
index 5064047c..00000000
--- a/web/lib/gettext.php
+++ /dev/null
@@ -1,432 +0,0 @@
-<?php
-/*
- Copyright (c) 2003, 2009 Danilo Segan <danilo@kvota.net>.
- Copyright (c) 2005 Nico Kaiser <nico@siriux.net>
-
- This file is part of PHP-gettext.
-
- PHP-gettext is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PHP-gettext is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PHP-gettext; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-/**
- * Provides a simple gettext replacement that works independently from
- * the system's gettext abilities.
- * It can read MO files and use them for translating strings.
- * The files are passed to gettext_reader as a Stream (see streams.php)
- *
- * This version has the ability to cache all strings and translations to
- * speed up the string lookup.
- * While the cache is enabled by default, it can be switched off with the
- * second parameter in the constructor (e.g. whenusing very large MO files
- * that you don't want to keep in memory)
- */
-class gettext_reader {
- //public:
- var $error = 0; // public variable that holds error code (0 if no error)
-
- //private:
- var $BYTEORDER = 0; // 0: low endian, 1: big endian
- var $STREAM = NULL;
- var $short_circuit = false;
- var $enable_cache = false;
- var $originals = NULL; // offset of original table
- var $translations = NULL; // offset of translation table
- var $pluralheader = NULL; // cache header field for plural forms
- var $total = 0; // total string count
- var $table_originals = NULL; // table for original strings (offsets)
- var $table_translations = NULL; // table for translated strings (offsets)
- var $cache_translations = NULL; // original -> translation mapping
-
-
- /* Methods */
-
-
- /**
- * Reads a 32bit Integer from the Stream
- *
- * @access private
- * @return Integer from the Stream
- */
- function readint() {
- if ($this->BYTEORDER == 0) {
- // low endian
- $input=unpack('V', $this->STREAM->read(4));
- return array_shift($input);
- } else {
- // big endian
- $input=unpack('N', $this->STREAM->read(4));
- return array_shift($input);
- }
- }
-
- function read($bytes) {
- return $this->STREAM->read($bytes);
- }
-
- /**
- * Reads an array of Integers from the Stream
- *
- * @param int count How many elements should be read
- * @return Array of Integers
- */
- function readintarray($count) {
- if ($this->BYTEORDER == 0) {
- // low endian
- return unpack('V'.$count, $this->STREAM->read(4 * $count));
- } else {
- // big endian
- return unpack('N'.$count, $this->STREAM->read(4 * $count));
- }
- }
-
- /**
- * Constructor
- *
- * @param object Reader the StreamReader object
- * @param boolean enable_cache Enable or disable caching of strings (default on)
- */
- function gettext_reader($Reader, $enable_cache = true) {
- // If there isn't a StreamReader, turn on short circuit mode.
- if (! $Reader || isset($Reader->error) ) {
- $this->short_circuit = true;
- return;
- }
-
- // Caching can be turned off
- $this->enable_cache = $enable_cache;
-
- $MAGIC1 = "\x95\x04\x12\xde";
- $MAGIC2 = "\xde\x12\x04\x95";
-
- $this->STREAM = $Reader;
- $magic = $this->read(4);
- if ($magic == $MAGIC1) {
- $this->BYTEORDER = 1;
- } elseif ($magic == $MAGIC2) {
- $this->BYTEORDER = 0;
- } else {
- $this->error = 1; // not MO file
- return false;
- }
-
- // FIXME: Do we care about revision? We should.
- $revision = $this->readint();
-
- $this->total = $this->readint();
- $this->originals = $this->readint();
- $this->translations = $this->readint();
- }
-
- /**
- * Loads the translation tables from the MO file into the cache
- * If caching is enabled, also loads all strings into a cache
- * to speed up translation lookups
- *
- * @access private
- */
- function load_tables() {
- if (is_array($this->cache_translations) &&
- is_array($this->table_originals) &&
- is_array($this->table_translations))
- return;
-
- /* get original and translations tables */
- if (!is_array($this->table_originals)) {
- $this->STREAM->seekto($this->originals);
- $this->table_originals = $this->readintarray($this->total * 2);
- }
- if (!is_array($this->table_translations)) {
- $this->STREAM->seekto($this->translations);
- $this->table_translations = $this->readintarray($this->total * 2);
- }
-
- if ($this->enable_cache) {
- $this->cache_translations = array ();
- /* read all strings in the cache */
- for ($i = 0; $i < $this->total; $i++) {
- $this->STREAM->seekto($this->table_originals[$i * 2 + 2]);
- $original = $this->STREAM->read($this->table_originals[$i * 2 + 1]);
- $this->STREAM->seekto($this->table_translations[$i * 2 + 2]);
- $translation = $this->STREAM->read($this->table_translations[$i * 2 + 1]);
- $this->cache_translations[$original] = $translation;
- }
- }
- }
-
- /**
- * Returns a string from the "originals" table
- *
- * @access private
- * @param int num Offset number of original string
- * @return string Requested string if found, otherwise ''
- */
- function get_original_string($num) {
- $length = $this->table_originals[$num * 2 + 1];
- $offset = $this->table_originals[$num * 2 + 2];
- if (! $length)
- return '';
- $this->STREAM->seekto($offset);
- $data = $this->STREAM->read($length);
- return (string)$data;
- }
-
- /**
- * Returns a string from the "translations" table
- *
- * @access private
- * @param int num Offset number of original string
- * @return string Requested string if found, otherwise ''
- */
- function get_translation_string($num) {
- $length = $this->table_translations[$num * 2 + 1];
- $offset = $this->table_translations[$num * 2 + 2];
- if (! $length)
- return '';
- $this->STREAM->seekto($offset);
- $data = $this->STREAM->read($length);
- return (string)$data;
- }
-
- /**
- * Binary search for string
- *
- * @access private
- * @param string string
- * @param int start (internally used in recursive function)
- * @param int end (internally used in recursive function)
- * @return int string number (offset in originals table)
- */
- function find_string($string, $start = -1, $end = -1) {
- if (($start == -1) or ($end == -1)) {
- // find_string is called with only one parameter, set start end end
- $start = 0;
- $end = $this->total;
- }
- if (abs($start - $end) <= 1) {
- // We're done, now we either found the string, or it doesn't exist
- $txt = $this->get_original_string($start);
- if ($string == $txt)
- return $start;
- else
- return -1;
- } else if ($start > $end) {
- // start > end -> turn around and start over
- return $this->find_string($string, $end, $start);
- } else {
- // Divide table in two parts
- $half = (int)(($start + $end) / 2);
- $cmp = strcmp($string, $this->get_original_string($half));
- if ($cmp == 0)
- // string is exactly in the middle => return it
- return $half;
- else if ($cmp < 0)
- // The string is in the upper half
- return $this->find_string($string, $start, $half);
- else
- // The string is in the lower half
- return $this->find_string($string, $half, $end);
- }
- }
-
- /**
- * Translates a string
- *
- * @access public
- * @param string string to be translated
- * @return string translated string (or original, if not found)
- */
- function translate($string) {
- if ($this->short_circuit)
- return $string;
- $this->load_tables();
-
- if ($this->enable_cache) {
- // Caching enabled, get translated string from cache
- if (array_key_exists($string, $this->cache_translations))
- return $this->cache_translations[$string];
- else
- return $string;
- } else {
- // Caching not enabled, try to find string
- $num = $this->find_string($string);
- if ($num == -1)
- return $string;
- else
- return $this->get_translation_string($num);
- }
- }
-
- /**
- * Sanitize plural form expression for use in PHP eval call.
- *
- * @access private
- * @return string sanitized plural form expression
- */
- function sanitize_plural_expression($expr) {
- // Get rid of disallowed characters.
- $expr = preg_replace('@[^a-zA-Z0-9_:;\(\)\?\|\&=!<>+*/\%-]@', '', $expr);
-
- // Add parenthesis for tertiary '?' operator.
- $expr .= ';';
- $res = '';
- $p = 0;
- for ($i = 0; $i < strlen($expr); $i++) {
- $ch = $expr[$i];
- switch ($ch) {
- case '?':
- $res .= ' ? (';
- $p++;
- break;
- case ':':
- $res .= ') : (';
- break;
- case ';':
- $res .= str_repeat( ')', $p) . ';';
- $p = 0;
- break;
- default:
- $res .= $ch;
- }
- }
- return $res;
- }
-
- /**
- * Parse full PO header and extract only plural forms line.
- *
- * @access private
- * @return string verbatim plural form header field
- */
- function extract_plural_forms_header_from_po_header($header) {
- if (preg_match("/(^|\n)plural-forms: ([^\n]*)\n/i", $header, $regs))
- $expr = $regs[2];
- else
- $expr = "nplurals=2; plural=n == 1 ? 0 : 1;";
- return $expr;
- }
-
- /**
- * Get possible plural forms from MO header
- *
- * @access private
- * @return string plural form header
- */
- function get_plural_forms() {
- // lets assume message number 0 is header
- // this is true, right?
- $this->load_tables();
-
- // cache header field for plural forms
- if (! is_string($this->pluralheader)) {
- if ($this->enable_cache) {
- $header = $this->cache_translations[""];
- } else {
- $header = $this->get_translation_string(0);
- }
- $expr = $this->extract_plural_forms_header_from_po_header($header);
- $this->pluralheader = $this->sanitize_plural_expression($expr);
- }
- return $this->pluralheader;
- }
-
- /**
- * Detects which plural form to take
- *
- * @access private
- * @param n count
- * @return int array index of the right plural form
- */
- function select_string($n) {
- $string = $this->get_plural_forms();
- $string = str_replace('nplurals',"\$total",$string);
- $string = str_replace("n",$n,$string);
- $string = str_replace('plural',"\$plural",$string);
-
- $total = 0;
- $plural = 0;
-
- eval("$string");
- if ($plural >= $total) $plural = $total - 1;
- return $plural;
- }
-
- /**
- * Plural version of gettext
- *
- * @access public
- * @param string single
- * @param string plural
- * @param string number
- * @return translated plural form
- */
- function ngettext($single, $plural, $number) {
- if ($this->short_circuit) {
- if ($number != 1)
- return $plural;
- else
- return $single;
- }
-
- // find out the appropriate form
- $select = $this->select_string($number);
-
- // this should contains all strings separated by NULLs
- $key = $single . chr(0) . $plural;
-
-
- if ($this->enable_cache) {
- if (! array_key_exists($key, $this->cache_translations)) {
- return ($number != 1) ? $plural : $single;
- } else {
- $result = $this->cache_translations[$key];
- $list = explode(chr(0), $result);
- return $list[$select];
- }
- } else {
- $num = $this->find_string($key);
- if ($num == -1) {
- return ($number != 1) ? $plural : $single;
- } else {
- $result = $this->get_translation_string($num);
- $list = explode(chr(0), $result);
- return $list[$select];
- }
- }
- }
-
- function pgettext($context, $msgid) {
- $key = $context . chr(4) . $msgid;
- $ret = $this->translate($key);
- if (strpos($ret, "\004") !== FALSE) {
- return $msgid;
- } else {
- return $ret;
- }
- }
-
- function npgettext($context, $singular, $plural, $number) {
- $key = $context . chr(4) . $singular;
- $ret = $this->ngettext($key, $plural, $number);
- if (strpos($ret, "\004") !== FALSE) {
- return $singular;
- } else {
- return $ret;
- }
-
- }
-}
-
-?>
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 46768f2b..3bf0c7bc 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -288,12 +288,12 @@ function package_details($id=0, $SID="") {
$results = db_query($q, $dbh);
if (!$results) {
- print __("Error retrieving package details.") . "<br />\n";
+ print _("Error retrieving package details.") . "<br />\n";
}
else {
$row = mysql_fetch_assoc($results);
if (empty($row)) {
- print __("Package details could not be found.") . "<br />\n";
+ print _("Package details could not be found.") . "<br />\n";
}
else {
@@ -540,8 +540,8 @@ function pkg_search_page($SID="") {
$templ_pages = array();
if ($current > 1) {
- $templ_pages[__('First')] = 0;
- $templ_pages[__('Previous')] = ($current - 2) * $per_page;
+ $templ_pages[_('First')] = 0;
+ $templ_pages[_('Previous')] = ($current - 2) * $per_page;
}
if ($current - 5 > 1)
@@ -555,8 +555,8 @@ function pkg_search_page($SID="") {
$templ_pages["... "] = false;
if ($current < $pages) {
- $templ_pages[__('Next')] = $current * $per_page;
- $templ_pages[__('Last')] = ($pages - 1) * $per_page;
+ $templ_pages[_('Next')] = $current * $per_page;
+ $templ_pages[_('Last')] = ($pages - 1) * $per_page;
}
include('pkg_search_form.php');
@@ -597,18 +597,18 @@ function sanitize_ids($ids) {
function pkg_flag ($atype, $ids, $action = True) {
if (!$atype) {
if ($action) {
- return __("You must be logged in before you can flag packages.");
+ return _("You must be logged in before you can flag packages.");
} else {
- return __("You must be logged in before you can unflag packages.");
+ return _("You must be logged in before you can unflag packages.");
}
}
$ids = sanitize_ids($ids);
if (empty($ids)) {
if ($action) {
- return __("You did not select any packages to flag.");
+ return _("You did not select any packages to flag.");
} else {
- return __("You did not select any packages to unflag.");
+ return _("You did not select any packages to unflag.");
}
}
@@ -648,9 +648,9 @@ function pkg_flag ($atype, $ids, $action = True) {
}
if ($action) {
- return __("The selected packages have been flagged out-of-date.");
+ return _("The selected packages have been flagged out-of-date.");
} else {
- return __("The selected packages have been unflagged.");
+ return _("The selected packages have been unflagged.");
}
}
@@ -664,24 +664,24 @@ function pkg_flag ($atype, $ids, $action = True) {
*/
function pkg_delete ($atype, $ids) {
if (!$atype) {
- return __("You must be logged in before you can delete packages.");
+ return _("You must be logged in before you can delete packages.");
}
# If they're a TU or dev, can delete
if ($atype != "Trusted User" && $atype != "Developer") {
- return __("You do have permission to delete packages.");
+ return _("You do have permission to delete packages.");
}
$ids = sanitize_ids($ids);
if (empty($ids)) {
- return __("You did not select any packages to delete.");
+ return _("You did not select any packages to delete.");
}
$dbh = db_connect();
$q = "DELETE FROM Packages WHERE ID IN (" . implode(",", $ids) . ")";
$result = db_query($q, $dbh);
- return __("The selected packages have been deleted.");
+ return _("The selected packages have been deleted.");
}
/**
@@ -696,18 +696,18 @@ function pkg_delete ($atype, $ids) {
function pkg_adopt ($atype, $ids, $action = True) {
if (!$atype) {
if ($action) {
- return __("You must be logged in before you can adopt packages.");
+ return _("You must be logged in before you can adopt packages.");
} else {
- return __("You must be logged in before you can disown packages.");
+ return _("You must be logged in before you can disown packages.");
}
}
$ids = sanitize_ids($ids);
if (empty($ids)) {
if ($action) {
- return __("You did not select any packages to adopt.");
+ return _("You did not select any packages to adopt.");
} else {
- return __("You did not select any packages to disown.");
+ return _("You did not select any packages to disown.");
}
}
@@ -736,9 +736,9 @@ function pkg_adopt ($atype, $ids, $action = True) {
if ($action) {
pkg_notify(account_from_sid($_COOKIE["AURSID"]), $ids);
- return __("The selected packages have been adopted.");
+ return _("The selected packages have been adopted.");
} else {
- return __("The selected packages have been disowned.");
+ return _("The selected packages have been disowned.");
}
}
@@ -754,18 +754,18 @@ function pkg_adopt ($atype, $ids, $action = True) {
function pkg_vote ($atype, $ids, $action = True) {
if (!$atype) {
if ($action) {
- return __("You must be logged in before you can vote for packages.");
+ return _("You must be logged in before you can vote for packages.");
} else {
- return __("You must be logged in before you can un-vote for packages.");
+ return _("You must be logged in before you can un-vote for packages.");
}
}
$ids = sanitize_ids($ids);
if (empty($ids)) {
if ($action) {
- return __("You did not select any packages to vote for.");
+ return _("You did not select any packages to vote for.");
} else {
- return __("Your votes have been removed from the selected packages.");
+ return _("Your votes have been removed from the selected packages.");
}
}
@@ -823,9 +823,9 @@ function pkg_vote ($atype, $ids, $action = True) {
}
if ($action) {
- return __("Your votes have been cast for the selected packages.");
+ return _("Your votes have been cast for the selected packages.");
} else {
- return __("Your votes have been removed from the selected packages.");
+ return _("Your votes have been removed from the selected packages.");
}
}
@@ -838,13 +838,13 @@ function pkg_vote ($atype, $ids, $action = True) {
*/
function pkg_notify ($atype, $ids, $action = True) {
if (!$atype) {
-# return __("You must be logged in before you can get notifications on comments.");
+# return _("You must be logged in before you can get notifications on comments.");
return;
}
$ids = sanitize_ids($ids);
if (empty($ids)) {
- return __("Couldn't add to notification list.");
+ return _("Couldn't add to notification list.");
}
$dbh = db_connect();
@@ -895,10 +895,10 @@ function pkg_notify ($atype, $ids, $action = True) {
}
if ($action) {
- $output = __("You have been added to the comment notification list for %s.", $output);
+ $output = sprintf(_("You have been added to the comment notification list for %s."), $output);
}
else {
- $output = __("You have been removed from the comment notification list for %s.", $output);
+ $output = sprintf(_("You have been removed from the comment notification list for %s."), $output);
}
return $output;
@@ -914,14 +914,14 @@ function pkg_notify ($atype, $ids, $action = True) {
*/
function pkg_delete_comment($atype) {
if (!$atype) {
- return __("You must be logged in before you can edit package information.");
+ return _("You must be logged in before you can edit package information.");
}
# Get ID of comment to be removed
if (isset($_POST["comment_id"])) {
$comment_id = $_POST["comment_id"];
} else {
- return __("Missing comment ID.");
+ return _("Missing comment ID.");
}
$uid = uid_from_sid($_COOKIE["AURSID"]);
@@ -932,9 +932,9 @@ function pkg_delete_comment($atype) {
$q.= "SET DelUsersID = ".$uid." ";
$q.= "WHERE ID = ".intval($comment_id);
db_query($q, $dbh);
- return __("Comment has been deleted.");
+ return _("Comment has been deleted.");
} else {
- return __("You are not allowed to delete this comment.");
+ return _("You are not allowed to delete this comment.");
}
}
@@ -946,25 +946,25 @@ function pkg_delete_comment($atype) {
*/
function pkg_change_category($atype) {
if (!$atype) {
- return __("You must be logged in before you can edit package information.");
+ return _("You must be logged in before you can edit package information.");
}
# Get ID of the new category
if (isset($_POST["category_id"])) {
$category_id = $_POST["category_id"];
} else {
- return __("Missing category ID.");
+ return _("Missing category ID.");
}
$catArray = pkgCategories();
if (!array_key_exists($category_id, $catArray)) {
- return __("Invalid category ID.");
+ return _("Invalid category ID.");
}
if (isset($_GET["ID"])) {
$pid = $_GET["ID"];
} else {
- return __("Missing package ID.");
+ return _("Missing package ID.");
}
# Verify package ownership
@@ -977,7 +977,7 @@ function pkg_change_category($atype) {
$pkg = mysql_fetch_assoc($result);
}
else {
- return __("You are not allowed to change this package category.");
+ return _("You are not allowed to change this package category.");
}
$uid = uid_from_sid($_COOKIE["AURSID"]);
@@ -987,8 +987,8 @@ function pkg_change_category($atype) {
$q.= "SET CategoryID = ".intval($category_id)." ";
$q.= "WHERE ID = ".intval($pid);
db_query($q, $dbh);
- return __("Package category changed.");
+ return _("Package category changed.");
} else {
- return __("You are not allowed to change this package category.");
+ return _("You are not allowed to change this package category.");
}
}
diff --git a/web/lib/translator.inc.php b/web/lib/translator.inc.php
deleted file mode 100644
index 44c87bda..00000000
--- a/web/lib/translator.inc.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR . '../lang');
-
-# This file provides support for i18n
-
-# usage:
-# use the __() function for returning translated strings of
-# text. The string can contain escape codes %h for HTML
-# and %s for regular text.
-#
-# examples:
-# print __("%s has %s apples.", "Bill", "5");
-# print __("This is a %hmajor%h problem!", "<b>", "</b>");
-
-include_once('config.inc.php');
-include_once('gettext.php');
-include_once('streams.php');
-
-global $streamer, $l10n;
-
-function __() {
- global $LANG;
- global $l10n;
-
- # Create the translation.
- $args = func_get_args();
-
- # First argument is always string to be translated
- $tag = $args[0];
-
- # Translate using gettext_reader initialized before.
- $translated = $l10n->translate($tag);
- $translated = htmlspecialchars($translated, ENT_QUOTES);
-
- $num_args = sizeof($args);
-
- # Subsequent arguments are strings to be formatted
- #
- # TODO: make this more robust.
- # '%%' should translate to a literal '%'
-
- if ( $num_args > 1 ) {
- for ($i = 1; $i < $num_args; $i++) {
- $translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1);
- }
- }
-
- return $translated;
-}
-
diff --git a/web/template/actions_form.php b/web/template/actions_form.php
index 058002f8..97177313 100644
--- a/web/template/actions_form.php
+++ b/web/template/actions_form.php
@@ -12,10 +12,10 @@
if ($result) {
if (!mysql_num_rows($result)) {
echo " <input type='submit' class='button' name='do_Vote'";
- echo " value='".__("Vote")."' /> ";
+ echo " value='"._("Vote")."' /> ";
} else {
echo "<input type='submit' class='button' name='do_UnVote'";
- echo " value='".__("UnVote")."' /> ";
+ echo " value='"._("UnVote")."' /> ";
}
}
@@ -27,35 +27,35 @@
if ($result) {
if (!mysql_num_rows($result)) {
echo "<input type='submit' class='button' name='do_Notify'";
- echo " value='".__("Notify")."' title='".__("New Comment Notification")."' /> ";
+ echo " value='"._("Notify")."' title='"._("New Comment Notification")."' /> ";
} else {
echo "<input type='submit' class='button' name='do_UnNotify'";
- echo " value='".__("UnNotify")."' title='".__("No New Comment Notification")."' /> ";
+ echo " value='"._("UnNotify")."' title='"._("No New Comment Notification")."' /> ";
}
}
if ($row["OutOfDateTS"] === NULL) {
echo "<input type='submit' class='button' name='do_Flag'";
- echo " value='".__("Flag Out-of-date")."' />\n";
+ echo " value='"._("Flag Out-of-date")."' />\n";
} else {
echo "<input type='submit' class='button' name='do_UnFlag'";
- echo " value='".__("UnFlag Out-of-date")."' />\n";
+ echo " value='"._("UnFlag Out-of-date")."' />\n";
}
if ($row["MaintainerUID"] === NULL) {
echo "<input type='submit' class='button' name='do_Adopt'";
- echo " value='".__("Adopt Packages")."' />\n";
+ echo " value='"._("Adopt Packages")."' />\n";
} else if ($uid == $row["MaintainerUID"] ||
$atype == "Trusted User" || $atype == "Developer") {
echo "<input type='submit' class='button' name='do_Disown'";
- echo " value='".__("Disown Packages")."' />\n";
+ echo " value='"._("Disown Packages")."' />\n";
}
if ($atype == "Trusted User" || $atype == "Developer") {
echo "<input type='submit' class='button' name='do_Delete'";
- echo " value='".__("Delete Packages")."' />\n";
+ echo " value='"._("Delete Packages")."' />\n";
echo "<input type='checkbox' name='confirm_Delete' value='1' /> ";
- echo __("Confirm")."\n";
+ echo _("Confirm")."\n";
}
?>
</fieldset>
diff --git a/web/template/header.php b/web/template/header.php
index 8313bb36..8c102339 100644
--- a/web/template/header.php
+++ b/web/template/header.php
@@ -31,15 +31,15 @@
<div id="archdev-navbar">
<ul>
- <li><a href="index.php">AUR <?php print __("Home"); ?></a></li>
- <li><a href="account.php"><?php print __("Accounts"); ?></a></li>
- <li><a href="packages.php"><?php print __("Packages"); ?></a></li>
- <li><a href="http://bugs.archlinux.org/index.php?tasks=all&amp;project=2"><?php print __("Bugs"); ?></a></li>
- <li><a href="http://archlinux.org/mailman/listinfo/aur-general"><?php print __("Discussion"); ?></a></li>
+ <li><a href="index.php">AUR <?php print _("Home"); ?></a></li>
+ <li><a href="account.php"><?php print _("Accounts"); ?></a></li>
+ <li><a href="packages.php"><?php print _("Packages"); ?></a></li>
+ <li><a href="http://bugs.archlinux.org/index.php?tasks=all&amp;project=2"><?php print _("Bugs"); ?></a></li>
+ <li><a href="http://archlinux.org/mailman/listinfo/aur-general"><?php print _("Discussion"); ?></a></li>
<?php if (isset($_COOKIE['AURSID'])): ?>
- <?php if (check_user_privileges()): ?><li><a href="tu.php"><?php print __("Trusted User"); ?></a></li><?php endif; ?>
- <li><a href="packages.php?SeB=m&amp;K=<?php print username_from_sid($_COOKIE["AURSID"]); ?>"><?php print __("My Packages"); ?></a></li>
- <li><a href="pkgsubmit.php"><?php print __("Submit"); ?></a></li>
+ <?php if (check_user_privileges()): ?><li><a href="tu.php"><?php print _("Trusted User"); ?></a></li><?php endif; ?>
+ <li><a href="packages.php?SeB=m&amp;K=<?php print username_from_sid($_COOKIE["AURSID"]); ?>"><?php print _("My Packages"); ?></a></li>
+ <li><a href="pkgsubmit.php"><?php print _("Submit"); ?></a></li>
<?php endif; ?>
</ul>
</div><!-- #archdev-navbar -->
diff --git a/web/template/login_form.php b/web/template/login_form.php
index ca81e0e7..b6d26ebc 100644
--- a/web/template/login_form.php
+++ b/web/template/login_form.php
@@ -1,9 +1,9 @@
<div id="login_bar" class="pgbox">
<?php
if (isset($_COOKIE["AURSID"])) {
- print __("Logged-in as: %s", '<b>' . username_from_sid($_COOKIE["AURSID"]) . '</b>');
+ printf(_("Logged-in as: %s"), '<b>' . username_from_sid($_COOKIE["AURSID"]) . '</b>');
?>
- <a href="logout.php">[<?php print __("Logout"); ?>]</a>
+ <a href="logout.php">[<?php print _("Logout"); ?>]</a>
<?php
}
else {
@@ -13,17 +13,17 @@ else {
?>
<form method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
<div>
- <label for="user"><?php print __('Username') . ':'; ?></label>
+ <label for="user"><?php print _('Username') . ':'; ?></label>
<input type="text" name="user" id="user" size="30" maxlength="<?php print USERNAME_MAX_LEN; ?>" value="<?php
if (isset($_POST['user'])) {
print htmlspecialchars($_POST['user'], ENT_QUOTES);
} ?>" />
- <label for="passwd"><?php print __('Password') . ':'; ?></label>
+ <label for="passwd"><?php print _('Password') . ':'; ?></label>
<input type="password" name="passwd" id="passwd" size="30" maxlength="<?php print PASSWD_MAX_LEN; ?>" />
<input type="checkbox" name="remember_me" id="remember_me" />
- <label for="remember_me"><?php print __("Remember me"); ?></label>
- <input type="submit" class="button" value="<?php print __("Login"); ?>" />
- <a href="passreset.php">[<?php echo __('Forgot Password') ?>]</a>
+ <label for="remember_me"><?php print _("Remember me"); ?></label>
+ <input type="submit" class="button" value="<?php print _("Login"); ?>" />
+ <a href="passreset.php">[<?php echo _('Forgot Password') ?>]</a>
</div>
</form>
<?php } ?>
diff --git a/web/template/pkg_comment_form.php b/web/template/pkg_comment_form.php
index e52c92d2..26207c87 100644
--- a/web/template/pkg_comment_form.php
+++ b/web/template/pkg_comment_form.php
@@ -54,14 +54,14 @@ if (isset($_REQUEST['comment'])) {
<div style="padding: 1%">
<?php
if (isset($_REQUEST['comment'])) {
- echo '<b>' . __('Comment has been added.') . '</b>';
+ echo '<b>' . _('Comment has been added.') . '</b>';
}
?>
<input type='hidden' name='ID' value="<?php echo intval($_REQUEST['ID']) ?>" />
- <?php echo __('Enter your comment below.') ?><br />
+ <?php echo _('Enter your comment below.') ?><br />
<textarea name='comment' cols='80' rows='10' style="width: 100%"></textarea><br />
- <input type='submit' value="<?php echo __("Submit") ?>" />
- <input type='reset' value="<?php echo __("Reset") ?>" />
+ <input type='submit' value="<?php echo _("Submit") ?>" />
+ <input type='reset' value="<?php echo _("Reset") ?>" />
</div>
</form>
</div>
diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php
index aed9ca8b..f62308d6 100644
--- a/web/template/pkg_comments.php
+++ b/web/template/pkg_comments.php
@@ -8,7 +8,7 @@ while (list($indx, $carr) = each($comments)) { ?>
$carr['UserName'] = "<a href=\"account.php?Action=AccountInfo&amp;ID={$carr['UsersID']}\">{$carr['UserName']}</a>";
}
- $commentHeader = '<p style="display:inline;">' . __('Comment by: %s on %s', $carr['UserName'], gmdate('r', $carr['CommentTS'])) . '</p>';
+ $commentHeader = '<p style="display:inline;">' . sprintf(_('Comment by: %s on %s'), $carr['UserName'], gmdate('r', $carr['CommentTS'])) . '</p>';
if (canDeleteCommentArray($carr, $atype, $uid)) {
$durl = '<form method="post" action="packages.php?ID='.$row['ID'].'">';
@@ -16,7 +16,7 @@ while (list($indx, $carr) = each($comments)) { ?>
$durl.= '<input type="hidden" name="action" value="do_DeleteComment" />';
$durl.= '<input type="hidden" name="comment_id" value="'.$carr['ID'].'" />';
$durl.= '<input type="image" src="images/x.png" ';
- $durl.= ' alt="'.__("Delete comment").'" name="submit" value="1" ';
+ $durl.= ' alt="'._("Delete comment").'" name="submit" value="1" ';
$durl.= ' />&nbsp;';
$durl.= '</fieldset>';
@@ -39,7 +39,7 @@ while (list($indx, $carr) = each($comments)) { ?>
$count = package_comments_count($_GET['ID']);
if ($count > 10 && !isset($_GET['comments'])) {
echo '<div class="pgbox">';
- echo '<a href="'. $_SERVER['REQUEST_URI'] . '&comments=all">'. __('Show all %s comments', $count) . '</a>';
+ echo '<a href="'. $_SERVER['REQUEST_URI'] . '&comments=all">'. sprintf(_('Show all %s comments'), $count) . '</a>';
echo '</div>';
}
?>
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index 06580639..2f14c41e 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -46,13 +46,13 @@ if ($row["MaintainerUID"]) {
$maintainer = "None";
}
-$votes = __('Votes') . ': ' . $row['NumVotes'];
+$votes = _('Votes') . ': ' . $row['NumVotes'];
if ($atype == "Developer" or $atype == "Trusted User") {
$votes = "<a href=\"voters.php?ID=$pkgid\">$votes</a>";
}
# In case of wanting to put a custom message
-$msg = __('unknown');
+$msg = _('unknown');
$license = empty($row['License']) ? $msg : $row['License'];
# Print the timestamps for last updates
@@ -62,7 +62,7 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[
?>
<div class="pgbox">
- <div class="pgboxtitle"><span class="f3"><?php echo __("Package Details") ?></span></div>
+ <div class="pgboxtitle"><span class="f3"><?php echo _("Package Details") ?></span></div>
<div class="pgboxbody">
<p>
@@ -74,28 +74,28 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[
<?php echo $edit_cat ?>
<p>
- <span class='f3'><?php echo __('Submitter') .': ' . $submitter ?></span><br />
- <span class='f3'><?php echo __('Maintainer') .': ' . $maintainer ?></span><br />
+ <span class='f3'><?php echo _('Submitter') .': ' . $submitter ?></span><br />
+ <span class='f3'><?php echo _('Maintainer') .': ' . $maintainer ?></span><br />
<span class='f3'><?php echo $votes ?></span>
</p>
- <p><span class='f3'><?php echo __('License') . ': ' . htmlspecialchars($license) ?></span></p>
+ <p><span class='f3'><?php echo _('License') . ': ' . htmlspecialchars($license) ?></span></p>
<p>
<span class='f3'>
- <?php echo __('Last Updated') . ': ' . $updated_time ?><br />
- <?php echo __('First Submitted') . ': '. $submitted_time ?>
+ <?php echo _('Last Updated') . ': ' . $updated_time ?><br />
+ <?php echo _('First Submitted') . ': '. $submitted_time ?>
</span>
</p>
<p><span class='f3'>
<?php
$urlpath = URL_DIR . $row['Name'];
- print "<a href='$urlpath/" . $row['Name'] . ".tar.gz'>".__("Tarball")."</a> :: ";
- print "<a href='$urlpath/PKGBUILD'>".__("PKGBUILD")."</a></span>";
+ print "<a href='$urlpath/" . $row['Name'] . ".tar.gz'>"._("Tarball")."</a> :: ";
+ print "<a href='$urlpath/PKGBUILD'>"._("PKGBUILD")."</a></span>";
if ($row["OutOfDateTS"] !== NULL) {
- echo "<br /><span class='f6'>".__("This package has been flagged out of date.")." (${out_of_date_time})</span>";
+ echo "<br /><span class='f6'>"._("This package has been flagged out of date.")." (${out_of_date_time})</span>";
}
?>
</p>
@@ -109,7 +109,7 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[
}
if (count($deps) > 0) {
- echo "<span class='boxSoftTitle'><span class='f3'>". __("Dependencies")."</span></span>";
+ echo "<span class='boxSoftTitle'><span class='f3'>". _("Dependencies")."</span></span>";
while (list($k, $darr) = each($deps)) {
# darr: (DepName, DepCondition, PackageID), where ID is NULL if it didn't exist
@@ -126,7 +126,7 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[
}
if (count($requiredby) > 0) {
- echo "<span class='boxSoftTitle'><span class='f3'>". __("Required by")."</span></span>";
+ echo "<span class='boxSoftTitle'><span class='f3'>". _("Required by")."</span></span>";
while (list($k, $darr) = each($requiredby)) {
# darr: (PackageName, PackageID)
@@ -145,7 +145,7 @@ $out_of_date_time = ($row["OutOfDateTS"] == 0) ? $msg : gmdate("r", intval($row[
if (count($sources) > 0) {
?>
- <div class='boxSoftTitle'><span class='f3'><?php echo __('Sources') ?></span></div>
+ <div class='boxSoftTitle'><span class='f3'><?php echo _('Sources') ?></span></div>
<div>
<?php
while (list($k, $src) = each($sources)) {
diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php
index 53d34fe3..8b4191a0 100644
--- a/web/template/pkg_search_form.php
+++ b/web/template/pkg_search_form.php
@@ -3,14 +3,14 @@
<div class='pgbox'>
<form action='packages.php' method='get'>
<div class='pgboxtitle'>
- <span class='f3'><?php print __("Search Criteria"); ?></span>
+ <span class='f3'><?php print _("Search Criteria"); ?></span>
<input type='hidden' name='O' value='0' />
<input type='text' name='K' size='30' value="<?php if (isset($_REQUEST["K"])) { print stripslashes(trim(htmlspecialchars($_REQUEST["K"], ENT_QUOTES))); } ?>" maxlength='35' />
- <input type='submit' style='min-width:80px' class='button' name='do_Search' value='<?php print __("Go"); ?>' />
+ <input type='submit' style='min-width:80px' class='button' name='do_Search' value='<?php print _("Go"); ?>' />
<?php if (!empty($_GET['detail'])): ?>
- <input type='submit' style='min-width:80px' class='button' name='do_Orphans' value='<?php print __("Orphans"); ?>' />
+ <input type='submit' style='min-width:80px' class='button' name='do_Orphans' value='<?php print _("Orphans"); ?>' />
<?php endif; ?>
- <a href="?<?php print mkurl('detail=' . ((!empty($_GET['detail'])) ? 0 : 1) ) ?>"><?php print __("Advanced"); ?></a>
+ <a href="?<?php print mkurl('detail=' . ((!empty($_GET['detail'])) ? 0 : 1) ) ?>"><?php print _("Advanced"); ?></a>
</div>
<?php if (!empty($_GET['detail'])): ?>
@@ -18,9 +18,9 @@
<input type="hidden" name="detail" value="1" />
<ul>
<li>
- <label><?php print __("Category"); ?></label>
+ <label><?php print _("Category"); ?></label>
<select name='C'>
- <option value='0'><?php print __("Any"); ?></option>
+ <option value='0'><?php print _("Any"); ?></option>
<?php
foreach (pkgCategories() as $id => $cat):
if (isset($_REQUEST['C']) && $_REQUEST['C'] == $id):
@@ -35,10 +35,10 @@
</select>
</li>
<li>
- <label><?php print __("Search by"); ?></label>
+ <label><?php print _("Search by"); ?></label>
<select name='SeB'>
<?php
- $searchby = array('nd' => __('Name, Description'), 'n' => __('Name Only'), 'x' => __('Exact name'), 'm' => __('Maintainer'), 's' => __('Submitter'));
+ $searchby = array('nd' => _('Name, Description'), 'n' => _('Name Only'), 'x' => _('Exact name'), 'm' => _('Maintainer'), 's' => _('Submitter'));
foreach ($searchby as $k => $v):
if (isset($_REQUEST['SeB']) && $_REQUEST['SeB'] == $k):
?>
@@ -52,10 +52,10 @@
</select>
</li>
<li>
- <label><?php print __("Sort by"); ?></label>
+ <label><?php print _("Sort by"); ?></label>
<select name='SB'>
<?php
- $sortby = array('n' => __('Name'), 'c' => __('Category'), 'v' => __('Votes'), 'w' => __('Voted'), 'o' => __('Notify'), 'm' => __('Maintainer'), 'a' => __('Age'));
+ $sortby = array('n' => _('Name'), 'c' => _('Category'), 'v' => _('Votes'), 'w' => _('Voted'), 'o' => _('Notify'), 'm' => _('Maintainer'), 'a' => _('Age'));
foreach ($sortby as $k => $v):
if (isset($_REQUEST['SB']) && $_REQUEST['SB'] == $k):
?>
@@ -69,10 +69,10 @@
</select>
</li>
<li>
- <label><?php print __("Sort order"); ?></label>
+ <label><?php print _("Sort order"); ?></label>
<select name='SO'>
<?php
- $orderby = array('a' => __('Ascending'), 'd' => __('Descending'));
+ $orderby = array('a' => _('Ascending'), 'd' => _('Descending'));
foreach ($orderby as $k => $v):
if (isset($_REQUEST['SO']) && $_REQUEST['SO'] == $k):
?>
@@ -86,7 +86,7 @@
</select>
</li>
<li>
- <label><?php print __("Per page"); ?></label>
+ <label><?php print _("Per page"); ?></label>
<select name='PP'>
<?php
$pages = array(50, 100, 250);
@@ -103,10 +103,10 @@
</select>
</li>
<li>
- <label><?php echo __('Out of Date'); ?></label>
+ <label><?php echo _('Out of Date'); ?></label>
<select name='outdated'>
<?php
- $outdated_flags = array('' => __('All'), 'on' => __('Flagged'), 'off' => __('Not Flagged'));
+ $outdated_flags = array('' => _('All'), 'on' => _('Flagged'), 'off' => _('Not Flagged'));
foreach ($outdated_flags as $k => $v):
if (isset($_REQUEST['outdated']) && $_REQUEST['outdated'] == $k):
?>
diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php
index d32b6c4a..f204295f 100644
--- a/web/template/pkg_search_results.php
+++ b/web/template/pkg_search_results.php
@@ -1,12 +1,12 @@
<?php if (!$result) { ?>
- <div class='pgboxbody'><?php print __("Error retrieving package list.") ?></div>
+ <div class='pgboxbody'><?php print _("Error retrieving package list.") ?></div>
<?php } elseif ($total == 0) { ?>
- <div class='pgboxbody'><?php print __("No packages matched your search criteria.") ?></div>
+ <div class='pgboxbody'><?php print _("No packages matched your search criteria.") ?></div>
<?php } else { ?>
<form action='packages.php?<?php echo htmlentities($_SERVER['QUERY_STRING']) ?>' method='post'>
<div class="pgbox">
<div class="pgboxtitle">
- <span class='f3'><?php print __("Package Listing") ?></span>
+ <span class='f3'><?php print _("Package Listing") ?></span>
</div>
@@ -19,26 +19,26 @@
<?php endif; ?>
<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
- <a href='?<?php print mkurl('SB=c&SO=' . $SO_next) ?>'><?php print __("Category") ?></a>
+ <a href='?<?php print mkurl('SB=c&SO=' . $SO_next) ?>'><?php print _("Category") ?></a>
</span></th>
<th style='border-bottom: #666 1px solid; vertical-align: bottom; text-align: center;'><span class='f2'>
- <a href='?<?php print mkurl('SB=n&SO=' . $SO_next) ?>'><?php print __("Name") ?></a>
+ <a href='?<?php print mkurl('SB=n&SO=' . $SO_next) ?>'><?php print _("Name") ?></a>
</span></th>
<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
- <a href='?<?php print mkurl('SB=v&SO=' . $SO_next) ?>'><?php print __("Votes") ?></a>
+ <a href='?<?php print mkurl('SB=v&SO=' . $SO_next) ?>'><?php print _("Votes") ?></a>
</span></th>
<?php if ($SID): ?>
<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
- <a href='?<?php print mkurl('SB=w&SO=' . $SO_next) ?>'><?php print __("Voted") ?></a>
+ <a href='?<?php print mkurl('SB=w&SO=' . $SO_next) ?>'><?php print _("Voted") ?></a>
</span></th>
<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
- <a href='?<?php print mkurl('SB=o&SO=' . $SO_next) ?>'><?php print __("Notify") ?></a>
+ <a href='?<?php print mkurl('SB=o&SO=' . $SO_next) ?>'><?php print _("Notify") ?></a>
</span></th>
<?php endif; ?>
- <th style='border-bottom: #666 1px solid; vertical-align: bottom; text-align: center;'><span class='f2'><?php print __("Description") ?></span></th>
+ <th style='border-bottom: #666 1px solid; vertical-align: bottom; text-align: center;'><span class='f2'><?php print _("Description") ?></span></th>
<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
- <a href='?<?php print mkurl('SB=m&SO=' . $SO_next) ?>'><?php print __("Maintainer") ?></a>
+ <a href='?<?php print mkurl('SB=m&SO=' . $SO_next) ?>'><?php print _("Maintainer") ?></a>
</span></th>
</tr>
@@ -62,13 +62,13 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
<?php if ($SID): ?>
<td class='<?php print $c ?>'><span class='f5'><span class='blue'>
<?php if (isset($row["Voted"])): ?>
- <?php print __("Yes") ?></span></span></td>
+ <?php print _("Yes") ?></span></span></td>
<?php else: ?>
</span></span></td>
<?php endif; ?>
<td class='<?php print $c ?>'><span class='f5'><span class='blue'>
<?php if (isset($row["Notify"])): ?>
- <?php print __("Yes") ?></span></span></td>
+ <?php print _("Yes") ?></span></span></td>
<?php else: ?>
</span></span></td>
<?php endif; ?>
@@ -79,7 +79,7 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
<?php if (isset($row["Maintainer"])): ?>
<a href='packages.php?K=<?php print htmlspecialchars($row['Maintainer'], ENT_QUOTES) ?>&amp;SeB=m'><?php print htmlspecialchars($row['Maintainer']) ?></a>
<?php else: ?>
- <span style='color: blue; font-style: italic;'><?php print __("orphan") ?></span>
+ <span style='color: blue; font-style: italic;'><?php print _("orphan") ?></span>
<?php endif; ?>
</span></span></td>
</tr>
@@ -92,33 +92,33 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
<div class="pgbox pkg_search_results_footer">
<div class="legend_and_actions">
<div class="legend">
- <span class='f3'><?php echo __('Legend') ?></span>
- <span class="outofdate"><?php print __('Out of Date') ?></span>
+ <span class='f3'><?php echo _('Legend') ?></span>
+ <span class="outofdate"><?php print _('Out of Date') ?></span>
</div>
<?php if ($SID): ?>
<div>
<select name='action'>
- <option><?php print __("Actions") ?></option>
- <option value='do_Flag'><?php print __("Flag Out-of-date") ?></option>
- <option value='do_UnFlag'><?php print __("Unflag Out-of-date") ?></option>
- <option value='do_Adopt'><?php print __("Adopt Packages") ?></option>
- <option value='do_Disown'><?php print __("Disown Packages") ?></option>
+ <option><?php print _("Actions") ?></option>
+ <option value='do_Flag'><?php print _("Flag Out-of-date") ?></option>
+ <option value='do_UnFlag'><?php print _("Unflag Out-of-date") ?></option>
+ <option value='do_Adopt'><?php print _("Adopt Packages") ?></option>
+ <option value='do_Disown'><?php print _("Disown Packages") ?></option>
<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
- <option value='do_Delete'><?php print __("Delete Packages") ?></option>
+ <option value='do_Delete'><?php print _("Delete Packages") ?></option>
<?php endif; ?>
- <option value='do_Notify'><?php print __("Notify") ?></option>
- <option value='do_UnNotify'><?php print __("UnNotify") ?></option>
+ <option value='do_Notify'><?php print _("Notify") ?></option>
+ <option value='do_UnNotify'><?php print _("UnNotify") ?></option>
</select>
<?php if ($atype == "Trusted User" || $atype == "Developer"): ?>
- <input type='checkbox' name='confirm_Delete' value='1' /> <?php print __("Confirm") ?>
+ <input type='checkbox' name='confirm_Delete' value='1' /> <?php print _("Confirm") ?>
<?php endif; ?>
- <input type='submit' class='button' style='width: 80px' value='<?php print __("Go") ?>' />
+ <input type='submit' class='button' style='width: 80px' value='<?php print _("Go") ?>' />
</div>
<?php endif; # if ($SID) ?>
</div> <!-- .legend_and_actions -->
<div class="page_links">
<div class="f4 blue">
- <?php print __("Showing results %s - %s of %s", $first, $last, $total) ?>
+ <?php printf(_("Showing results %s - %s of %s"), $first, $last, $total) ?>
</div>
<div class="page_nav">
<?php foreach($templ_pages as $pagenr => $pagestart) { ?>
diff --git a/web/template/search_accounts_form.php b/web/template/search_accounts_form.php
index 9d6c40d0..7ac958e2 100644
--- a/web/template/search_accounts_form.php
+++ b/web/template/search_accounts_form.php
@@ -3,61 +3,61 @@
<table border='0' cellpadding='0' cellspacing='0' width='80%' style="margin:0 auto;">
<tr>
- <td align='left'><?php print __("Username"); ?>:</td>
+ <td align='left'><?php print _("Username"); ?>:</td>
<td align='left'>
<input type='text' size='30' maxlength='64' name='U' />
</td>
</tr>
<tr>
- <td align='left'><?php print __("Account Type"); ?>:</td>
+ <td align='left'><?php print _("Account Type"); ?>:</td>
<td align='left'>
<select name="T">
- <option value=''><?php print __("Any type"); ?></option>
- <option value='u'><?php print __("Normal user"); ?></option>
- <option value='t'><?php print __("Trusted user"); ?></option>
- <option value='d'><?php print __("Developer"); ?></option>
+ <option value=''><?php print _("Any type"); ?></option>
+ <option value='u'><?php print _("Normal user"); ?></option>
+ <option value='t'><?php print _("Trusted user"); ?></option>
+ <option value='d'><?php print _("Developer"); ?></option>
</select>
</td>
</tr>
<tr>
- <td align='left'><?php print __("Account Suspended"); ?>:</td>
+ <td align='left'><?php print _("Account Suspended"); ?>:</td>
<td align='left'>
<input type='checkbox' name='S' />
</td>
</tr>
<tr>
- <td align='left'><?php print __("Email Address"); ?>:</td>
+ <td align='left'><?php print _("Email Address"); ?>:</td>
<td align='left'>
<input type='text' size='30' maxlength='64' name='E' />
</td>
</tr>
<tr>
- <td align='left'><?php print __("Real Name"); ?>:</td>
+ <td align='left'><?php print _("Real Name"); ?>:</td>
<td align='left'>
<input type='text' size='30' maxlength='32' name='R' />
</td>
</tr>
<tr>
- <td align='left'><?php print __("IRC Nick"); ?>:</td>
+ <td align='left'><?php print _("IRC Nick"); ?>:</td>
<td align='left'>
<input type='text' size='30' maxlength='32' name='I' />
</td>
</tr>
<tr>
- <td align='left'><?php print __("Sort by"); ?>:</td>
+ <td align='left'><?php print _("Sort by"); ?>:</td>
<td align='left'>
<select name="SB">
- <option value='u'><?php print __("Username"); ?></option>
- <option value='t'><?php print __("Account Type"); ?></option>
- <option value='r'><?php print __("Real Name"); ?></option>
- <option value='i'><?php print __("IRC Nick"); ?></option>
- <option value='v'><?php print __("Last vote"); ?></option>
+ <option value='u'><?php print _("Username"); ?></option>
+ <option value='t'><?php print _("Account Type"); ?></option>
+ <option value='r'><?php print _("Real Name"); ?></option>
+ <option value='i'><?php print _("IRC Nick"); ?></option>
+ <option value='v'><?php print _("Last vote"); ?></option>
</select>
</td>
</tr>
@@ -67,8 +67,8 @@
<td align='left'>
<br />
<input type='hidden' name='Action' value='SearchAccounts' />
- <input type='submit' class='button' value="<?php print __("Search"); ?>" />
- <input type='reset' class='button' value="<?php print __("Reset"); ?>" />
+ <input type='submit' class='button' value="<?php print _("Search"); ?>" />
+ <input type='reset' class='button' value="<?php print _("Reset"); ?>" />
</td>
</tr>
diff --git a/web/template/stats/general_stats_table.php b/web/template/stats/general_stats_table.php
index a100dfee..3d9cb7a7 100644
--- a/web/template/stats/general_stats_table.php
+++ b/web/template/stats/general_stats_table.php
@@ -1,37 +1,37 @@
<table class='boxSoft'>
<tr>
- <th colspan='2' class='boxSoftTitle'><span class='f3'><?php print __("Statistics") ?></span></th>
+ <th colspan='2' class='boxSoftTitle'><span class='f3'><?php print _("Statistics") ?></span></th>
</tr>
<tr>
- <td class='boxSoft'><span class='f4'><?php print __("Packages"); ?></span></td>
+ <td class='boxSoft'><span class='f4'><?php print _("Packages"); ?></span></td>
<td class='boxSoft'><span class='f4'><?php print $unsupported_count; ?></span></td>
</tr>
<tr>
- <td class='boxSoft'><span class='f4'><?php print __("Orphan Packages"); ?></span></td>
+ <td class='boxSoft'><span class='f4'><?php print _("Orphan Packages"); ?></span></td>
<td class='boxSoft'><span class='f4'><?php print $orphan_count; ?></span></td>
</tr>
<tr>
- <td class='boxSoft'><span class='f4'><?php print __("Packages added in the past 7 days"); ?></span></td>
+ <td class='boxSoft'><span class='f4'><?php print _("Packages added in the past 7 days"); ?></span></td>
<td class='boxSoft'><span class='f4'><?php print $add_count; ?></span></td>
</tr>
<tr>
- <td class='boxSoft'><span class='f4'><?php print __("Packages updated in the past 7 days"); ?></span></td>
+ <td class='boxSoft'><span class='f4'><?php print _("Packages updated in the past 7 days"); ?></span></td>
<td class='boxSoft'><span class='f4'><?php print $update_count; ?></span></td>
</tr>
<tr>
- <td class='boxSoft'><span class='f4'><?php print __("Packages updated in the past year"); ?></span></td>
+ <td class='boxSoft'><span class='f4'><?php print _("Packages updated in the past year"); ?></span></td>
<td class='boxSoft'><span class='f4'><?php print $update_year_count; ?></span></td>
</tr>
<tr>
- <td class='boxSoft'><span class='f4'><?php print __("Packages never updated"); ?></span></td>
+ <td class='boxSoft'><span class='f4'><?php print _("Packages never updated"); ?></span></td>
<td class='boxSoft'><span class='f4'><?php print $never_update_count; ?></span></td>
</tr>
<tr>
- <td class='boxSoft'><span class='f4'><?php print __("Registered Users"); ?></span></td>
+ <td class='boxSoft'><span class='f4'><?php print _("Registered Users"); ?></span></td>
<td class='boxSoft'><span class='f4'><?php print $user_count; ?></span></td>
</tr>
<tr>
- <td class='boxSoft'><span class='f4'><?php print __("Trusted Users"); ?></span></td>
+ <td class='boxSoft'><span class='f4'><?php print _("Trusted Users"); ?></span></td>
<td class='boxSoft'><span class='f4'><?php print $tu_count; ?></span></td>
</tr>
</table>
diff --git a/web/template/stats/updates_table.php b/web/template/stats/updates_table.php
index a8cdf5aa..623b4c06 100644
--- a/web/template/stats/updates_table.php
+++ b/web/template/stats/updates_table.php
@@ -1,7 +1,7 @@
<table class="boxSoft">
<tr>
<th colspan="2" class="boxSoftTitle" style="text-align: right">
-<span class="f3"><?php print __("Recent Updates") ?><span class="f5"></span></span>
+<span class="f3"><?php print _("Recent Updates") ?><span class="f5"></span></span>
<a href="rss.php"><img src="images/feed-icon-14x14.png" alt="RSS Feed" /></a>
</th>
</tr>
diff --git a/web/template/stats/user_table.php b/web/template/stats/user_table.php
index 36a6b10c..992f7370 100644
--- a/web/template/stats/user_table.php
+++ b/web/template/stats/user_table.php
@@ -4,13 +4,13 @@
<table class='boxSoft'>
<tr>
<th colspan='2' class='boxSoftTitle'>
-<span class='f3'><?php print __("My Statistics"); ?></span>
+<span class='f3'><?php print _("My Statistics"); ?></span>
</th>
</tr>
<tr>
<td class='boxSoft'>
<span class='f4'><a href="packages.php?SeB=m&amp;L=2&amp;K=<?php echo $username; ?>">
-<?php print __("Packages in unsupported"); ?></a></span>
+<?php print _("Packages in unsupported"); ?></a></span>
</td>
<td class='boxSoft'>
<span class='f4'><?php print $maintainer_unsupported_count; ?></span>
@@ -20,7 +20,7 @@
<tr>
<td class='boxSoft'>
<span class='f4'><a href="packages.php?SeB=m&amp;outdated=on&amp;K=<?php echo $username; ?>">
-<?php print __("Out of Date"); ?></a></span>
+<?php print _("Out of Date"); ?></a></span>
</td>
<td class='boxSoft'>
<span class='f4'>
diff --git a/web/template/template.phps b/web/template/template.phps
index 841277b8..8f112967 100644
--- a/web/template/template.phps
+++ b/web/template/template.phps
@@ -10,10 +10,10 @@ check_sid(); # see if they're still logged in
html_header(); # print out the HTML header
-# Any text you print out to the visitor, use the __() function
+# Any text you print out to the visitor, use the _() function
# for i18n support. See web/lib/translator.inc.php for more info.
#
-print __("Hi, this is worth reading!")."<br />\n";
+print _("Hi, this is worth reading!")."<br />\n";
html_footer(AUR_VERSION);
diff --git a/web/template/tu_details.php b/web/template/tu_details.php
index 7d6c305d..b926615a 100644
--- a/web/template/tu_details.php
+++ b/web/template/tu_details.php
@@ -1,24 +1,24 @@
<div class="pgbox">
-<div class="pgboxtitle"><span class="f3"><?php print __("Proposal Details") ?></span></div>
+<div class="pgboxtitle"><span class="f3"><?php print _("Proposal Details") ?></span></div>
<div class="pgboxbody">
<?php
if ($isrunning == 1) { ?>
<p style='font-weight: bold; color: red'>
-<?php print __("This vote is still running.") ?>
+<?php print _("This vote is still running.") ?>
</p>
<?php
} ?>
<p>
-<?php echo __('User') ?>: <b>
+<?php echo _('User') ?>: <b>
<?php if (!empty($row['User'])) { ?>
<a href='packages.php?K=<?php print $row['User'] ?>&amp;SeB=m'><?php print $row['User'] ?></a>
<?php } else { ?>
N/A
<?php } ?>
</b><br />
-<?php print __("Submitted: %s by %s", "<b>" . gmdate("r", $row['Submitted']) . "</b>", "<b>" . username_from_id($row['SubmitterID']) . "</b>") ?><br />
-<?php print __('End') ?>: <b><?php print gmdate("r", $row['End']) ?></b></p>
+<?php printf(_("Submitted: %s by %s"), "<b>" . gmdate("r", $row['Submitted']) . "</b>", "<b>" . username_from_id($row['SubmitterID']) . "</b>") ?><br />
+<?php print _('End') ?>: <b><?php print gmdate("r", $row['End']) ?></b></p>
<p>
<?php print str_replace("\n", "<br />\n", htmlspecialchars($row['Agenda'])) ?>
@@ -26,11 +26,11 @@ N/A
<table class="boxSoft" width='100%' cellspacing='0' cellpadding='2'>
<tr>
-<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("Yes") ?></span></th>
-<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("No") ?></span></th>
-<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("Abstain") ?></span></th>
-<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("Total") ?></span></th>
-<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __('Voted') ?></span></th>
+<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("Yes") ?></span></th>
+<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("No") ?></span></th>
+<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("Abstain") ?></span></th>
+<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("Total") ?></span></th>
+<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _('Voted') ?></span></th>
</tr>
<tr>
<td class='data1'><span class='f5'><span class='blue'><?php print $row['Yes'] ?></span></span></td>
@@ -39,9 +39,9 @@ N/A
<td class='data1'><span class='f5'><span class='blue'><?php print ($row['Yes'] + $row['No'] + $row['Abstain']) ?></span></span></td>
<td class='data1'><span class='f5'><span class='blue'>
<?php if ($hasvoted == 0) { ?>
-<span style='color: red; font-weight: bold'><?php print __("No") ?></span>
+<span style='color: red; font-weight: bold'><?php print _("No") ?></span>
<?php } else { ?>
-<span style='color: green; font-weight: bold'><?php print __("Yes") ?></span>
+<span style='color: green; font-weight: bold'><?php print _("Yes") ?></span>
<?php } ?>
</span></span></td>
</tr>
@@ -52,7 +52,7 @@ N/A
if (!$isrunning) { ?>
<div class="pgbox">
<div class="pgboxtitle">
- <span class="f3"><?php echo __('Voters'); ?></span>
+ <span class="f3"><?php echo _('Voters'); ?></span>
</div>
<div class="pgboxbody">
<?php echo $whovoted; ?>
@@ -66,9 +66,9 @@ if (!$isrunning) { ?>
<?php if ($canvote == 1) { ?>
<form action='tu.php?id=<?php print $row['ID'] ?>' method='post'>
<fieldset>
-<input type='submit' class='button' name='voteYes' value='<?php print __("Yes") ?>' />
-<input type='submit' class='button' name='voteNo' value='<?php print __("No") ?>' />
-<input type='submit' class='button' name='voteAbstain' value='<?php print __("Abstain") ?>' />
+<input type='submit' class='button' name='voteYes' value='<?php print _("Yes") ?>' />
+<input type='submit' class='button' name='voteNo' value='<?php print _("No") ?>' />
+<input type='submit' class='button' name='voteAbstain' value='<?php print _("Abstain") ?>' />
<input type='hidden' name='doVote' value='1' />
</fieldset>
</form>
diff --git a/web/template/tu_list.php b/web/template/tu_list.php
index 75d9414e..9775d1ae 100644
--- a/web/template/tu_list.php
+++ b/web/template/tu_list.php
@@ -4,18 +4,18 @@
</div>
<table width='100%' cellspacing='0' cellpadding='2'>
<tr>
- <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("Proposal") ?></span></th>
+ <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("Proposal") ?></span></th>
<th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'>
- <a href='?off=<?php print $off ?>&amp;by=<?php print $by_next ?>'><?php print __("Start") ?></a>
+ <a href='?off=<?php print $off ?>&amp;by=<?php print $by_next ?>'><?php print _("Start") ?></a>
</span></th>
- <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("End") ?></span></th>
- <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("User") ?></span></th>
- <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("Yes") ?></span></th>
- <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __("No") ?></span></th>
- <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print __('Voted') ?></span></th>
+ <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("End") ?></span></th>
+ <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("User") ?></span></th>
+ <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("Yes") ?></span></th>
+ <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _("No") ?></span></th>
+ <th style='border-bottom: #666 1px solid; vertical-align: bottom'><span class='f2'><?php print _('Voted') ?></span></th>
</tr>
<?php if (mysql_num_rows($result) == 0) { ?>
- <tr><td align='center' colspan='0'><?php print __("No results found.") ?></td></tr>
+ <tr><td align='center' colspan='0'><?php print _("No results found.") ?></td></tr>
<?php } else { for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { (($i % 2) == 0) ? $c = "data1" : $c = "data2"; ?>
<tr>
<td class='<?php print $c ?>'><span class='f4'><span class='blue'>
@@ -50,9 +50,9 @@
?>
<span class='f5'><span class='blue'>
<?php if ($hasvoted == 0) { ?>
- <span style='color: red; font-weight: bold'><?php print __("No") ?></span>
+ <span style='color: red; font-weight: bold'><?php print _("No") ?></span>
<?php } else { ?>
- <span style='color: green; font-weight: bold'><?php print __("Yes") ?></span>
+ <span style='color: green; font-weight: bold'><?php print _("Yes") ?></span>
<?php } ?>
</span></span>
</td>