webERP Forum

Full Version: Language Refresh Issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The "function_exists" command on line 29 in "Z_poEditLangModule" always returns false and exits so language changes are never updated.

Issuing the command "msgfmt messages.po" from a shell works just fine.

This is in PHP 5.3.3 so the environment is a bit old.
There is a module for PHP to enable the gettext functions for PHP - need to configure PHP to enable it. You can see iff the gettext module is enabled by making a script by pasting the code below into a new file under your web-root and saving as say phpinfo.php

<?php
phpinfo();
?>

then point your browser to it.
(09-12-2017 03:12 AM)VortecCPI Wrote: [ -> ]The "function_exists" command on line 29 in "Z_poEditLangModule" always returns false and exits so language changes are never updated.

Issuing the command "msgfmt messages.po" from a shell works just fine.

This is in PHP 5.3.3 so the environment is a bit old.

Those scripts to update the translations are old, and haven't been maintained in a very long time. I tried to get them working for someone about 10 years ago but they never worked properly and more than once people lost their work using them.

I would stick to using either poedit (https://poedit.net/) or a simple text editor and the command line functions.

Tim
I do have gettext installed at the CENTOS level as well as at the PHP level and gettext is enabled via PHPINFO.

All works as expected from a shell command line. I started to work on the code but I wanted to wait for some feedback. Now that you agree there is an issue I will get back to work on it as this will be important n our context.

Thank you, Tim and Phil, for adding your thoughts on this. As I have mentioned before I am only a novice PHP guy but I have been developing in BASIC since 1983 and VB6, VBA, VB.net for many decades. I also have done some development with JAVA and JAVAScript and I am very capable with RDBMS and data schemas.

I will give this a go and perhaps you can review and refine my work to be sure it meets your expectations...
UPDATE...

This seems to be some sort of permissions issue specific to CENTOS...
Could it be that running programs from PHP using exec is disabled - I seem to recall some traps with PHP configuration to add the commands that are allowed somewhere. These script I think use exec to run gettext executables msgfmt and msgmerge to do the work.
I tried all sorts of work-arounds with no luck. For now we will be forced to update the language changes via PUTTY manually.

No big deal as this will not be an ongoing requirement...
I think using poedit is really the most efficient answer for translations anyway. These scripts have had a chequered history actually but handy for the odd change.
Hopefully Irma has lost some of its sting as it moves north your way.
Thank you Phil. I greatly appreciate your suggestion but I am okay with using the shell. If we had a bunch of languages POEDIT sounds like a very ice tool.
Reference URL's