bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

msggrep problems when priming bison-runtime's pump


From: Paul Eggert
Subject: msggrep problems when priming bison-runtime's pump
Date: Fri, 22 Jul 2005 11:53:40 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Here are the problems I ran into gettext when trying to prime Bison's
pump as I mentioned in my previous email.  Quite likely these problems
result from my misunderstandings, but then perhaps the --help strings
or manual could be improved to avoid similar misunderstandings.

I wanted to extract from (say) po/et.po the subset of msgids that are
mentioned in runtime-po/bison-runtime.pot.  The Gettext manual gives
this as an example:

  msggrep --location src/getopt.c -o compendium.po file.po

So I tried this command:

  msggrep --location runtime-po/bison-runtime.pot po/et.po

But this didn't output anything.

msggrep --help says this:

Message selection:
  [-N SOURCEFILE]... [-M DOMAINNAME]...
  [-K MSGID-PATTERN] [-T MSGSTR-PATTERN] [-C COMMENT-PATTERN]

so I then generated the msgids by hand (there are only a few) and
tried this:

   msggrep -K 'memory exhausted' -K 'syntax error' po/et.po

but this isn't the correct usage for msggrep.  That --help message is
a bit confusing.  I then looked at the msggrep source code and tried
this:

   msggrep -K -e 'memory exhausted' -e 'syntax error' po/et.po

This worked, except that I didn't want one of the 'syntax error'
messages.  That is, of the following msgids extracted by that
msggrep:

   msgid "memory exhausted"
   msgid "syntax error"
   msgid "syntax error, unexpected %s"
   msgid "syntax error, unexpected %s, expecting %s or %s or %s or %s"
   msgid "syntax error, unexpected %s, expecting %s or %s or %s"
   msgid "syntax error, unexpected %s, expecting %s or %s"
   msgid "syntax error, unexpected %s, expecting %s"
   msgid "syntax error: cannot back up"
   msgid "syntax error; also memory exhausted"

I didn't want the last one (since it's no longer in bison-runtime).
However, I couldn't come up with a pattern to do that.  For example,

   msggrep -K -E -e 'memory exhausted' -e '^syntax error($|[^;])' po/et.po

still outputs that last msgid.  I ended up filtering it out with 'sed'.

Finally, msggrep outputs lots of messages like this:

msggrep: warning: Locale charset "UTF-8" is different from
                  input file charset "ISO-8859-15".
                  Output of 'msggrep' might be incorrect.
                  Possible workarounds are:
                  - Set LC_ALL to a locale with encoding ISO-8859-15.
                  - Convert the translation catalog to UTF-8 using 'msgconv',
                    then apply 'msggrep',
                    then convert back to ISO-8859-15 using 'msgconv'.

These messages are alarming, and I don't think they apply here.  Or
perhaps it's always safe if I set LC_ALL=C before running msggrep?  At
any rate, there should be a reliable way to do this little task
without getting the warning, and without having to set LC_ALL to a
different value for each catalog, in a catalog-dependent way.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]