diff options
author | jlam <jlam@pkgsrc.org> | 2006-04-14 22:37:38 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2006-04-14 22:37:38 +0000 |
commit | 1c39903d1496b50d38070d1ddbdacdfd0c3894d1 (patch) | |
tree | 5cac5d6211a2774d0f8b0d1dde09e8cf6671c4b1 /mk/tools/msgfmt.sh | |
parent | b770e349e67bec61e99a32e26cf4f6043ea18973 (diff) | |
download | pkgsrc-1c39903d1496b50d38070d1ddbdacdfd0c3894d1.tar.gz |
Drop all msgstr[N] translations besides msgstr[0] and msgstr[1] because
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.
Diffstat (limited to 'mk/tools/msgfmt.sh')
-rwxr-xr-x | mk/tools/msgfmt.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mk/tools/msgfmt.sh b/mk/tools/msgfmt.sh index bf948395bb0..43f073de4b8 100755 --- a/mk/tools/msgfmt.sh +++ b/mk/tools/msgfmt.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: msgfmt.sh,v 1.10 2006/04/14 22:23:25 jlam Exp $ +# $NetBSD: msgfmt.sh,v 1.11 2006/04/14 22:37:38 jlam Exp $ # # Copyright (c) 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -248,6 +248,19 @@ BEGIN { if (result < 0) break } + # We drop all other "msgstr[N]" translations since the + # old format only supported a single translation per + # plural form. + # + MSGSTRN_RE = ORE "msgstr[[]([2-9]|[1-9][0-9]+)[]][ ]+" + if ($0 ~ MSGSTRN_RE) { + while (result = getline) { + if ($0 !~ ORE "[ ]*\"") break + print $0 + } + if (result < 0) break + } + # Pass remaining lines verbatim if ($0 ~ /^#/ || $0 ~ /^[ ]*$/) { print $0 |