Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Update/Upgrade Messages.po File?
12-05-2018, 07:39 AM (This post was last modified: 12-05-2018 07:40 AM by VortecCPI.)
Post: #1
Update/Upgrade Messages.po File?
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?

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
12-05-2018, 09:17 AM
Post: #2
RE: Update/Upgrade Messages.po File?
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
Visit this user's website Find all posts by this user
Quote this message in a reply
12-05-2018, 09:26 AM (This post was last modified: 12-05-2018 10:19 AM by VortecCPI.)
Post: #3
RE: Update/Upgrade Messages.po File?
Wow!!! How awesome is that?!

https://www.gnu.org/software/gettext/man...Invocation

https://www.gnu.org/software/gettext/man...ation.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/bl...ssages.pot

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2018, 01:55 AM (This post was last modified: 12-10-2018 01:56 AM by VortecCPI.)
Post: #4
RE: Update/Upgrade Messages.po File?
I made this file to help with this process.

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


Attached File(s)
.php  Z_poUpdateExisting.php (Size: 4.34 KB / Downloads: 1)

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2018, 04:57 AM (This post was last modified: 12-10-2018 05:33 AM by TurboPT.)
Post: #5
RE: Update/Upgrade Messages.po File?
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?
Find all posts by this user
Quote this message in a reply
12-10-2018, 05:55 AM (This post was last modified: 12-10-2018 05:56 AM by VortecCPI.)
Post: #6
RE: Update/Upgrade Messages.po File?
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...

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2018, 08:26 AM
Post: #7
RE: Update/Upgrade Messages.po File?
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
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2018, 09:29 AM
Post: #8
RE: Update/Upgrade Messages.po File?
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.
Find all posts by this user
Quote this message in a reply
12-13-2018, 04:34 AM (This post was last modified: 12-13-2018 04:39 AM by VortecCPI.)
Post: #9
RE: Update/Upgrade Messages.po File?
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.

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
12-13-2018, 06:55 PM
Post: #10
RE: Update/Upgrade Messages.po File?
Yes, I remember now that I corrupted some files once with fuzzy matching. It really isn't that good a feature.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)