root/modules/branches/2.10/languagestatus/functions.inc.php

Revision 13091, 1.2 kB (checked in by p_lindheimer, 1 year ago)

adds FREEPBX_IS_AUTH checking to most module files re #5478

Line 
1 <?php
2 if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
3 // Copyright (C) 2011 Mikael Carlsson (mickecarlsson at gmail dot com)
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation, version 2
8 // of the License.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14
15 // This function calls msgattrib twice, once for getting the total strings in the .pot file
16 // and once for getting the translated strings in the .po fro the module
17 function check_translate_status($language_path, $language, $module)
18 {
19 $totalmsgcmd        = "msgattrib --stringtable-output ".$language_path.$module.'.pot | grep "^\"" | wc -l';
20 $translatedmsgcmd   = "msgattrib --stringtable-output --translated ".$language_path.$language."/LC_MESSAGES/".$module.'.po | grep "^\"" | wc -l';
21 exec($totalmsgcmd, $total);
22 exec($translatedmsgcmd, $total);
23 return($total);
24 }
25 ?>
26
Note: See TracBrowser for help on using the browser.