Copyright (C) 2008 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> 'committee_main.php', 'Administration' => 'admin/index.php'), "translations_management" ); //by default, we will edit the french translations if($_GET['translang']) $_SESSION['translang']=$_GET['translang']; if(!$_SESSION['translang']) $_SESSION['translang']="fr"; if($_GET['show']) $show=$_GET['show']; else if($_POST['show']) $show=$_POST['show']; if(!$show) $show="missing"; if($_POST['action']=="save") { //first, delete anything thats supposed to eb deleted if(count($_POST['delete'])) { foreach($_POST['delete'] AS $del) { mysql_query("DELETE FROM translations WHERE lang='".mysql_real_escape_string($_SESSION['translang'])."' AND strmd5='".mysql_real_escape_string($del)."'"); } echo happy(i18n("Translation(s) deleted")); } if($_POST['changedFields']) { $changed=explode(",",$_POST['changedFields']); foreach($changed AS $ch) { mysql_query("UPDATE translations SET val='".mysql_escape_string(stripslashes($_POST['val'][$ch]))."' WHERE strmd5='".mysql_real_escape_string($ch)."' AND lang='".mysql_real_escape_string($_SESSION['translang'])."'"); } echo happy(i18n("Translation(s) saved")); } } echo ""; echo ""; echo "
"; echo i18n("Choose a language to manage translations for"); echo ""; echo "
"; echo ""; echo "
"; echo "
"; if($show=="missing") { echo i18n("Show missing translations"); echo "  |  "; echo "".i18n("Show all translations").""; } else { echo "".i18n("Show missing translations").""; echo "  |  "; echo i18n("Show all translations"); } echo "
"; echo "
"; echo i18n("Instructions: Enter the translation below the string and click Save. Only one translation can be saved at a time. The terms %1, %2, etc get substituded with various arguments to the string, so they must appear in the translation if they are in the original string."); echo "
"; echo "
"; if($show=="missing") $showquery="AND ( val is null OR val='' )"; else $showquery=""; $q=mysql_query("SELECT * FROM translations WHERE lang='".$_SESSION['translang']."' $showquery ORDER BY str"); $num=mysql_num_rows($q); echo i18n("Showing %1 translation strings",array($num),array("number of strings")); echo "
"; echo ""; echo ""; echo ""; ?> "; echo ""; echo "\n"; echo ""; echo "".i18n("English")." / ".$translangname."\n"; while($r=mysql_fetch_object($q)) { echo ""; echo ""; echo "strmd5\">\n"; echo ""; echo htmlspecialchars($r->str); if($r->argsdesc) echo "
".i18n("Arguments:")." $r->argsdesc "; echo ""; echo ""; echo ""; echo "strmd5}\" onchange=\"return doFocus('{$r->strmd5}');\" style=\"width: 95%\" type=\"text\" name=\"val[{$r->strmd5}]\" value=\"".htmlspecialchars($r->val)."\" />"; echo ""; } echo ""; echo ""; echo "
\n"; send_footer(); ?>