<?PHP
/****************************************************************************************
 * SMI (Services Maintenance Interventions) est une gestion libre de maintenance et de SAV
 *
 * Version 1.0.1
 *
 * Copyright (C) 2006-2015  Sylvain FATOME
 * 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;
 * either version 2 of the License, or (at your option) any later version.
 *
 * 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
 * (in the directory docs);
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 *
 * Contact : galawa@free.fr
 *
 * Web : http://smi.no-ip.org
 ****************************************************************************************/

include('POTCreator.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>SMI : <?PHP echo _("CREATION DU FICHIER .POT"); ?></title>
    <!-- Feuille de style pour les affichages -->
    <link href="../../css/smi.css" rel="stylesheet" type="text/css">
</head>
<body>
<p><img src="../../img/logo.gif" alt="logo SMI"></p>
<?PHP
$rep_to_scan = str_replace('\_install\tools', '', dirname(__FILE__));
// echo "scan : ".$rep_to_scan."<br>";
echo '<p class="annot_std_it">scan du dossier : ' . $rep_to_scan . '</p>';

$potfile = $rep_to_scan . '\lng\trans.pot';
// echo "pot : ".$potfile."<br>";

$obj = new POTCreator;
$obj->set_root($rep_to_scan);
$obj->set_exts('php|tpl');
// $obj->set_regular('/_[_|e]\([\"|\']([^\"|\']+)[\"|\']\)/i');
$obj->set_regular('/_[_|e]?\([\"|\']([^\"|\']+)[\"|\']\)/i');
// $obj->set_charset('iso-8859-1');
$obj->set_charset('UTF-8');
$obj->set_base_path($rep_to_scan . '\inc');
$obj->set_read_subdir(true);
$obj->write_pot($potfile);

echo '<p class="annot_std_it">Le fichier ' . $potfile . ' a été créé.</p>';
?>
</body>
</html>
