Subject: Re: call-gettext correction
   From: "Andrew W. Nosenko" awnATbcsDOTzpDOTua
     To: Funk Gabor funkDOTgaborAThunetkftDOThu
   Date: Sun, December 8, 2002 6:30 pm
Funk Gabor wrote:
: >>Don't worry about wrapped msgid and msgstr -- this
: >>situation is handled by `po2pm' correctly.
: 
: I see. But I partially modified an old "fr" language module,
: and now I have an updated english one. I started merging
: them, and sort out the unique [new] and the equal [already
: translated] strings, but for this I pretty much need "one string
: in one line". I'm not yet arrived to po2pm phase.
: Any suggestion how to automate the above?
: 
Language_de_iso8859_1.pm, Language_fi.pm and Language_fr.pm
are have format:
    someheader
    msgstr "..."
    msgid "..."
    [...]
    msgstr "..."
    msgid "..."
    somefooter
Therefore we can (Language_fr.pm is used as example):
1. cut off header and footer and write msgid/msgstr pairs part into some
   file (fr_tmp.po, for example)
2. Check and reformat result:
        xgettext -L PO --strict -E -o fr.po fr_tmp.po
   `-E' (aka `--escape') is needed for prevent the non-US-ASCII symbols
   like \351 (octal, LATIN SMALL LETTER E WITH ACUTE).
3. Some amount of fatal errors will be produced at step #2 (19 for
   Language_fr) because
   3.1  string
            msgtr "Votre navigateur ou cache web a tronqu\351 votre envoi."
        is not valid (should be `msgstr', not `msgtr')
   3.2  strings like 
            msgid "Changed the item title, was "%0""
        are not valid because `"' character should be quoted:
            msgid "Changed the item title, was \"%0\""
   3.3  duplicate msgid exist
            msgid "Rebuild the cache and dependency files"
   You need to correct these errors and repeat step #2
4. Replace in the header of resulting <LANG>.po (fr.po for this example)
   `charset=CHARSET' to appropriate value (`charset=iso-8859-15' if I
   not mistaken).
5. Move this file into <faqomatic-src-dir>/po/ if this not done already
6. Synchronize with current message strings by `make <LANG>.pox':
        make fr.pox
7. Edit .pox file as need
8. Rename .pox into .po, produce new Language_<LANG>.pm and move it into
   right place
        mv fr.pox fr.po
        po2pm fr.po Language_fr.pm
        mv Language_fr.pm ../lib/FAQ/OMatic/
-- 
Andrew W. Nosenko    (awnATbcsDOTzpDOTua) |