summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2012-01-26 20:46:40 +0100
committerMichael Tänzer <neo@nhng.de>2012-01-26 20:46:40 +0100
commitf6129590b312f0b6b680f6085ff15f1d41c70691 (patch)
tree5da0a76fbdd0ec7238017904659a90b35d5b93f7 /www
parent368dec24f64435048650b07eee0264a7fdc41399 (diff)
downloadcacert-devel-f6129590b312f0b6b680f6085ff15f1d41c70691.tar.gz
cacert-devel-f6129590b312f0b6b680f6085ff15f1d41c70691.tar.xz
cacert-devel-f6129590b312f0b6b680f6085ff15f1d41c70691.zip
Source code taken from cacert-20120125.tar.bz2
Diffstat (limited to 'www')
-rw-r--r--www/cap.php60
-rw-r--r--www/capnew.php10
-rw-r--r--www/coapnew.php10
-rw-r--r--www/index.php19
-rw-r--r--www/ttp.php28
-rw-r--r--www/wot.php64
6 files changed, 88 insertions, 103 deletions
diff --git a/www/cap.php b/www/cap.php
index 6b08d38..73380e1 100644
--- a/www/cap.php
+++ b/www/cap.php
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- if($_SESSION['_config']['language'] != "ja_JP")
+ if($_SESSION['_config']['language'] != "ja")
{
define('FPDF_FONTPATH','/usr/share/fpdf/font/');
require_once('/usr/share/ufpdf/fpdf.php');
@@ -35,7 +35,7 @@
{
$this->Image((array_key_exists('bw',$_REQUEST) && $_REQUEST['bw'])?'images/CAcert-logo-mono-1000.png':'images/CAcert-logo-colour-1000.png',8,8,100);
$this->SetFont('Arial','B',14);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',14);
$this->Cell(100);
$this->Cell(40,20,recode($_SESSION['_config']['recode'], _("CAcert Assurance Programme")));
@@ -46,12 +46,12 @@
$this->SetY(36);
$this->SetFont('Arial','I',8);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','I',8);
$this->Cell(0,0,'CAcert Inc. - P.O. Box 4107 - Denistone East NSW 2112 - Australia - http://www.CAcert.org',0,0,'C');
$this->Ln(3);
$this->SetFont('Arial','',6);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',6);
$this->Cell(0,0, recode($_SESSION['_config']['recode'], _("CAcert's Root Certificate fingerprints")).": A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B "._("and")." 135C EC36 F49C B8E9 3B1A B270 CD80 8846 76CE 8F33",0,0,'C');
$this->SetLineWidth(0.05);
@@ -71,7 +71,7 @@
// Show text blurb at top of page
$this->SetY(45);
$this->SetFont('Arial','',10);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',10);
$this->Write(4,sprintf(recode($_SESSION['_config']['recode'], _("To the Assurer: The CAcert Assurance Programme (CAP) aims to verify the identities of Internet users through face-to-face witnessing of government issued identity documents. The Applicant asks you to verify to CAcert.org that you have met them and verified their identity against one or more original, trusted, government photo identity documents. If you have ANY doubts or concerns about the Applicant's identity, DO NOT COMPLETE OR SIGN this form. For more information about the CAcert Assurance Programme, including detailed guides for CAcert Assurers, please visit: %s")), "http://www.CAcert.org"));
$this->Ln(10);
@@ -84,21 +84,21 @@
$this->Rect(11, $top, $this->w - 25, 60, "D"); //50 -> 60
$this->SetXY(11, $top + 5);
$this->SetFont("Arial", "BUI", "20");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',20);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Applicant's Statement")));
$this->Rect(13, $top + 10, $this->w - 29, 6, "D");
$this->Line(80, $top + 10, 80, $top + 16);
$this->SetXY(15, $top + 13);
$this->SetFont("Arial", "B", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Names")).":");
if($name)
{
$this->SetXY(82, $top + 13);
$this->SetFont("Arial", '', "11");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11);
$this->Write(0, $name);
}
@@ -106,18 +106,18 @@
$this->Line(80, $top + 16, 80, $top + 22);
$this->SetXY(15, $top + 19);
$this->SetFont("Arial", "B", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Date of Birth")).": ");
$this->SetFont("Arial", "", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',8);
$this->Write(0, "(".recode($_SESSION['_config']['recode'], _("YYYY-MM-DD")).")");
if($dob)
{
$this->SetXY(82, $top + 19);
$this->SetFont("Arial", "", "11");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11);
$this->Write(0, $dob);
}
@@ -125,26 +125,26 @@
$this->Line(80, $top + 22, 80, $top + 28);
$this->SetXY(15, $top + 25);
$this->SetFont("Arial", "B", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Email Address")).":");
if($email)
{
$this->SetXY(82, $top + 25);
$this->SetFont("Arial", "", "11");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11);
$this->Write(0, $email);
}
$this->SetXY(13, $top + 32);
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->MultiCell($this->w - 29, 3, recode($_SESSION['_config']['recode'], _("I hereby confirm that the information stated above is both true and correct, and request the CAcert Assurer (identified below) to verify me according to CAcert Assurance Policy.")));
// new da start
$this->SetXY(13, $top + 42);
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->MultiCell($this->w - 29, 3, recode($_SESSION['_config']['recode'], _("I agree to the CAcert Community Agreement.")." ( http://www.cacert.org/policy/CAcertCommunityAgreement.php )"));
// new da end
@@ -157,7 +157,7 @@
$this->Write(0, "20___-___-___");
} else {
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($date, 13, " "));
}
@@ -167,18 +167,18 @@
$this->Rect(11, $top, $this->w - 25, 83, "D"); //63->93
$this->SetXY(11, $top + 5);
$this->SetFont("Arial", "BUI", "20");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',20);
$this->Write(0, recode($_SESSION['_config']['recode'], _("CAcert Assurer")));
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 15);
if($assurer)
{
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's Name")).": ");
$this->SetFont("Arial", "", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
// $this->MultiCell($this->w - 70, 2, recode($_SESSION['_config']['recode'], $assurer));
$this->Write(0, str_pad($assurer, 50, " "));
@@ -187,7 +187,7 @@
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's Name")).": ________________________________________________________________");
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 22);
$this->MultiCell($this->w - 34, 3, recode($_SESSION['_config']['recode'], _("Photo ID Shown: (ID types, not numbers. eg Drivers license, Passport)")));
@@ -198,12 +198,12 @@
} else {
$this->Write(0, "1. ");
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($document1, 90, " "));
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 35);
if($document2 == "")
@@ -212,12 +212,12 @@
} else {
$this->Write(0, "2. ");
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($document2, 90, " "));
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 45);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Location of Face-to-face Meeting")).": ");
@@ -226,12 +226,12 @@
$this->Write(0, "_____________________________________________");
} else {
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($location, 70, " "));
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 50);
if($maxpoints > 0)
@@ -241,7 +241,7 @@
$this->Write(0, recode($_SESSION['_config']['recode'], _("Points Allocated")).": ______________");
}
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 54);
$this->MultiCell($this->w - 33, 3, recode($_SESSION['_config']['recode'], _("I, the Assurer, hereby confirm that I have verified the Member according to CAcert Assurance Policy.")));
@@ -249,7 +249,7 @@
$this->MultiCell($this->w - 33, 3, recode($_SESSION['_config']['recode'], _("I am a CAcert Community Member, have passed the Assurance Challenge, and have been assured with at least 100 Assurance Points.")));
$this->SetFont("Arial", "", "9");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 74); //22->67
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's signature")).": __________________________________");
@@ -260,7 +260,7 @@
$this->Write(0, "20___-___-___");
} else {
$this->SetFont("Arial", "U", "10");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($date, 13, " "));
}
@@ -277,7 +277,7 @@
$maxpoints = 0;
$pdf = new PDF('P', 'mm', $format);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$pdf->AddSJISFont();
$pdf->Open();
$pdf->AddPage();
diff --git a/www/capnew.php b/www/capnew.php
index 3136993..41a0894 100644
--- a/www/capnew.php
+++ b/www/capnew.php
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-// $Id: capnew.php,v 1.3 2011-06-10 18:30:41 wytze Exp $
-define('REV', '$Revision: 1.3 $');
+// $Id: capnew.php,v 1.4 2012-01-24 14:26:05 root Exp $
+define('REV', '$Revision: 1.4 $');
/*
** Created from old cap.php 2003, which used the now obsoleted ftpdf package
@@ -168,7 +168,7 @@ define('REV', '$Revision: 1.3 $');
** $_GET['format'] paper format required A0-A6,Letter, Folio, B0-B6 (dflt A4)
** $_GET['watermark'] watermark on the page
** $_GET['orientation'] paper orientation default 'portrait'
-** $_SESSION['_config']['language'] for 'ja_JP' japanese default != ja_JP
+** $_SESSION['_config']['language'] for 'ja' japanese default != ja
** $_SESSION['_config']['recode'] = 'format' recode() uses it: needed ?
** recode() is aliased to php lib function recode_string()
** $_REQUEST['bw'] if exists use black/white, default use colour
@@ -336,7 +336,7 @@ define('DFL_FORMAT', 'html..utf-8');
// Japanese is not supported?
if( array_key_exists('_config', $_SESSION) ) {
if( isset($_SESSION['_config']['language']) ) {
- if($_SESSION['_config']['language'] == 'ja_JP')
+ if($_SESSION['_config']['language'] == 'ja')
define('FONT','SJIS');
else define( 'FONT', 'freesans');
}
@@ -387,7 +387,7 @@ function utf8_is_ascii_ctrl($str) {
// extend TCPF with custom functions
class CAPPDF extends TCPDF {
- // do cap form version numbering automatically '$Revision: 1.3 $'
+ // do cap form version numbering automatically '$Revision: 1.4 $'
/*public*/ function Version() {
strtok(REV, ' ');
return(strtok(' '));
diff --git a/www/coapnew.php b/www/coapnew.php
index c9e4e47..4f69247 100644
--- a/www/coapnew.php
+++ b/www/coapnew.php
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-// $Id: coapnew.php,v 1.3 2011-06-10 18:30:42 wytze Exp $
-define('REV', '$Revision: 1.3 $');
+// $Id: coapnew.php,v 1.4 2012-01-24 14:26:05 root Exp $
+define('REV', '$Revision: 1.4 $');
/*
** Created from old cap.php 2003, which used the now obsoleted ftpdf package
@@ -179,7 +179,7 @@ define('REV', '$Revision: 1.3 $');
** $_GET['format'] paper format required A0-A6,Letter, Folio, B0-B6 (dflt A4)
** $_GET['watermark'] watermark on the page
** $_GET['orientation'] paper orientation default "landscape" default 2-up (new)
-** $_SESSION['_config']['language'] for "ja_JP" japanese default != ja_JP
+** $_SESSION['_config']['language'] for "ja" japanese default != ja
** $_SESSION['_config']['recode'] = "format" recode() uses it: needed ?
** recode() is aliased to php lib function recode_string()
** $_REQUEST[bw] if exists use black/white, default use colour
@@ -371,7 +371,7 @@ define('DFL_FORMAT', 'html..utf-8');
// Japanese is not supported?
if( array_key_exists('_config', $_SESSION) ) {
if( isset($_SESSION['_config']['language']) ) {
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
define('FONT','SJIS');
else define( 'FONT', 'freesans');
}
@@ -422,7 +422,7 @@ function utf8_is_ascii_ctrl($str) {
// extend TCPF with custom functions
class COAPPDF extends TCPDF {
- // do cap form version numbering automatically "$Revision: 1.3 $"
+ // do cap form version numbering automatically "$Revision: 1.4 $"
/*public*/ function Version() {
strtok(REV, " ");
return(strtok(" "));
diff --git a/www/index.php b/www/index.php
index 5f7fc14..41b6d7a 100644
--- a/www/index.php
+++ b/www/index.php
@@ -14,8 +14,9 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/ ?>
-<?
+*/
+
+require_once('../includes/lib/l10n.php');
$id = 0; if(array_key_exists("id",$_REQUEST)) $id=intval($_REQUEST['id']);
$oldid = 0; if(array_key_exists("oldid",$_REQUEST)) $oldid=intval($_REQUEST['oldid']);
@@ -310,18 +311,12 @@
if($_SESSION['profile']['language'] == "")
{
- $query = "update `users` set `language`='".$_SESSION['_config']['language']."'
+ $query = "update `users` set `language`='".L10n::get_translation()."'
where `id`='".$_SESSION['profile']['id']."'";
mysql_query($query);
} else {
- $_SESSION['_config']['language'] = $_SESSION['profile']['language'];
-
- putenv("LANG=".$_SESSION['_config']['language']);
- setlocale(LC_ALL, $_SESSION['_config']['language']);
-
- $domain = 'messages';
- bindtextdomain("$domain", $_SESSION['_config']['filepath']."/locale");
- textdomain("$domain");
+ L10n::set_translation($_SESSION['profile']['language']);
+ L10n::init_gettext();
}
$query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`";
$res = mysql_query($query);
@@ -551,7 +546,7 @@
mysql_query($query);
$body = _("Thanks for signing up with CAcert.org, below is the link you need to open to verify your account. Once your account is verified you will be able to start issuing certificates till your hearts' content!")."\n\n";
- $body .= "http://".$_SESSION['_config']['normalhostname']."/verify.php?type=email&emailid=$emailid&hash=$hash\n\n"; //."&"."lang=".$_SESSION['_config']['language']."\n\n";
+ $body .= "http://".$_SESSION['_config']['normalhostname']."/verify.php?type=email&emailid=$emailid&hash=$hash\n\n";
$body .= _("Best regards")."\n"._("CAcert.org Support!");
sendmail($_SESSION['signup']['email'], "[CAcert.org] "._("Mail Probe"), $body, "support@cacert.org", "", "", "CAcert Support");
diff --git a/www/ttp.php b/www/ttp.php
index 2240518..6385127 100644
--- a/www/ttp.php
+++ b/www/ttp.php
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
- if($_SESSION['_config']['language'] != "ja_JP")
+ if($_SESSION['_config']['language'] != "ja")
{
define('FPDF_FONTPATH','/usr/share/fpdf/font/');
require_once('/usr/share/ufpdf/fpdf.php');
@@ -40,7 +40,7 @@
{
$this->Image($_REQUEST['bw']?'images/CAcert-logo-mono-1000.png':'images/CAcert-logo-colour-1000.png',8,8,100);
$this->SetFont('Arial','B',14);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',14);
$this->Cell(100);
$this->Cell(40,20,recode($_SESSION['_config']['recode'], _("Trusted Third Party")));
@@ -54,12 +54,12 @@
{
$this->SetY(-10);
$this->SetFont('Arial','I',8);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','I',8);
$this->Cell(0,0,'CAcert Inc. - P.O. Box 4107 - Denistone East NSW 2112 - Australia - http://www.CAcert.org',0,0,'C');
$this->SetY(-7);
$this->SetFont('Arial','',6);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',6);
$this->Cell(0,0, recode($_SESSION['_config']['recode'], _("CAcert's Root Certificate fingerprints")).": A6:1B:37:5E:39:0D:9C:36:54:EE:BD:20:31:46:1F:6B "._("and")." 135C EC36 F49C B8E9 3B1A B270 CD80 8846 76CE 8F33",0,0,'C');
}
@@ -72,7 +72,7 @@
// Show text blurb at top of page
$this->SetY(40);
$this->SetFont('Arial','',10);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',10);
$this->Write(4, recode($_SESSION['_config']['recode'], _("The CAcert Trusted Third Party (TTP) Programme is designed to assure Internet user identities through personal verification of government issued identity documents.")));
$this->Ln(7);
@@ -100,18 +100,18 @@
$this->Line(120, $top + 6, 120, $top + 36);
$this->SetXY(11, $top + 3);
$this->SetFont("Arial", "BUI", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',12);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Person Verifying Applicant's Identity")));
$this->SetXY(11, $top + 9);
$this->SetFont("Arial", "B", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Names").":"));
$this->SetXY(120, $top + 9);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Office Street Address").":"));
$this->SetFont("Arial", "B", "6");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',6);
$this->SetXY(11, $top + 14);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Profession (Please circle one)")).":");
@@ -122,7 +122,7 @@
$this->SetXY(11, $top + 22);
$this->Write(0, recode($_SESSION['_config']['recode'], "("._("as applicable")."):"));
$this->SetFont("Arial", "B", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8);
$this->SetXY(11, $top + 27);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Office Phone")).":");
@@ -147,12 +147,12 @@
$this->Line(120, $top + 6, 120, $top + 36);
$this->SetXY(11, $top + 3);
$this->SetFont("Arial", "BUI", "12");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',12);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Applicant Information")));
$this->SetXY(11, $top + 9);
$this->SetFont("Arial", "B", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Full Name (as shown on ID)").":"));
if($name)
@@ -170,11 +170,11 @@
$this->SetXY(11, $top + 21);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Date of Birth")).": ");
$this->SetFont("Arial", "B", "6");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',6);
$this->Write(0, "(".recode($_SESSION['_config']['recode'], _("YYYY-MM-DD")).")");
$this->SetFont("Arial", "B", "8");
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8);
if($dob)
{
@@ -199,7 +199,7 @@
$format = "A4";
$pdf = new PDF('P', 'mm', $format);
- if($_SESSION['_config']['language'] == "ja_JP")
+ if($_SESSION['_config']['language'] == "ja")
$pdf->AddSJISFont();
$pdf->Open();
$pdf->AddPage();
diff --git a/www/wot.php b/www/wot.php
index d70f1d5..66bf7cb 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -16,6 +16,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?>
<?
+require_once("../includes/loggedin.php");
+require_once("../includes/lib/l10n.php");
+
function show_page($target,$message,$error)
{
@@ -83,43 +86,35 @@ function show_page($target,$message,$error)
function send_reminder()
{
$body = "";
- if($_POST['reminder-lang'] != "" && $_POST['reminder-lang'] != "en_AU")
- {
- $userlang = $_POST['reminder-lang'];
- $_SESSION['_config']['reminder-lang'] = $_POST['reminder-lang'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
-
- $body .= $_SESSION['_config']['translations'][$userlang].":\n\n";
+ $my_translation = L10n::get_translation();
+
+ $_SESSION['_config']['reminder-lang'] = $_POST['reminder-lang'];
+
+ $reminder_translations[] = $_POST['reminder-lang'];
+ if ( !in_array("en", $reminder_translations, $strict=true) ) {
+ $reminder_translations[] = "en";
+ }
+
+ foreach ($reminder_translations as $translation) {
+ L10n::set_translation($translation);
+
+ $body .= L10n::$translations[$translation].":\n\n";
$body .= sprintf(_("This is a short reminder that you filled out forms to become trusted with CAcert.org, and %s has attempted to issue you points. Please create your account at %s as soon as possible and then notify %s so that the points can be issued."), $_SESSION['profile']['fname']." (".$_SESSION['profile']['email'].")", "http://www.cacert.org", $_SESSION['profile']['fname'])."\n\n";
$body .= _("Best regards")."\n";
- $body .= _("CAcert Support Team");
-
- $body .= "\n\nEnglish:\n\n";
+ $body .= _("CAcert Support Team")."\n\n";
}
-
- $body .= sprintf("This is a short reminder that you filled out forms to become trusted with CAcert.org, and %s has attempted to issue you points. Please create your account at %s as soon as possible and then notify %s so that the points can be issued.", $_SESSION['profile']['fname']." (".$_SESSION['profile']['email'].")", "http://www.cacert.org", $_SESSION['profile']['fname'])."\n\n";
- $body .= "Best regards"."\n";
- $body .= "CAcert Support Team";
-
+
+ L10n::set_translation($reminder_translations[0]); // for the subject
sendmail($_POST['email'], "[CAcert.org] "._("Reminder Notice"), $body, $_SESSION['profile']['email'], "", "", $_SESSION['profile']['fname']);
-
- if($_POST['reminder-lang'] != "" && $_POST['reminder-lang'] != "en_AU")
- {
- $userlang = $_SESSION['profile']['language'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
- }
-
+
+ L10n::set_translation($my_translation);
+
$_SESSION['_config']['remindersent'] = 1;
+ $_SESSION['_config']['error'] = _("A reminder notice has been sent.");
}
-
-
- require_once("../includes/loggedin.php");
-
loadem("account");
if(array_key_exists('date',$_POST) && $_POST['date'] != "")
$_SESSION['_config']['date'] = $_POST['date'];
@@ -322,13 +317,9 @@ $iecho= "c";
$_SESSION['profile']['points'] += $addpoints;
}
- if($_SESSION['_config']['notarise']['language'] != "")
- {
- $userlang = $_SESSION['_config']['notarise']['language'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
- }
-
+ $my_translation = L10n::get_translation();
+ L10n::set_translation($_SESSION['_config']['notarise']['language']);
+
$body = sprintf(_("You are receiving this email because you have been assured by %s %s (%s)."), $_SESSION['profile']['fname'], $_SESSION['profile']['lname'], $_SESSION['profile']['email'])."\n\n";
if($_POST['points'] != $newpoints)
$body .= sprintf(_("You were issued %s points however the system has rounded this down to %s and you now have %s points in total."), $_POST['points'], $newpoints, ($newpoints + $drow['total']))."\n\n";
@@ -359,8 +350,7 @@ $iecho= "c";
sendmail($_SESSION['_config']['notarise']['email'], "[CAcert.org] "._("You've been Assured."), $body, "support@cacert.org", "", "", "CAcert Website");
- putenv("LANG=".$_SESSION['profile']['language']);
- setlocale(LC_ALL, $_SESSION['profile']['language']);
+ L10n::set_translation($my_translation);
$body = sprintf(_("You are receiving this email because you have assured %s %s (%s)."), $_SESSION['_config']['notarise']['fname'], $_SESSION['_config']['notarise']['lname'], $_SESSION['_config']['notarise']['email'])."\n\n";
if($_POST['points'] != $newpoints)