[Lazarus] Multilang application and syncing .po files

Carlos E. R. robin.listas at telefonica.net
Tue Jun 19 13:37:14 CEST 2018


On 2018-06-19 13:09, Tomáš Emresz via Lazarus wrote:
> Hello,
> 
> i  have  done generating .po files, could translate it through PoEdit,
> but  -  when  i add some RS or component, Lazarus update only main .po
> file,  not  .cs.po etc. So could Lazarus update these files too, or is
> there  any  merge tool for this ? Of course, I understand, that I must
> translate  this  string  after,  but  this  time,  I  sync  this files
> manually, which is bad.
> 
> Any idea ?

I'll answer as translator, I do not yet know how Lazarus handles this.

The programmer should only change the .pot files.

There are other tools that propagate the changes in the .pot to the .po files, which can be used by the programmer (in the Makefile) or the translators, using "msgmerge".

For example, a translator could do:

  msgmerge --previous --no-wrap --force-po \
    -U $POFILE -C ../memory.es.po $POTFILE
  msgfmt --check --stat $POFILE
  rm messages.mo


The translator has access to previous translations and memory files to do fuzzy automatic translations which you probably as programmer can't.

The programmer could do:

  msgmerge --previous --no-wrap --force-po -U $POFILE $POTFILE
  msgfmt --check --stat $POFILE
  rm messages.mo

Notice the missing memory file


(and repeat for each language)



A sample script as programmer, for all languages:

#!/bin/bash

for FILES in `ls *.po` ;
do
    echo
    echo $FILES "-------------------------------------------------------------"
    echo
    F=`basename $FILES .po`
    FF=`basename $F .es`
    POFILE=$FF.es.po
    POTFILE=../../00-pot/$FF.pot

    if test -f $POFILE -a -f $POTFILE; then
        echo Applying msgmerge to $POFILE
        msgmerge --previous --no-wrap --force-po -U $POFILE $POTFILE
        msgfmt --check --stat $POFILE
        rm messages.mo
    else
        echo "Not found: " $POFILE or  $POTFILE
    fi || { echo "msgmerge --no-wrap --force-po for \"$POTFILE\" failed" ; }

done


Of course, you'd have to adapt paths to your situation.


-- 
Cheers / Saludos,

		Carlos E. R.
		(from 42.3 x86_64 "Malachite" at Telcontar)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180619/df573445/attachment.sig>


More information about the Lazarus mailing list