Recent

Author Topic: Merging my PO with the LCL one  (Read 235 times)

dbannon

  • Hero Member
  • *****
  • Posts: 644
    • tomboy-ng, a rewrite of the classic Tomboy
Merging my PO with the LCL one
« on: September 05, 2019, 02:23:37 am »
I have had a translator send back a translated version of the PO file Lazarus generates for me. But we noted that a number of strings did not make it into the Lazarus generated PO file, tomboy-ng.po, they are text that already exists in LCL and appear in their own pre translated (eg)  lclstrconsts.es.po file. Thats great but I need to end up with a single tomboy-ng.mo file.

So, do I merge the two *.es.po files after the translator returns it to me and before generating a mo file ?  I find there are a number of duplicates in the two files so I have to start with an edited version of one or the other, probably better to remove the duplicates from  the LCL version as that does not change anywhere as often as my tomboy-ng.po file does.

Is there a better work flow someone can suggest ? Or do I just cat the two files together at some stage ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

wp

  • Hero Member
  • *****
  • Posts: 6137
Re: Merging my PO with the LCL one
« Reply #1 on: September 05, 2019, 09:55:11 am »
I'd recommend to post this question on the Lazarus mailing list. Maxim Ganetsky who takes care of the translation system only rarely reads the forum.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

dbannon

  • Hero Member
  • *****
  • Posts: 644
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Merging my PO with the LCL one
« Reply #2 on: September 08, 2019, 09:51:51 am »
Thanks WP, but I am not on the mailing list. So I did some more diggings and found a better solution, maybe one that will interest other users.

The translate unit does try and open its own translate file (as well as the application's one) but it does not try in as many places.  I found that on Linux, its tries only -

/usr/share/locale/es/LC_MESSAGES/lclstrconsts.mo

Unlike its search for the application's file, where it first looks for $APP_NAME.po in several places and then $APP_NAME.mo in the same places.  So, this means that the sensible thing to do is separately convert both the LCL file and your app's file to .mo and put them in dir above.

I have not yet established where it looks for the LCL file on Windows and Mac, when I have done so, I will add a note about this behaviour on the wiki page.

(Note : the wiki pages currently talk about lcl.mo, strace assures me on linux at least, thats never an option.)

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng