From 58907e0bffb5a7d2d0bfc05cec28f366432bb3e8 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 22 Jun 2011 20:57:07 +0200 Subject: use php's gettext module Signed-off-by: Florian Pritz --- web/html/pkgsubmit.php | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'web/html/pkgsubmit.php') 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.", "", $pkg_name, ""); + $error = sprintf(_( "You are not allowed to overwrite the %h%s%h package."), "", $pkg_name, ""); } 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");
- +
-

+

- + - +
::
::
- +
@@ -457,7 +457,7 @@ html_header("Submit");
@@ -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(); ?> -- cgit v1.2.3-24-g4f1b