forked from oliviermichaud1/webERP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Z_poRebuildDefault.php
executable file
·62 lines (41 loc) · 2.44 KB
/
Z_poRebuildDefault.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/* $Id: Z_poRebuildDefault.php 5784 2012-12-29 04:00:43Z daintree $*/
/* Steve Kitchen */
//$PageSecurity = 15;
include ('includes/session.inc');
$Title = _('Rebuild');
include('includes/header.inc');
/* Your webserver user MUST have read/write access to here,
otherwise you'll be wasting your time */
$PathToDefault = './locale/en_GB.utf8/LC_MESSAGES/messages.pot';
$FilesToInclude = '*.php includes/*.inc includes/*.php api/*.php reportwriter/languages/en_US/reports.php';
$xgettextCmd = 'xgettext --no-wrap --from-code=utf-8 -L php -o ' . $PathToDefault . ' ' . $FilesToInclude;
echo "<br /> <a href='" . $RootPath . "/Z_poAdmin.php'>" . _('Back to the translation menu') . "</a>";
echo '<br /><br /> ' . _('Utility page to rebuild the system default language file');
if (isset($_POST['submit'])) {
echo '<br /><table><tr><td>';
echo '<form method="post" action=' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?' . SID . '>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
/* Run xgettext to recreate the default message.po language file */
prnMsg (_('Rebuilding the default language file ') . '.....<br />', 'info', ' ');
system($xgettextCmd, $return);
prnMsg (_('Done') . '. ' . _('You should now edit the default language file header') . '<br />', 'info', ' ');
echo "<div class='centre'><a href='" . $RootPath . "/Z_poAdmin.php'>" . _('Back to the menu') . "</a></div>";
echo '</form>';
echo '</td></tr></table>';
} else { /* set up the page for editing */
echo '<div class="centre">';
echo '<br />';
prnMsg (_('Every new language creates a new translation file from the system default one') . '.<br />' .
_('This utility will recreate the system default language file by going through all the script files to get all the strings') . '.<br />' .
_('This is not usually necessary but if done before a new language is created then that language will have any new or recently modified strings') . '.<br />' .
_('Existing languages are not affected.') . '.', 'info', _('PLEASE NOTE'));
echo '<br />';
echo '<form method="post" action=' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?' . SID . '>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<input type="submit" name="submit" value="' . _('Proceed') . '" /> ';
echo '</form>';
echo '</div>';
}
include('includes/footer.inc');
?>