"Move from translingo to pootle"
This commit is contained in:
root 2012-01-24 14:26:05 +00:00
parent a0070c6cd2
commit 2679d75dfc
45 changed files with 304 additions and 145839 deletions

View file

@ -16,6 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
require_once("../includes/loggedin.php"); require_once("../includes/loggedin.php");
require_once("../includes/lib/l10n.php");
loadem("account"); loadem("account");
@ -2351,7 +2352,7 @@
{ {
csrf_check("mainlang"); csrf_check("mainlang");
$lang = mysql_real_escape_string($_REQUEST['lang']); $lang = mysql_real_escape_string($_REQUEST['lang']);
foreach($_SESSION['_config']['translations'] as $key => $val) foreach(L10n::$translations as $key => $val)
{ {
if($key == $lang) if($key == $lang)
{ {

View file

@ -39,6 +39,7 @@
require_once($_SESSION['_config']['filepath']."/includes/mysql.php"); require_once($_SESSION['_config']['filepath']."/includes/mysql.php");
require_once($_SESSION['_config']['filepath'].'/includes/lib/account.php'); require_once($_SESSION['_config']['filepath'].'/includes/lib/account.php');
require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
if(array_key_exists('HTTP_HOST',$_SERVER) && if(array_key_exists('HTTP_HOST',$_SERVER) &&
$_SERVER['HTTP_HOST'] != $_SESSION['_config']['normalhostname'] && $_SERVER['HTTP_HOST'] != $_SESSION['_config']['normalhostname'] &&
@ -70,122 +71,8 @@
} }
} }
$lang = ""; L10n::detect_language();
if(array_key_exists("lang",$_REQUEST)) L10n::init_gettext();
$lang=mysql_escape_string(substr(trim($_REQUEST['lang']), 0, 5));
if($lang != "")
$_SESSION['_config']['language'] = $lang;
//if($_SESSION['profile']['id'] == 1 && 1 == 2)
// echo $_SESSION['_config']['language'];
$_SESSION['_config']['translations'] = array(
"ar_JO" => "العربية",
"bg_BG" => "Български",
"cs_CZ" => "Čeština",
"da_DK" => "Dansk",
"de_DE" => "Deutsch",
"el_GR" => "Ελληνικά",
"en_AU" => "English",
"eo_EO" => "Esperanto",
"es_ES" => "Español",
"fa_IR" => "Farsi",
"fi_FI" => "Suomi",
"fr_FR" => "Français",
"he_IL" => "עברית",
"hr_HR" => "Hrvatski",
"hu_HU" => "Magyar",
"is_IS" => "Íslenska",
"it_IT" => "Italiano",
"ja_JP" => "日本語",
"ka_GE" => "Georgian",
"nl_NL" => "Nederlands",
"pl_PL" => "Polski",
"pt_PT" => "Português",
"pt_BR" => "Português Brasileiro",
"ru_RU" => "Русский",
"ro_RO" => "Română",
"sv_SE" => "Svenska",
"tr_TR" => "Türkçe",
"zh_CN" => "中文(简体)");
$value=array();
if(!(array_key_exists('language',$_SESSION['_config']) && $_SESSION['_config']['language'] != ""))
{
$bits = explode(",", strtolower(str_replace(" ", "", mysql_real_escape_string(array_key_exists('HTTP_ACCEPT_LANGUAGE',$_SERVER)?$_SERVER['HTTP_ACCEPT_LANGUAGE']:""))));
foreach($bits as $lang)
{
$b = explode(";", $lang);
if(count($b)>1 && substr($b[1], 0, 2) == "q=")
$c = floatval(substr($b[1], 2));
else
$c = 1;
$value["$c"] = trim($b[0]);
}
krsort($value);
reset($value);
foreach($value as $key => $val)
{
$val = substr(escapeshellarg($val), 1, -1);
$short = substr($val, 0, 2);
if($val == "en" || $short == "en")
{
$_SESSION['_config']['language'] = "en";
break;
}
if(file_exists($_SESSION['_config']['filepath']."/locale/$val/LC_MESSAGES/messages.mo"))
{
$_SESSION['_config']['language'] = $val;
break;
}
if(file_exists($_SESSION['_config']['filepath']."/locale/$short/LC_MESSAGES/messages.mo"))
{
$_SESSION['_config']['language'] = $short;
break;
}
}
}
if(!array_key_exists('_config',$_SESSION) || !array_key_exists('language',$_SESSION['_config']) || strlen($_SESSION['_config']['language']) != 5)
{
$lang = array_key_exists('language',$_SESSION['_config'])?$_SESSION['_config']['language']:"";
$_SESSION['_config']['language'] = "en_AU";
foreach($_SESSION['_config']['translations'] as $key => $val)
{
if(substr($lang, 0, 2) == substr($key, 0, 2))
{
$_SESSION['_config']['language'] = $val;
break;
}
}
}
$_SESSION['_config']['recode'] = "html..latin-1";
if($_SESSION['_config']['language'] == "zh_CN")
{
$_SESSION['_config']['recode'] = "html..gb2312";
} else if($_SESSION['_config']['language'] == "pl_PL" || $_SESSION['_config']['language'] == "hu_HU") {
$_SESSION['_config']['recode'] = "html..ISO-8859-2";
} else if($_SESSION['_config']['language'] == "ja_JP") {
$_SESSION['_config']['recode'] = "html..SHIFT-JIS";
} else if($_SESSION['_config']['language'] == "ru_RU") {
$_SESSION['_config']['recode'] = "html..ISO-8859-5";
} else if($_SESSION['_config']['language'] == "lt_LT") {
$_SESSION['_config']['recode'] = "html..ISO-8859-13";
}
putenv("LANG=".$_SESSION['_config']['language']);
setlocale(LC_ALL, $_SESSION['_config']['language']);
$domain = 'messages';
bindtextdomain($domain, $_SESSION['_config']['filepath']."/locale");
textdomain($domain);
//if($_SESSION['profile']['id'] == -1)
// echo $_SESSION['_config']['language']." - ".$_SESSION['_config']['filepath']."/locale";
if(array_key_exists('profile',$_SESSION) && is_array($_SESSION['profile']) && array_key_exists('id',$_SESSION['profile']) && $_SESSION['profile']['id'] > 0) if(array_key_exists('profile',$_SESSION) && is_array($_SESSION['profile']) && array_key_exists('id',$_SESSION['profile']) && $_SESSION['profile']['id'] > 0)
{ {
@ -632,14 +519,6 @@
return(utf8_decode($data)); return(utf8_decode($data));
} }
function screenshot($img)
{
if(file_exists("../screenshots/".$_SESSION['_config']['language']."/$img"))
return("/screenshots/".$_SESSION['_config']['language']."/$img");
else
return("/screenshots/en/$img");
}
function signmail($to, $subject, $message, $from, $replyto = "") function signmail($to, $subject, $message, $from, $replyto = "")
{ {
if($replyto == "") if($replyto == "")

View file

@ -16,6 +16,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
if(!function_exists("showheader")) if(!function_exists("showheader"))
{ {
function showbodycontent($title = "CAcert.org", $title2 = "") function showbodycontent($title = "CAcert.org", $title2 = "")
@ -60,7 +62,7 @@ google_color_border = "FFFFFF";
<? include("about_menu.php"); ?> <? include("about_menu.php"); ?>
<div class="relatedLinks"> <div class="relatedLinks">
<h3 class="pointer" onclick="explode('trans')">+ <?=_("Translations")?></h3> <h3 class="pointer" onclick="explode('trans')">+ <?=_("Translations")?></h3>
<ul class="menu" id="trans"><? foreach($_SESSION['_config']['translations'] as $key => $val) { ?><li><a href="<?=$_SERVER['SCRIPT_NAME']?>?id=<?=intval(array_key_exists('id',$_REQUEST)?$_REQUEST['id']:0)?>&amp;lang=<?=$key?>"><?=$val?></a></li><? } ?></ul> <ul class="menu" id="trans"><? foreach(L10n::$translations as $key => $val) { ?><li><a href="<?=$_SERVER['SCRIPT_NAME']?>?id=<?=intval(array_key_exists('id',$_REQUEST)?$_REQUEST['id']:0)?>&amp;lang=<?=$key?>"><?=$val?></a></li><? } ?></ul>
</div> </div>
<? if(array_key_exists('mconn',$_SESSION) && $_SESSION['mconn']) { ?> <? if(array_key_exists('mconn',$_SESSION) && $_SESSION['mconn']) { ?>
<div class="relatedLinks"> <div class="relatedLinks">

View file

@ -17,6 +17,7 @@
*/ */
include_once("../includes/lib/general.php"); include_once("../includes/lib/general.php");
require_once("../includes/lib/l10n.php");
if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && $_SESSION['profile']['id'] > 0 && $_SESSION['profile']['loggedin'] != 0) if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && $_SESSION['profile']['id'] > 0 && $_SESSION['profile']['loggedin'] != 0)
{ {
@ -110,18 +111,12 @@
if($_SESSION['profile']['language'] == "") 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']."'"; where `id`='".$_SESSION['profile']['id']."'";
mysql_query($query); mysql_query($query);
} else { } else {
$_SESSION['_config']['language'] = $_SESSION['profile']['language']; L10n::set_translation($_SESSION['profile']['language']);
L10n::init_gettext();
putenv("LANG=".$_SESSION['_config']['language']);
setlocale(LC_ALL, $_SESSION['_config']['language']);
$domain = 'messages';
bindtextdomain("$domain", $_SESSION['_config']['filepath']."/locale");
textdomain("$domain");
} }
} }

3
locale/.gitignore vendored
View file

@ -1,5 +1,6 @@
# Language files are imported from translingo # Language files are imported from translingo
# => Ignore them # => Ignore them
# Use make.php if you need new ones # Use make if you need new ones
*.po *.po
*.pot
*.mo *.mo

184
locale/Makefile Normal file
View file

@ -0,0 +1,184 @@
#
# This Makefile will download the translations from our translation server (if
# they don't exist yet) and compile them. Try target help for more information
#
################################################################################
### Download ###
################################################################################
DOWNLOAD_SERVER := translations.cacert.org
PO_URL_TEMPLATE := http://$(DOWNLOAD_SERVER)/export/cacert/%/messages.po
# Only use languages that have 10% or more of translated strings
AUTO_LANGS := \
en \
de \
nl \
pt_BR \
fr \
sv \
it \
es \
hu \
fi \
ja \
bg \
pt \
da \
pl \
zh_CN \
ru \
lv \
cs \
zh_TW \
el \
tr \
ar \
LANGS := \
ar \
bg \
cs \
da \
de \
el \
en \
es \
fa \
fi \
fr \
he \
hr \
hu \
id \
is \
it \
ja \
ka \
ko \
lv \
nb \
nl \
pl \
pt \
pt_BR \
ro \
ru \
sl \
sv \
th \
tr \
uk \
zh_CN \
zh_TW \
PO_FILE_TEMPLATE := %/messages.po
MO_FILE_TEMPLATE := %/LC_MESSAGES/messages.mo
# target: all - Build locales downloading po files
.PHONY: all
all: $(AUTO_LANGS)
# target: help - Display callable targets
.PHONY: help
help:
@egrep "^# target:" [Mm]akefile
# target: clean - remove the build directories
RM := rm -rf
.PHONY: clean
clean:
-$(RM) $(LANGS:%=%/)
# target: <lang> - build this particular language
.PHONY: $(LANGS)
$(LANGS): %: $(MO_FILE_TEMPLATE)
$(LANGS:%=$(MO_FILE_TEMPLATE)): $(MO_FILE_TEMPLATE): $(PO_FILE_TEMPLATE)
mkdir -p $(@D)
#filter obsolete translations
grep --invert-match '^#~ ' $< | \
msgfmt --check --output-file $@ -
.PHONY: $(LANGS:%=$(PO_FILE_TEMPLATE))
$(LANGS:%=$(PO_FILE_TEMPLATE)):
mkdir -p $(@D)
wget --output-document - '$(@:$(PO_FILE_TEMPLATE)=$(PO_URL_TEMPLATE))' | \
# convert UTF-8 characters to HTML entities \
php -r 'while (!feof(STDIN)) echo mb_convert_encoding(fgets(STDIN), "HTML-ENTITIES", "UTF-8");' \
> $@
################################################################################
### Upload ###
################################################################################
UPLOAD_SERVER := $(DOWNLOAD_SERVER)
SSH_USER := critical
SSH_OPTIONS :=
SCP_OPTIONS := $(SSH_OPTIONS)
FILE_OWNER := www-data
POT_UPLOAD_PATH := /var/www/Pootle/po/cacert/templates/messages.pot
MANAGE_PY := /var/www/Pootle/manage.py
VERSION := Production
DESCRITPION := LibreSSL - CAcert web application (localisation files)
COPYRIGHT_YEAR := 2004-$(shell date +\%Y)
PACKAGE := LibreSSL
GETTEXT_FILE_PATTERN := \
../CommModule/client.pl \
../includes/*.php \
../includes/*/*.php \
../pages/*/*.php \
../scripts/*.php \
../www/*.php \
../www/*/*.php \
# ../tverify/*.php \
# ../tverify/*/*.php \
GETTEXT_FILES := $(wildcard $(GETTEXT_FILE_PATTERN))
# target: template - create the gettext template file, if you want to upload it
# target: onto the translation server you can directly use the
# target: target "upload"
.PHONY: template
template: messages.pot
# target: template.clean - remove anything that was created during the build of
# target: the template file
.PHONY: template.clean
template.clean:
-$(RM) messages.pot
# target: upload - upload the template to the translation server
.PHONY: upload
upload: messages.pot
scp $(SCP_OPTIONS) messages.pot $(SSH_USER)@$(UPLOAD_SERVER):$(POT_UPLOAD_PATH)
ssh $(SSH_OPTIONS) $(SSH_USER)@$(UPLOAD_SERVER) "sudo -u $(FILE_OWNER) pootle-update cacert"
# target: upload.clean - remove anything that was created during the upload
.PHONY: upload.clean
upload.clean: template.clean
messages.pot: $(GETTEXT_FILES)
xgettext --output - --sort-by-file --copyright-holder "CAcert Inc." \
--package-name "CAcert" --package-version "$(VERSION)" \
--msgid-bugs-address "translations-admin@cacert.org" $^ | \
# replace place holders in the lines before the first msgid\
sed '1,/^msgid/ { s/SOME DESCRIPTIVE TITLE/$(DESCRITPION)/; s/YEAR/$(COPYRIGHT_YEAR)/; s/PACKAGE/$(PACKAGE)/ }' \
> $@

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,35 +0,0 @@
#!/usr/bin/php -q
<?
$lang = array( "bg" => "bg_BG", "da" => "da_DK", "de" => "de_DE", "es" => "es_ES",
"fr" => "fr_FR", "fi" => "fi_FI", "he" => "he_IL", "hr" => "hr_HR",
"hu" => "hu_HU", "it" => "it_IT", "ja" => "ja_JP", "nl" => "nl_NL",
"pt" => "pt_PT", "ro" => "ro_RO", "ru" => "ru_RU", "fa" => "fa_IR",
"sv" => "sv_SE", "tr" => "tr_TR", "zh" => "zh_CN", "ar" => "ar_SY",
"el" => "el_GR", "tl" => "tl_PH", "pl" => "pl_PL", "cs" => "cs_CZ",
"ka" => "ka_GE", "is" => "is_IS", "ko" => "ko_KR", "nb" => "nb_NO");
if($argc > 1)
{
foreach($argv as $key)
{
$val = $lang[$key];
if($val != "")
{
$do = `wget -O $key.po "http://translingo.cacert.org/export2.php?pid=1&editlanguage=$val" 2>&1`;
echo $do;
echo `mkdir -p $key/LC_MESSAGES/`;
$do = `msgfmt -o $key/LC_MESSAGES/messages.mo $key.po 2>&1`;
echo $do;
}
}
} else {
foreach($lang as $key => $val)
{
$do = `wget -O $key.po "http://translingo.cacert.org/export2.php?pid=1&editlanguage=$val" 2>&1`;
echo $do;
echo `mkdir -p $key/LC_MESSAGES/`;
$do = `msgfmt -o $key/LC_MESSAGES/messages.mo $key.po 2>&1`;
echo $do;
}
}
?>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,11 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?> */
require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
?>
<form method="post" action="account.php"> <form method="post" action="account.php">
<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400"> <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper" width="400">
<tr> <tr>
@ -24,11 +28,10 @@
<td class="DataTD"><?=_("My prefered language")?>:</td> <td class="DataTD"><?=_("My prefered language")?>:</td>
<td class="DataTD"><select name="lang"> <td class="DataTD"><select name="lang">
<? <?
echo $_SESSION['_config']['language']; foreach(L10n::$translations as $key => $val)
foreach($_SESSION['_config']['translations'] as $key => $val)
{ {
echo "<option value='$key'"; echo "<option value='$key'";
if($key == $_SESSION['_config']['language']) if($key == L10n::get_translation())
echo " selected"; echo " selected";
echo ">$val</option>\n"; echo ">$val</option>\n";
} }

View file

@ -16,6 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
include_once("../includes/shutdown.php"); include_once("../includes/shutdown.php");
require_once("../includes/lib/l10n.php");
?> ?>
<? <?
if(array_key_exists('error',$_SESSION['_config']) && $_SESSION['_config']['error'] != "") if(array_key_exists('error',$_SESSION['_config']) && $_SESSION['_config']['error'] != "")
@ -32,8 +33,8 @@
<select name="reminder-lang"> <select name="reminder-lang">
<? <?
if($_SESSION['_config']['reminder-lang'] == "") if($_SESSION['_config']['reminder-lang'] == "")
$_SESSION['_config']['reminder-lang'] = $_SESSION['profile']['language']; $_SESSION['_config']['reminder-lang'] = L10n::get_translation();
foreach($_SESSION['_config']['translations'] as $key => $val) foreach(L10n::$translations as $key => $val)
{ {
echo "<option value='$key'"; echo "<option value='$key'";
if($key == $_SESSION['_config']['reminder-lang']) if($key == $_SESSION['_config']['reminder-lang'])

View file

@ -14,8 +14,11 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?> */
<?
require_once($_SESSION['_config']['filepath'].'/includes/lib/l10n.php');
$res = mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."' and `listme`='1'"); $res = mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."' and `listme`='1'");
if(mysql_num_rows($res) <= 0) if(mysql_num_rows($res) <= 0)
{ {
@ -47,7 +50,7 @@
<? if($userlang != "") { ?> <? if($userlang != "") { ?>
<tr> <tr>
<td class="DataTD"><?=_("Language")?>:</td> <td class="DataTD"><?=_("Language")?>:</td>
<td class="DataTD" align="left"><? printf(_("%s prefers to be contacted in %s"), $user['fname'], $_SESSION['_config']['translations'][$userlang]) ?></td> <td class="DataTD" align="left"><? printf(_("%s prefers to be contacted in %s"), $user['fname'], L10n::$translations[$userlang]) ?></td>
</tr> </tr>
<? } ?> <? } ?>
<? <?

View file

@ -18,6 +18,7 @@
*/ */
include_once("/home/cacert/www/includes/mysql.php"); include_once("/home/cacert/www/includes/mysql.php");
require_once('/home/cacert/www/includes/lib/l10n.php');
$query = "select * from `users` where `users`.`verified`=0 and $query = "select * from `users` where `users`.`verified`=0 and
(UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`users`.`created`)) >= 172800"; (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(`users`.`created`)) >= 172800";
@ -67,9 +68,7 @@
if($data['language'] != "") if($data['language'] != "")
{ {
$userlang = $data['language']; L10n::set_translation($data['language']);
putenv("LANG=".$userlang);
setlocale(LC_ALL, $userlang);
} }
$body = _("You are receiving this email because you had a temporary increase to 200 points. This has since expired and you have been reduced to 150 points.")."\n\n"; $body = _("You are receiving this email because you had a temporary increase to 200 points. This has since expired and you have been reduced to 150 points.")."\n\n";

View file

@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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/'); define('FPDF_FONTPATH','/usr/share/fpdf/font/');
require_once('/usr/share/ufpdf/fpdf.php'); 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->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); $this->SetFont('Arial','B',14);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',14); $this->SetFont('SJIS','',14);
$this->Cell(100); $this->Cell(100);
$this->Cell(40,20,recode($_SESSION['_config']['recode'], _("CAcert Assurance Programme"))); $this->Cell(40,20,recode($_SESSION['_config']['recode'], _("CAcert Assurance Programme")));
@ -46,12 +46,12 @@
$this->SetY(36); $this->SetY(36);
$this->SetFont('Arial','I',8); $this->SetFont('Arial','I',8);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','I',8); $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->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->Ln(3);
$this->SetFont('Arial','',6); $this->SetFont('Arial','',6);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',6); $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->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); $this->SetLineWidth(0.05);
@ -71,7 +71,7 @@
// Show text blurb at top of page // Show text blurb at top of page
$this->SetY(45); $this->SetY(45);
$this->SetFont('Arial','',10); $this->SetFont('Arial','',10);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',10); $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->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); $this->Ln(10);
@ -84,21 +84,21 @@
$this->Rect(11, $top, $this->w - 25, 60, "D"); //50 -> 60 $this->Rect(11, $top, $this->w - 25, 60, "D"); //50 -> 60
$this->SetXY(11, $top + 5); $this->SetXY(11, $top + 5);
$this->SetFont("Arial", "BUI", "20"); $this->SetFont("Arial", "BUI", "20");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',20); $this->SetFont('SJIS','BUI',20);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Applicant's Statement"))); $this->Write(0, recode($_SESSION['_config']['recode'], _("Applicant's Statement")));
$this->Rect(13, $top + 10, $this->w - 29, 6, "D"); $this->Rect(13, $top + 10, $this->w - 29, 6, "D");
$this->Line(80, $top + 10, 80, $top + 16); $this->Line(80, $top + 10, 80, $top + 16);
$this->SetXY(15, $top + 13); $this->SetXY(15, $top + 13);
$this->SetFont("Arial", "B", "12"); $this->SetFont("Arial", "B", "12");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12); $this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Names")).":"); $this->Write(0, recode($_SESSION['_config']['recode'], _("Names")).":");
if($name) if($name)
{ {
$this->SetXY(82, $top + 13); $this->SetXY(82, $top + 13);
$this->SetFont("Arial", '', "11"); $this->SetFont("Arial", '', "11");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11); $this->SetFont('SJIS','',11);
$this->Write(0, $name); $this->Write(0, $name);
} }
@ -106,18 +106,18 @@
$this->Line(80, $top + 16, 80, $top + 22); $this->Line(80, $top + 16, 80, $top + 22);
$this->SetXY(15, $top + 19); $this->SetXY(15, $top + 19);
$this->SetFont("Arial", "B", "12"); $this->SetFont("Arial", "B", "12");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12); $this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Date of Birth")).": "); $this->Write(0, recode($_SESSION['_config']['recode'], _("Date of Birth")).": ");
$this->SetFont("Arial", "", "8"); $this->SetFont("Arial", "", "8");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',8); $this->SetFont('SJIS','',8);
$this->Write(0, "(".recode($_SESSION['_config']['recode'], _("YYYY-MM-DD")).")"); $this->Write(0, "(".recode($_SESSION['_config']['recode'], _("YYYY-MM-DD")).")");
if($dob) if($dob)
{ {
$this->SetXY(82, $top + 19); $this->SetXY(82, $top + 19);
$this->SetFont("Arial", "", "11"); $this->SetFont("Arial", "", "11");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11); $this->SetFont('SJIS','',11);
$this->Write(0, $dob); $this->Write(0, $dob);
} }
@ -125,26 +125,26 @@
$this->Line(80, $top + 22, 80, $top + 28); $this->Line(80, $top + 22, 80, $top + 28);
$this->SetXY(15, $top + 25); $this->SetXY(15, $top + 25);
$this->SetFont("Arial", "B", "12"); $this->SetFont("Arial", "B", "12");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',12); $this->SetFont('SJIS','B',12);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Email Address")).":"); $this->Write(0, recode($_SESSION['_config']['recode'], _("Email Address")).":");
if($email) if($email)
{ {
$this->SetXY(82, $top + 25); $this->SetXY(82, $top + 25);
$this->SetFont("Arial", "", "11"); $this->SetFont("Arial", "", "11");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',11); $this->SetFont('SJIS','',11);
$this->Write(0, $email); $this->Write(0, $email);
} }
$this->SetXY(13, $top + 32); $this->SetXY(13, $top + 32);
$this->SetFont("Arial", "", "9"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $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."))); $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 // new da start
$this->SetXY(13, $top + 42); $this->SetXY(13, $top + 42);
$this->SetFont("Arial", "", "9"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $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 )")); $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 // new da end
@ -157,7 +157,7 @@
$this->Write(0, "20___-___-___"); $this->Write(0, "20___-___-___");
} else { } else {
$this->SetFont("Arial", "U", "10"); $this->SetFont("Arial", "U", "10");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10); $this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($date, 13, " ")); $this->Write(0, str_pad($date, 13, " "));
} }
@ -167,18 +167,18 @@
$this->Rect(11, $top, $this->w - 25, 83, "D"); //63->93 $this->Rect(11, $top, $this->w - 25, 83, "D"); //63->93
$this->SetXY(11, $top + 5); $this->SetXY(11, $top + 5);
$this->SetFont("Arial", "BUI", "20"); $this->SetFont("Arial", "BUI", "20");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',20); $this->SetFont('SJIS','BUI',20);
$this->Write(0, recode($_SESSION['_config']['recode'], _("CAcert Assurer"))); $this->Write(0, recode($_SESSION['_config']['recode'], _("CAcert Assurer")));
$this->SetFont("Arial", "", "9"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 15); $this->SetXY(13, $top + 15);
if($assurer) if($assurer)
{ {
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's Name")).": "); $this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's Name")).": ");
$this->SetFont("Arial", "", "10"); $this->SetFont("Arial", "", "10");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10); $this->SetFont('SJIS','U',10);
// $this->MultiCell($this->w - 70, 2, recode($_SESSION['_config']['recode'], $assurer)); // $this->MultiCell($this->w - 70, 2, recode($_SESSION['_config']['recode'], $assurer));
$this->Write(0, str_pad($assurer, 50, " ")); $this->Write(0, str_pad($assurer, 50, " "));
@ -187,7 +187,7 @@
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's Name")).": ________________________________________________________________"); $this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's Name")).": ________________________________________________________________");
} }
$this->SetFont("Arial", "", "9"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 22); $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)"))); $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 { } else {
$this->Write(0, "1. "); $this->Write(0, "1. ");
$this->SetFont("Arial", "U", "10"); $this->SetFont("Arial", "U", "10");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10); $this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($document1, 90, " ")); $this->Write(0, str_pad($document1, 90, " "));
} }
$this->SetFont("Arial", "", "9"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 35); $this->SetXY(13, $top + 35);
if($document2 == "") if($document2 == "")
@ -212,12 +212,12 @@
} else { } else {
$this->Write(0, "2. "); $this->Write(0, "2. ");
$this->SetFont("Arial", "U", "10"); $this->SetFont("Arial", "U", "10");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10); $this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($document2, 90, " ")); $this->Write(0, str_pad($document2, 90, " "));
} }
$this->SetFont("Arial", "", "9"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 45); $this->SetXY(13, $top + 45);
$this->Write(0, recode($_SESSION['_config']['recode'], _("Location of Face-to-face Meeting")).": "); $this->Write(0, recode($_SESSION['_config']['recode'], _("Location of Face-to-face Meeting")).": ");
@ -226,12 +226,12 @@
$this->Write(0, "_____________________________________________"); $this->Write(0, "_____________________________________________");
} else { } else {
$this->SetFont("Arial", "U", "10"); $this->SetFont("Arial", "U", "10");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10); $this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($location, 70, " ")); $this->Write(0, str_pad($location, 70, " "));
} }
$this->SetFont("Arial", "", "9"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 50); $this->SetXY(13, $top + 50);
if($maxpoints > 0) if($maxpoints > 0)
@ -241,7 +241,7 @@
$this->Write(0, recode($_SESSION['_config']['recode'], _("Points Allocated")).": ______________"); $this->Write(0, recode($_SESSION['_config']['recode'], _("Points Allocated")).": ______________");
} }
$this->SetFont("Arial", "", "9"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 54); $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."))); $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->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"); $this->SetFont("Arial", "", "9");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',9); $this->SetFont('SJIS','',9);
$this->SetXY(13, $top + 74); //22->67 $this->SetXY(13, $top + 74); //22->67
$this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's signature")).": __________________________________"); $this->Write(0, recode($_SESSION['_config']['recode'], _("Assurer's signature")).": __________________________________");
@ -260,7 +260,7 @@
$this->Write(0, "20___-___-___"); $this->Write(0, "20___-___-___");
} else { } else {
$this->SetFont("Arial", "U", "10"); $this->SetFont("Arial", "U", "10");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','U',10); $this->SetFont('SJIS','U',10);
$this->Write(0, str_pad($date, 13, " ")); $this->Write(0, str_pad($date, 13, " "));
} }
@ -277,7 +277,7 @@
$maxpoints = 0; $maxpoints = 0;
$pdf = new PDF('P', 'mm', $format); $pdf = new PDF('P', 'mm', $format);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$pdf->AddSJISFont(); $pdf->AddSJISFont();
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View file

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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 $ // $Id: capnew.php,v 1.4 2012/01/24 14:26:05 root Exp $
define('REV', '$Revision: 1.3 $'); define('REV', '$Revision: 1.4 $');
/* /*
** Created from old cap.php 2003, which used the now obsoleted ftpdf package ** 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['format'] paper format required A0-A6,Letter, Folio, B0-B6 (dflt A4)
** $_GET['watermark'] watermark on the page ** $_GET['watermark'] watermark on the page
** $_GET['orientation'] paper orientation default 'portrait' ** $_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 ? ** $_SESSION['_config']['recode'] = 'format' recode() uses it: needed ?
** recode() is aliased to php lib function recode_string() ** recode() is aliased to php lib function recode_string()
** $_REQUEST['bw'] if exists use black/white, default use colour ** $_REQUEST['bw'] if exists use black/white, default use colour
@ -336,7 +336,7 @@ define('DFL_FORMAT', 'html..utf-8');
// Japanese is not supported? // Japanese is not supported?
if( array_key_exists('_config', $_SESSION) ) { if( array_key_exists('_config', $_SESSION) ) {
if( isset($_SESSION['_config']['language']) ) { if( isset($_SESSION['_config']['language']) ) {
if($_SESSION['_config']['language'] == 'ja_JP') if($_SESSION['_config']['language'] == 'ja')
define('FONT','SJIS'); define('FONT','SJIS');
else define( 'FONT', 'freesans'); else define( 'FONT', 'freesans');
} }
@ -387,7 +387,7 @@ function utf8_is_ascii_ctrl($str) {
// extend TCPF with custom functions // extend TCPF with custom functions
class CAPPDF extends TCPDF { 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() { /*public*/ function Version() {
strtok(REV, ' '); strtok(REV, ' ');
return(strtok(' ')); return(strtok(' '));

View file

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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 $ // $Id: coapnew.php,v 1.4 2012/01/24 14:26:05 root Exp $
define('REV', '$Revision: 1.3 $'); define('REV', '$Revision: 1.4 $');
/* /*
** Created from old cap.php 2003, which used the now obsoleted ftpdf package ** 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['format'] paper format required A0-A6,Letter, Folio, B0-B6 (dflt A4)
** $_GET['watermark'] watermark on the page ** $_GET['watermark'] watermark on the page
** $_GET['orientation'] paper orientation default "landscape" default 2-up (new) ** $_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 ? ** $_SESSION['_config']['recode'] = "format" recode() uses it: needed ?
** recode() is aliased to php lib function recode_string() ** recode() is aliased to php lib function recode_string()
** $_REQUEST[bw] if exists use black/white, default use colour ** $_REQUEST[bw] if exists use black/white, default use colour
@ -371,7 +371,7 @@ define('DFL_FORMAT', 'html..utf-8');
// Japanese is not supported? // Japanese is not supported?
if( array_key_exists('_config', $_SESSION) ) { if( array_key_exists('_config', $_SESSION) ) {
if( isset($_SESSION['_config']['language']) ) { if( isset($_SESSION['_config']['language']) ) {
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
define('FONT','SJIS'); define('FONT','SJIS');
else define( 'FONT', 'freesans'); else define( 'FONT', 'freesans');
} }
@ -422,7 +422,7 @@ function utf8_is_ascii_ctrl($str) {
// extend TCPF with custom functions // extend TCPF with custom functions
class COAPPDF extends TCPDF { 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() { /*public*/ function Version() {
strtok(REV, " "); strtok(REV, " ");
return(strtok(" ")); return(strtok(" "));

View file

@ -14,8 +14,9 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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']); $id = 0; if(array_key_exists("id",$_REQUEST)) $id=intval($_REQUEST['id']);
$oldid = 0; if(array_key_exists("oldid",$_REQUEST)) $oldid=intval($_REQUEST['oldid']); $oldid = 0; if(array_key_exists("oldid",$_REQUEST)) $oldid=intval($_REQUEST['oldid']);
@ -310,18 +311,12 @@
if($_SESSION['profile']['language'] == "") 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']."'"; where `id`='".$_SESSION['profile']['id']."'";
mysql_query($query); mysql_query($query);
} else { } else {
$_SESSION['_config']['language'] = $_SESSION['profile']['language']; L10n::set_translation($_SESSION['profile']['language']);
L10n::init_gettext();
putenv("LANG=".$_SESSION['_config']['language']);
setlocale(LC_ALL, $_SESSION['_config']['language']);
$domain = 'messages';
bindtextdomain("$domain", $_SESSION['_config']['filepath']."/locale");
textdomain("$domain");
} }
$query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`"; $query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`";
$res = mysql_query($query); $res = mysql_query($query);
@ -551,7 +546,7 @@
mysql_query($query); 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 = _("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!"); $body .= _("Best regards")."\n"._("CAcert.org Support!");
sendmail($_SESSION['signup']['email'], "[CAcert.org] "._("Mail Probe"), $body, "support@cacert.org", "", "", "CAcert Support"); sendmail($_SESSION['signup']['email'], "[CAcert.org] "._("Mail Probe"), $body, "support@cacert.org", "", "", "CAcert Support");

