webERP Forum
Update/Upgrade Messages.po File? - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (http://www.weberp.org/forum/forumdisplay.php?fid=1)
+--- Forum: How To ? (http://www.weberp.org/forum/forumdisplay.php?fid=6)
+--- Thread: Update/Upgrade Messages.po File? (/showthread.php?tid=8269)

Pages: 1 2


Update/Upgrade Messages.po File? - VortecCPI - 12-05-2018

Our instance of webERP 4.14.1 has quite a few modifications to the messages.po file as well as to many other scrips. Over time I have done my very best to merge 4.14.1 with 4.15.X but I want to upgrade all of webERP when 4.15.1 is released.

What is the best way to bring over or merge/synchronize all the existing changes from 4.14.1 messages.po to 4.15.X messages.po?


RE: Update/Upgrade Messages.po File? - TimSchofield - 12-05-2018

The GNU gettext utility (https://www.gnu.org/software/gettext/) which is used to generate the .po and .mo files has a number of useful commands. The command msgmerge does what you require I think.

I think there is an application called poedit that I have never used but I believe it presents a GUI interface for the gettext functionality.

Hope it helps,
Tim


RE: Update/Upgrade Messages.po File? - VortecCPI - 12-05-2018

Wow!!! How awesome is that?!

https://www.gnu.org/software/gettext/manual/gettext.html#msgmerge-Invocation

https://www.gnu.org/software/gettext/manual/html_node/msgmerge-Invocation.html

I actually do recall you mentioning to Windows Poedit application quite a while ago...
Worked like a charm! Thank you so much!
For others the coomand is:

msgmerge messages.po messages.pot --no-wrap --output-file=messagesnew.mo

Where:
messages.po is the current 4.X.X file
messages.pot is the new template file from 4.5.X
messagesnew.mo is the new file to be moved to the 4.5.X locale folder

messages.pot is the new template file from 4.5.X is found in /locale/en_GB.utf8/LC_MESSAGES

Or here: https://github.com/webERP-team/webERP/blob/master/locale/en_GB.utf8/LC_MESSAGES/messages.pot


RE: Update/Upgrade Messages.po File? - VortecCPI - 12-10-2018

I made this file to help with this process.

Please have a look and feel free to make this hack job meet our standards!


RE: Update/Upgrade Messages.po File? - TurboPT - 12-10-2018

Paul, I'll add the SQL for the script table as well, but 2 questions:
  1. Should a link to this script be added to Z_poAdmin.php? (if so, I'll add that too)
  2. The verbiage in the prnMsg seems to imply new files created (though an update), would this be correct? If not, what would you like the text to show instead?



RE: Update/Upgrade Messages.po File? - VortecCPI - 12-10-2018

Paul,

This was a very quick hack job so it needs some work. I am not the best person to tidy up all the code, hence a bit of a cop out on my part. It started as a bit of an experiment to see if I could help others when they upgrade to a new version and since 4.15.1 is imminent my thought was you guys could do a far better job in less time than I ever could.

The message verbiage is a leftover and I think we want to add a link as you stated and we may also want to copy messages.po to messages.po.old as we do with in the other PO management scripts.

Sorry about dropping this on you in this manner...


RE: Update/Upgrade Messages.po File? - TimSchofield - 12-10-2018

Those Z_po scripts have caused trouble in the past with people losing the work that they had done, and stuff getting scrambled. Years ago I spent a long time with somebody trying to get them debugged but gave up


RE: Update/Upgrade Messages.po File? - TurboPT - 12-10-2018

Hmmm, then I might wait for another release on this one. I did try another unrelated script, for the headers, but I couldn't get it to load any header info. No big deal I'll move on...

Trying to get the BankMatching and the balance sheet link matters. I'm close on the BankMatching, but no progress (yet) on the link...
Release is delayed at the moment.


RE: Update/Upgrade Messages.po File? - VortecCPI - 12-13-2018

Okay... I believe we need to -N switch to prevent fuzzy matching...

-N
--no-fuzzy-matching
Do not use fuzzy matching when an exact match is not found. This may speed up the operation considerably.
Tried out PoEdit per Tim's suggestion and though it needs a few special settings it does the job.

When using PoEdit be sure to turn of Fuzzy Match, Wrap at NN, and Preserve Formatting.

If anybody needs help with PoEdit ask me here and I will try to walk you through it.


RE: Update/Upgrade Messages.po File? - TimSchofield - 12-13-2018

Yes, I remember now that I corrupted some files once with fuzzy matching. It really isn't that good a feature.

Tim