summaryrefslogtreecommitdiffstats
path: root/web/html/pkgsubmit.php
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 /web/html/pkgsubmit.php
parentadbb59308024bfb6386eaa4a9d1a2eb6591b8456 (diff)
downloadaur-gettext.tar.gz
aur-gettext.tar.xz
use php's gettext modulegettext
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'web/html/pkgsubmit.php')
-rw-r--r--web/html/pkgsubmit.php44
1 files changed, 22 insertions, 22 deletions
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();
?>