From 566fb9ea3c4ce751bc048522e350e7befb1f0202 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 30 Oct 2008 16:55:31 +0000 Subject: [PATCH] Fix translation of headings for pre-translated headings, remove i18n calls from send_header calls that dont need it --- common.inc.php | 17 +++++++++++------ important_dates.php | 2 +- schoolaccess.php | 2 +- schoolinvite.php | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/common.inc.php b/common.inc.php index f45630f..51d9d38 100644 --- a/common.inc.php +++ b/common.inc.php @@ -354,7 +354,7 @@ function happy($str,$type="normal") } $HEADER_SENT=false; -function send_header($title="", $nav=null, $icon=null) +function send_header($title="", $nav=null, $icon=null, $titletranslated=false) { global $HEADER_SENT; global $config; @@ -369,7 +369,7 @@ function send_header($title="", $nav=null, $icon=null) ?> -<? if($title) echo i18n($title); else echo i18n($config['fairname']); ?> +<? if($title && !$titletranslated) echo i18n($title); else if($title) echo $title; else echo i18n($config['fairname']); ?> @@ -580,7 +580,10 @@ if(is_array($nav)) { foreach($nav as $t=>$l) { echo "".i18n($t).' » '; } - echo i18n($title); + if(!$titletranslated) + echo i18n($title); + else + echo $title; echo ''; } ?> @@ -606,8 +609,10 @@ else echo ""; -if($title) +if($title && !$titletranslated) echo "

".i18n($title)."

"; +else if($title) + echo "

".$title."

"; //if we're under /admin or /config then we want to show the ? help icon if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config") @@ -1023,7 +1028,7 @@ function output_page_cms($filename) if(mysql_num_rows($q)) { $r=mysql_fetch_object($q); - send_header($r->title); + send_header($r->title,null,null,true); if(file_exists("data/logo-200.gif") && $r->showlogo==1) echo ""; @@ -1035,7 +1040,7 @@ function output_page_cms($filename) echo $r->text; } else { - send_header(i18n("Error: File not found")); + send_header("Error: File not found"); echo error(i18n("The file you have requested (%1), does not exist on the server.",array($filename))); return; //not defined, lets grab the default text diff --git a/important_dates.php b/important_dates.php index 596a013..40dadd2 100644 --- a/important_dates.php +++ b/important_dates.php @@ -23,7 +23,7 @@ ?> "; diff --git a/schoolaccess.php b/schoolaccess.php index 9327979..e4ba37d 100644 --- a/schoolaccess.php +++ b/schoolaccess.php @@ -20,7 +20,7 @@ if($_GET['action']=="logout") unset($_SESSION['schoolaccesscode']); $happymsg=i18n("You have been logged out from the school access page"); } -send_header(i18n("School Access")); +send_header("School Access"); diff --git a/schoolinvite.php b/schoolinvite.php index 57f111e..07ba1c9 100644 --- a/schoolinvite.php +++ b/schoolinvite.php @@ -3,7 +3,7 @@ include "common.inc.php"; if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) { - send_header(i18n("School Participant Invitations")); + send_header("School Participant Invitations"); echo "<< ".i18n("Return to school access main page")."
"; echo "
";