A tool for help to translate

2005-04-22
2013-05-30
  • Hi,
    This a tool to help to detect changes in localisation files between an older and a new version.
    This tool list all new elements of $trans array. Then you have only to copy and paste the result of the tool in your localized file and translate.
    To install it, create a folder tools in locale/xx/ where xx is your language.
    Copy and paste the following code in "detect_change.php" file and in this folder.
    Then, modify the to constants on the begin of the file fr your conf.
    Good stuff.
    Eric

    <?php
    /**********************************************************************************
    *   Copyright(C) 2004 Eric MALIE
    *
    *   This file is part of OpenBiblio.
    *
    *   OpenBiblio 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; either version 2 of the License, or
    *   (at your option) any later version.
    *
    *   OpenBiblio 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 OpenBiblio; if not, write to the Free Software
    *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    ***********************************************************************************/

    /***********************************************************************************
      *  Instruction for tranlators
      *
      *  This file help you to detect changes in locale files
      *  between 2 versions of openbiblio
      *
      *  Usage :
      *
      *
      *
      *
      *
      *
      *
      *************************************************************************************/

    ?>
    <HTML>
    <HEAD>
    <TITLE>Scan file to translate</TITLE>
    </HEAD>
    <BODY>
    <?

      if (isset($file))
      {

         // Put here the name of the directory and file of your translated files
         $old_loc = "../";
         // Put here the name of the directory an file of the new file version
         $new_loc = "../../en/";

         if (file_exists($old_loc.$file)&&file_exists($new_loc.$file))
         {

              // Reading the tranlation file in older version
              require_once($old_loc.$file);
              $trans_old = $trans;

              // Reading the tranlation file in new version
              require_once($new_loc.$file);
              $trans_new = $trans;

              $i=0;
              while (list($key,$val)=each($trans_new))
              {
                   if (!array_key_exists($key,$trans_old))
                   {
                             $i++;
                             echo "\$trans[\&quot;$key\&quot;] = \&quot;\\$val\&quot;;";
                             echo "<br>";
                   }
              }

              if ($i)
              echo ("<BR>$i variable(s) to translate detected in file \&quot;<B>$old_loc$file</B>\&quot;.");
              else
              echo ("No difference between the two files <b>\&quot;$file</b>\&quot;.");
           }
           else
                echo ("File <b>\&quot;$old_loc$file</b>\&quot; or <b>\&quot;$new_loc$file</b>\&quot; doesn't exists.");
      }

    ?>
    <FORM name="frm" action="detect_change.php" method="post">
         <P><BR>
         File to scan : <INPUT TYPE="text" SIZE="20" NAME="file" VALUE="<?php echo $file; ?>"><BR>
         <BR>
         <INPUT TYPE="submit" VALUE="Scan" name="submit">
         </P>
    </FORM>
    </BODY>
    </HTML>

     
    • Peter Leschev
      Peter Leschev
      2005-04-26

      Hi,
             I have something similar to this checked into cvs (http://cvs.sourceforge.net/viewcvs.py/obiblio/openbiblio060/install/translations_check.php?view=markup). See         http://obiblio.sourceforge.net/rc/translations_check.html for example of the output.... Gives us a good indication of what needs fixing before a release.

      Cheers,
      Peter

       
    • > See http://obiblio.sourceforge.net/rc/translations_check.html

      In this link I see finnish language. Is there a finnish translation patch somewhere? I can't seem to find one.

      Timo

       
      • Micah Stetson
        Micah Stetson
        2005-09-02

        Someone else posted a link to the patch.  I reopened it so people can find it.

        Micah

         
    • http://sourceforge.net/tracker/index.php?func=detail&aid=1168927&group_id=50071&atid=458476

      This patch received the Closed Status after applying to 060 CVS
      Probably you did not see it because the browse patches pages Status Open by default.