From a37753d7cc0011d2ea9d48dbea79aafae2fe8d79 Mon Sep 17 00:00:00 2001 From: Vinicius Coque Date: Mon, 26 Apr 2010 11:13:33 -0300 Subject: Gettext for System::Cert manager --- usr/local/www/system_camanager.php | 76 +++++++++---------- usr/local/www/system_certmanager.php | 140 +++++++++++++++++------------------ 2 files changed, 108 insertions(+), 108 deletions(-) (limited to 'usr') diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php index 19f338d..365b39b 100644 --- a/usr/local/www/system_camanager.php +++ b/usr/local/www/system_camanager.php @@ -41,12 +41,12 @@ require("guiconfig.inc"); require_once("certs.inc"); $ca_methods = array( - "existing" => "Import an existing Certificate Authority", - "internal" => "Create an internal Certificate Authority"); + "existing" => gettext("Import an existing Certificate Authority"), + "internal" => gettext("Create an internal Certificate Authority")); $ca_keylens = array( "512", "1024", "2048", "4096"); -$pgtitle = array("System", "Certificate Authority Manager"); +$pgtitle = array(gettext("System"), gettext("Certificate Authority Manager")); $id = $_GET['id']; if (isset($_POST['id'])) @@ -125,13 +125,13 @@ if ($_POST) { "name keylen lifetime dn_country dn_state dn_city ". "dn_organization dn_email dn_commonname"); $reqdfieldsn = explode(",", - "Descriptive name,Key length,Lifetime,". - "Distinguished name Country Code,". - "Distinguished name State or Province,". - "Distinguished name City,". - "Distinguished name Organization,". - "Distinguished name Email Address,". - "Distinguished name Common Name"); + gettext("Descriptive name,Key length,Lifetime,"). + gettext("Distinguished name Country Code,"). + gettext("Distinguished name State or Province,"). + gettext("Distinguished name City,"). + gettext("Distinguished name Organization,"). + gettext("Distinguished name Email Address,"). + gettext("Distinguished name Common Name")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -260,15 +260,15 @@ function method_change() { - Existing Certificate Authority + - Certificate data +
- Paste a certificate in X.509 PEM format here. + @@ -278,7 +278,7 @@ function method_change() { - Internal Certificate Authority + @@ -293,14 +293,14 @@ function method_change() { - bits + - days + @@ -308,64 +308,64 @@ function method_change() { - + - + - + - + - + - +
Country Code :   :     ex:   - US - ( two letters ) + +
State or Province :   :     ex:   - Texas +
City :   :     ex:   - Austin +
Organization :   :     ex:   - My Company Inc. +
Email Address :   :     ex:   - admin@mycompany.com +
Common Name :   :     ex:   - internal-ca +
@@ -390,11 +390,11 @@ function method_change() { - - - - - + + + + + self-signed"; + $issuer_name = "" . gettext("self-signed") . ""; else - $issuer_name = "external"; + $issuer_name = "" . gettext("external") . ""; $subj = htmlspecialchars($subj); $issuer = htmlspecialchars($issuer); $certcount = 0; @@ -451,7 +451,7 @@ function method_change() { diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php index 03458e9..dfdcf70 100644 --- a/usr/local/www/system_certmanager.php +++ b/usr/local/www/system_certmanager.php @@ -41,13 +41,13 @@ require("guiconfig.inc"); require_once("certs.inc"); $cert_methods = array( - "existing" => "Import an existing Certificate", - "internal" => "Create an internal Certificate", - "external" => "Create a Certificate Signing Request"); + "existing" => gettext("Import an existing Certificate"), + "internal" => gettext("Create an internal Certificate"), + "external" => gettext("Create a Certificate Signing Request")); $cert_keylens = array( "512", "1024", "2048", "4096"); -$pgtitle = array("System", "Certificate Manager"); +$pgtitle = array("System", gettext("Certificate Manager")); $id = $_GET['id']; if (isset($_POST['id'])) @@ -151,7 +151,7 @@ if ($_POST) { $reqdfields = explode(" ", "name cert key"); $reqdfieldsn = explode(",", - "Descriptive name,Certificate data,Key data"); + gettext("Descriptive name,Certificate data,Key data")); } if ($pconfig['method'] == "internal") { @@ -159,13 +159,13 @@ if ($_POST) { "name caref keylen lifetime dn_country dn_state dn_city ". "dn_organization dn_email dn_commonname"); $reqdfieldsn = explode(",", - "Descriptive name,Certificate authority,Key length,Lifetime,". - "Distinguished name Country Code,". - "Distinguished name State or Province,". - "Distinguished name City,". - "Distinguished name Organization,". - "Distinguished name Email Address,". - "Distinguished name Common Name"); + gettext("Descriptive name,Certificate authority,Key length,Lifetime,"). + gettext("Distinguished name Country Code,"). + gettext("Distinguished name State or Province,"). + gettext("Distinguished name City,"). + gettext("Distinguished name Organization,"). + gettext("Distinguished name Email Address,"). + gettext("Distinguished name Common Name")); } if ($pconfig['method'] == "external") { @@ -173,13 +173,13 @@ if ($_POST) { "name csr_keylen csr_dn_country csr_dn_state csr_dn_city ". "csr_dn_organization csr_dn_email csr_dn_commonname"); $reqdfieldsn = explode(",", - "Descriptive name,Key length,". - "Distinguished name Country Code,". - "Distinguished name State or Province,". - "Distinguished name City,". - "Distinguished name Organization,". - "Distinguished name Email Address,". - "Distinguished name Common Name"); + gettext("Descriptive name,Key length,"). + gettext("Distinguished name Country Code,"). + gettext("Distinguished name State or Province,"). + gettext("Distinguished name City,"). + gettext("Distinguished name Organization,"). + gettext("Distinguished name Email Address,"). + gettext("Distinguished name Common Name")); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -239,13 +239,13 @@ if ($_POST) { } } - if ($_POST['save'] == "Update") { + if ($_POST['save'] == gettext("Update")) { unset($input_errors); $pconfig = $_POST; /* input validation */ $reqdfields = explode(" ", "name cert"); - $reqdfieldsn = explode(",", "Descriptive name,Final Certificate data"); + $reqdfieldsn = explode(",", gettext("Descriptive name,Final Certificate data")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -254,7 +254,7 @@ if ($_POST) { $subj_cert = cert_get_subject($pconfig['cert'], false); if (strcmp($subj_csr,$subj_cert)) - $input_errors[] = gettext("The certificate subject '{$subj_cert}' does not match the signing request subject."); + $input_errors[] = sprintf(gettext("The certificate subject '%s' does not match the signing request subject."),$subj_cert); /* if this is an AJAX caller then handle via JSON */ if (isAjax() && is_array($input_errors)) { @@ -402,23 +402,23 @@ function internalca_change() { - + - + + - + +
NameInternalIssuerCertificatesDistinguished Name
  - export ca + " alt="" width="17" height="17" border="0" /> ')"> delete ca @@ -466,7 +466,7 @@ function method_change() { - add ca + " alt="" width="17" height="17" border="0" />
Existing Certificate
Certificate data
- Paste a certificate in X.509 PEM format here.
Private key data
- Paste a private key in X.509 PEM format here.
@@ -428,16 +428,16 @@ function internalca_change() { - Internal Certificate + - No internal Certificate Authorities have been defined. You must - create - an internal CA before creating an internal certificate. + + + @@ -473,14 +473,14 @@ function internalca_change() { - bits + - days + @@ -488,47 +488,47 @@ function internalca_change() { - + - + - + - + - + - +
Country Code :   :  
State or Province :   :  
City :   :  
Organization :   :  
Email Address :   :     ex:   - webadmin@mycompany.com +
Common Name :   :     ex:   - www.example.com +
@@ -544,7 +544,7 @@ function internalca_change() { - External Signing Request + @@ -567,7 +567,7 @@ function internalca_change() { - + - + - + - + - + - +
Country Code :   :     @@ -575,57 +575,57 @@ function internalca_change() {   US   - ( two letters ) +
State or Province :   :     ex:   - Texas +
City :   :     ex:   - Austin +
Organization :   :     ex:   - My Company Inc. +
Email Address :   :     ex:   - webadmin@mycompany.com +
Common Name :   :     ex:   - www.example.com +
@@ -660,23 +660,23 @@ function internalca_change() { - Complete Signing Request + - Signing Request data +
- Copy the certificate signing data from here and forward it to your certificate authority for signing. + - Final Certificate data +
- Paste the certificate received from your cerificate authority here. + @@ -696,9 +696,9 @@ function internalca_change() { - - - + + + self-signed"; + $caname = "" . gettext("self-signed") . ""; else - $caname = "external"; + $caname = "" . gettext("external"). ""; $subj = htmlspecialchars($subj); } if ($cert['csr']) { $subj = htmlspecialchars(csr_get_subject($cert['csr'])); - $caname = "external - signature pending"; + $caname = "" . gettext("external - signature pending") . ""; } $ca = lookup_ca($cert['caref']); @@ -747,18 +747,18 @@ function internalca_change() { @@ -771,7 +771,7 @@ function internalca_change() { -- cgit v1.1
NameIssuerDistinguished Name
  - export ca + " alt="" width="17" height="17" border="0" /> - export ca + " alt="" width="17" height="17" border="0" /> ')"> - delete cert + " alt="" width="17" height="17" border="0" />   - update csr + " alt="" width="17" height="17" border="0" /> - add ca + " alt="" width="17" height="17" border="0" />