Update of /cvsroot/fink/web
In directory sc8-pr-cvs17:/tmp/cvs-serv16978

Modified Files:
        header.inc 
Added Files:
        fink.i18n.js 
Log Message:
adding translation function

Index: header.inc
===================================================================
RCS file: /cvsroot/fink/web/header.inc,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- header.inc  18 Apr 2007 16:27:45 -0000      1.105
+++ header.inc  10 Jun 2007 09:18:10 -0000      1.106
@@ -152,6 +152,16 @@
 // converts xml style tag to html 4.01 transitional (ad hoc)
 $metatags = ereg_replace('<([^/]*)/>', '<\1>', $metatags);
 
+// [translation] Function used in doc and faq for translation
+
+function show_form() {
+       if (function_exists('i18n_show_form')) {
+               i18n_show_form();
+       } else {
+               echo "translate";
+       }
+}
+
 // Functions Used in PDB
         
 function it_start() {
@@ -293,7 +303,7 @@
        <? if ($metatags) echo $metatags; ?>
        <link rel="start" href="<? print $root ?>index.php">
        <link rel="copyright" href="<? print $root ?>legal.php">
-
+    <? if ($i18n_enable_form) echo '<script type="text/javascript" src="' . 
$root . 'fink.i18n.js"></script>('; ?>
 
 </head>
 <body bgcolor="#ffffff" text="#000000" link="#0000f0" vlink="#800080" 
alink="#ff3333">

--- NEW FILE: fink.i18n.js ---
/* $Id: fink.i18n.js,v 1.1 2007/06/10 09:18:10 babayoshihiko Exp $ */
// +--------------------------------------------------------------------------+
// | fink.i18n.js                                                             |
// +--------------------------------------------------------------------------+
// | Copyright (c)                                                            |
// +--------------------------------------------------------------------------+
// | License:  GNU/GPL - http:/www.gnu.org/copyleft/gpl.html                  |
// +--------------------------------------------------------------------------+
// | Used by all the PHP files at http:/www.finkproject.org                   |
// |    to produce the headers (incl HTML headers and top parts)              |
// |                                                                          |
// | usage:    1. read the comments                                           |
// |           2. include this file in <head> in HTML file                    |
// +--------------------------------------------------------------------------+
// | issues:                                                                  |
// |           1. too many! issues remain                                     |
// |                                                                          |
// +--------------------------------------------------------------------------+


function i18n_Init(form_id){
        //alert("test");
        var e = document.getElementById('i18n_form_' + form_id);                
// form to show
        var f = document.getElementById('i18n_showform_' + form_id);    // 
[translate] to hide
        
        // Change the bgcolor of the text to be translated.
        f.parentNode.style.backgroundColor = "#ffc";
        f.parentNode.style.border ="2px solid #ccc";
        
        // Guesses the suitable window size for column width.
        var colwidth = (document.width - 80) / 9;
        colwidth = (colwidth > 40 ? colwidth : 40);
        
        e.getElementsByTagName('textarea')[0].cols = colwidth;
        
        // Unset style property to be visible.
        e.style.display = '';
        f.style.display = 'none';
}

function i18n_Close(form_id){
        //alert("test");
        var e = document.getElementById('i18n_form_' + form_id);                
// form to hide
        var f = document.getElementById('i18n_showform_' + form_id);    // 
[translate] to show
        
        // Revert the bgcolor.
        f.parentNode.style.backgroundColor = "#fff";
        f.parentNode.style.border ="none";
        
        // Set style property to be invisible.
        e.style.display = 'none';
        f.style.display = '';
}


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to