old NetBSD versions and to strip msgctx if requested by the package.
This allows to replace the use of msgfmtstrip in various packages by
setting MSGFMT_STRIP_MSGCTX.
see \c, where c is anything but a legal character as defined by
msgfmt-0.10.35, then replace the backslash with a '?'. Yes, this is
a hack, but it works around a bug in the way that older msgfmt
mis-identifies some "control" sequences. This fixes building of
zh_TW.po in x11/matchbox-panel as noted in the bulk build results:
http://mail-index.netbsd.org/pkgsrc-bulk/2006/06/20/0000.html
While here, note in a header comment which packages' *.po files to
use for regression tests whenever changes to this file are made.
processing. Allow for this possiblity by falling through both names
when given input files. This fixes the builds of sysutils/dfuibe_installer
and sysutils/dfuife_curses noted in the bulk build results:
http://mail-index.netbsd.org/pkgsrc-bulk/2006/06/20/0000.html
author has presumably given us valid *.po files, so skip performing
validity checks on the *.po file. This fixes building software where
the author has actually *not* produced proper *.po files, e.g.
net/gtk-gnutella, where the de.po files have msgid/msgstr pairs that
do not have matching numbers of format specifiers (%[a-z]).
empty string (because no translation has yet been made), it's okay to
have mismatching "\n" in the msgid and msgstr texts. This should fix
PR pkg/33645 by Carl Brewer.
(1) "msgstr" not followed by any string (GNU extension), e.g.
msgid "foo"
msgstr
"bar"
(2) "\n" mismatch between msgid and msgstr, e.g.
msgid "foo\n"
msgstr "bar"
This fixes .po compilation problems in www/epiphany and
multimedia/gnome2-media.
msgid -> msgid ""
msgid"..." -> msgid "..."
msgstr -> msgstr ""
msgstr"..." -> msgstr "..."
The filtered *.po files can then be processed by msgfmt<=0.10.35.
These changes workaround bugs in *.po files in software of the "all
the world runs Linux" variety where the software author either willfully
or stupidly can't follow the format for *.po files described in section
2.2 of the gettext info manual and, in addition, makes lame excuses
when confronted with the evidence.
This closes PR pkg/33506 by Ben Collver.
now pass every line we don't need to process directly through to
msgfmt. This fixes building pt_BR.po in libgnomedb where all of the
lines end with "^M" and this script wasn't properly detecting a blank
line as a result.
those translations can have no corresponding msgid anchor in the old
PO file format. This allows all of the *.po files in gnome-vfs2 to
build correctly into *.mo files.
statement. While here fix processing of *.po files containing obsolete
statements by preserving them for msgfmt to handle. Also use a few
more constants to make the code more maintainable and readable.
it consistently whenever we read a new line of input throughout the
script. Note that this was actually broken in the original msgfmt.pl
script as well.
msgfmt, then it should set the following in the package Makefile:
USE_TOOLS+= msgfmt
To deal with message files that use the "msgid_plural" statement,
which isn't supported in NetBSD<=3.x and also in gettext<=0.10.35, we
determine if the built-in "msgfmt" is sufficiently new enough to
understand "msgid_plural". If it isn't, then we use the msgfmt.sh
script to transform the msgid_plural statements to an equivalent
construct that's understood by older msgfmt tools.
The msgfmt.sh script is a straightforward translation of the original
perl script msgfmt.pl script by Julio M. Merino Vidal into shell and
awk, which are more lightweight dependencies than perl.
We remove the USE_MSGFMT_PLURALS bits in gettext-lib/builtin.mk as they
are made obsolete by the new code in mk/tools/msgfmt.mk.
BUILD_USE_MSGFMT is still supported but will be removed in a separate
commit.