View file

@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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/'); define('FPDF_FONTPATH','/usr/share/fpdf/font/');
require_once('/usr/share/ufpdf/fpdf.php'); 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->Image($_REQUEST['bw']?'images/CAcert-logo-mono-1000.png':'images/CAcert-logo-colour-1000.png',8,8,100);
$this->SetFont('Arial','B',14); $this->SetFont('Arial','B',14);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',14); $this->SetFont('SJIS','B',14);
$this->Cell(100); $this->Cell(100);
$this->Cell(40,20,recode($_SESSION['_config']['recode'], _("Trusted Third Party"))); $this->Cell(40,20,recode($_SESSION['_config']['recode'], _("Trusted Third Party")));
@ -54,12 +54,12 @@
{ {
$this->SetY(-10); $this->SetY(-10);
$this->SetFont('Arial','I',8); $this->SetFont('Arial','I',8);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','I',8); $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->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->SetY(-7);
$this->SetFont('Arial','',6); $this->SetFont('Arial','',6);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',6); $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->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 // Show text blurb at top of page
$this->SetY(40); $this->SetY(40);
$this->SetFont('Arial','',10); $this->SetFont('Arial','',10);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','',10); $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->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); $this->Ln(7);
@ -100,18 +100,18 @@
$this->Line(120, $top + 6, 120, $top + 36); $this->Line(120, $top + 6, 120, $top + 36);
$this->SetXY(11, $top + 3); $this->SetXY(11, $top + 3);
$this->SetFont("Arial", "BUI", "12"); $this->SetFont("Arial", "BUI", "12");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',12); $this->SetFont('SJIS','BUI',12);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Person Verifying Applicant's Identity"))); $this->Write(0, recode($_SESSION['_config']['recode'],_("Person Verifying Applicant's Identity")));
$this->SetXY(11, $top + 9); $this->SetXY(11, $top + 9);
$this->SetFont("Arial", "B", "8"); $this->SetFont("Arial", "B", "8");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8); $this->SetFont('SJIS','B',8);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Names").":")); $this->Write(0, recode($_SESSION['_config']['recode'],_("Names").":"));
$this->SetXY(120, $top + 9); $this->SetXY(120, $top + 9);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Office Street Address").":")); $this->Write(0, recode($_SESSION['_config']['recode'],_("Office Street Address").":"));
$this->SetFont("Arial", "B", "6"); $this->SetFont("Arial", "B", "6");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',6); $this->SetFont('SJIS','B',6);
$this->SetXY(11, $top + 14); $this->SetXY(11, $top + 14);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Profession (Please circle one)")).":"); $this->Write(0, recode($_SESSION['_config']['recode'],_("Profession (Please circle one)")).":");
@ -122,7 +122,7 @@
$this->SetXY(11, $top + 22); $this->SetXY(11, $top + 22);
$this->Write(0, recode($_SESSION['_config']['recode'], "("._("as applicable")."):")); $this->Write(0, recode($_SESSION['_config']['recode'], "("._("as applicable")."):"));
$this->SetFont("Arial", "B", "8"); $this->SetFont("Arial", "B", "8");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8); $this->SetFont('SJIS','B',8);
$this->SetXY(11, $top + 27); $this->SetXY(11, $top + 27);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Office Phone")).":"); $this->Write(0, recode($_SESSION['_config']['recode'],_("Office Phone")).":");
@ -147,12 +147,12 @@
$this->Line(120, $top + 6, 120, $top + 36); $this->Line(120, $top + 6, 120, $top + 36);
$this->SetXY(11, $top + 3); $this->SetXY(11, $top + 3);
$this->SetFont("Arial", "BUI", "12"); $this->SetFont("Arial", "BUI", "12");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','BUI',12); $this->SetFont('SJIS','BUI',12);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Applicant Information"))); $this->Write(0, recode($_SESSION['_config']['recode'],_("Applicant Information")));
$this->SetXY(11, $top + 9); $this->SetXY(11, $top + 9);
$this->SetFont("Arial", "B", "8"); $this->SetFont("Arial", "B", "8");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8); $this->SetFont('SJIS','B',8);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Full Name (as shown on ID)").":")); $this->Write(0, recode($_SESSION['_config']['recode'],_("Full Name (as shown on ID)").":"));
if($name) if($name)
@ -170,11 +170,11 @@
$this->SetXY(11, $top + 21); $this->SetXY(11, $top + 21);
$this->Write(0, recode($_SESSION['_config']['recode'],_("Date of Birth")).": "); $this->Write(0, recode($_SESSION['_config']['recode'],_("Date of Birth")).": ");
$this->SetFont("Arial", "B", "6"); $this->SetFont("Arial", "B", "6");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',6); $this->SetFont('SJIS','B',6);
$this->Write(0, "(".recode($_SESSION['_config']['recode'], _("YYYY-MM-DD")).")"); $this->Write(0, "(".recode($_SESSION['_config']['recode'], _("YYYY-MM-DD")).")");
$this->SetFont("Arial", "B", "8"); $this->SetFont("Arial", "B", "8");
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$this->SetFont('SJIS','B',8); $this->SetFont('SJIS','B',8);
if($dob) if($dob)
{ {
@ -199,7 +199,7 @@
$format = "A4"; $format = "A4";
$pdf = new PDF('P', 'mm', $format); $pdf = new PDF('P', 'mm', $format);
if($_SESSION['_config']['language'] == "ja_JP") if($_SESSION['_config']['language'] == "ja")
$pdf->AddSJISFont(); $pdf->AddSJISFont();
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View file

@ -16,6 +16,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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) function show_page($target,$message,$error)
{ {
@ -83,43 +86,35 @@ function show_page($target,$message,$error)
function send_reminder() function send_reminder()
{ {
$body = ""; $body = "";
if($_POST['reminder-lang'] != "" && $_POST['reminder-lang'] != "en_AU") $my_translation = L10n::get_translation();
{
$userlang = $_POST['reminder-lang']; $_SESSION['_config']['reminder-lang'] = $_POST['reminder-lang'];
$_SESSION['_config']['reminder-lang'] = $_POST['reminder-lang'];
putenv("LANG=".$userlang); $reminder_translations[] = $_POST['reminder-lang'];
setlocale(LC_ALL, $userlang); if ( !in_array("en", $reminder_translations, $strict=true) ) {
$reminder_translations[] = "en";
$body .= $_SESSION['_config']['translations'][$userlang].":\n\n"; }
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 .= 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 .= _("Best regards")."\n";
$body .= _("CAcert Support Team"); $body .= _("CAcert Support Team")."\n\n";
$body .= "\n\nEnglish:\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"; L10n::set_translation($reminder_translations[0]); // for the subject
$body .= "Best regards"."\n";
$body .= "CAcert Support Team";
sendmail($_POST['email'], "[CAcert.org] "._("Reminder Notice"), $body, $_SESSION['profile']['email'], "", "", $_SESSION['profile']['fname']); sendmail($_POST['email'], "[CAcert.org] "._("Reminder Notice"), $body, $_SESSION['profile']['email'], "", "", $_SESSION['profile']['fname']);
if($_POST['reminder-lang'] != "" && $_POST['reminder-lang'] != "en_AU") L10n::set_translation($my_translation);
{
$userlang = $_SESSION['profile']['language'];
putenv("LANG=".$userlang);
setlocale(LC_ALL, $userlang);
}
$_SESSION['_config']['remindersent'] = 1; $_SESSION['_config']['remindersent'] = 1;
$_SESSION['_config']['error'] = _("A reminder notice has been sent.");
} }
require_once("../includes/loggedin.php");
loadem("account"); loadem("account");
if(array_key_exists('date',$_POST) && $_POST['date'] != "") if(array_key_exists('date',$_POST) && $_POST['date'] != "")
$_SESSION['_config']['date'] = $_POST['date']; $_SESSION['_config']['date'] = $_POST['date'];
@ -322,13 +317,9 @@ $iecho= "c";
$_SESSION['profile']['points'] += $addpoints; $_SESSION['profile']['points'] += $addpoints;
} }
if($_SESSION['_config']['notarise']['language'] != "") $my_translation = L10n::get_translation();
{ L10n::set_translation($_SESSION['_config']['notarise']['language']);
$userlang = $_SESSION['_config']['notarise']['language'];
putenv("LANG=".$userlang);
setlocale(LC_ALL, $userlang);
}
$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"; $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) 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"; $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"); sendmail($_SESSION['_config']['notarise']['email'], "[CAcert.org] "._("You've been Assured."), $body, "support@cacert.org", "", "", "CAcert Website");
putenv("LANG=".$_SESSION['profile']['language']); L10n::set_translation($my_translation);
setlocale(LC_ALL, $_SESSION['profile']['language']);
$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"; $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) if($_POST['points'] != $newpoints)