webERP Forum
Language Refresh Issue - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (/forumdisplay.php?fid=8)
+--- Thread: Language Refresh Issue (/showthread.php?tid=7877)



Language Refresh Issue - VortecCPI - 09-12-2017 03:12 AM

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.


RE: Language Refresh Issue - phil - 09-12-2017 06:00 AM

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.


RE: Language Refresh Issue - falkoner - 09-12-2017 06:12 AM

(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


RE: Language Refresh Issue - VortecCPI - 09-12-2017 09:28 PM

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...


RE: Language Refresh Issue - VortecCPI - 09-13-2017 12:40 AM

UPDATE...

This seems to be some sort of permissions issue specific to CENTOS...


RE: Language Refresh Issue - phil - 09-13-2017 06:46 AM

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.


RE: Language Refresh Issue - VortecCPI - 09-13-2017 07:41 AM

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...


RE: Language Refresh Issue - phil - 09-13-2017 08:01 AM

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.


RE: Language Refresh Issue - VortecCPI - 09-14-2017 06:31 AM

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.