[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Plural format again
From:       Chusslove Illich <caslav.ilic () gmx ! net>
Date:       2007-05-20 0:02:17
Message-ID: 200705200202.24816.caslav.ilic () gmx ! net
[Download RAW message or body]


> [: Sahachart Anukulkitch :]
> My solution now is to open the PO file with an editor and delete the
> msgstr[1]: entries which are Plural2 translation strings from the file. Do
> you guys have any idea that will automate this action, as it seems that
> Kbabel doesn't do its job?

I've been putting together some scripts past few days, they are now in
l10n-kde4/scripts.

To batch set the proper plural header (the Plural-Forms: bit in the header),
use change-plural-header.pl. It takes PO filenames from the command line,
reads the plural header from the first, and propagates it to all others. So,
first enter the proper header manually in one PO file (say kdelibs.po), and
then use this to fix it everywhere else:

  cd $KDESVN/trunk/l10n-kde4/LL/messages
  find -iname '*.po' | xargs ../../scripts/change-plural-header.pl kdelibs/kdelibs.po

To batch fix the number of msgstrs in each plural message according to
file's plural header, use fix-num-plural-msgstr.pl. It also takes PO
filenames from the command line, so use this to fix everything:

  cd $KDESVN/trunk/l10n-kde4/LL/messages
  find -iname '*.po' | xargs ../../scripts/fix-num-plural-msgstr.pl

Both these scripts will modify files only if necessary and output modified
filenames, so you can run them preventively and see what needs attention.

-- 
Chusslove Illich (Часлав Илић)
Serbian KDE translation team

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic