diff options
author | Brendan O'Dea <bod@debian.org> | 2014-07-26 21:58:42 +1000 |
---|---|---|
committer | Brendan O'Dea <bod@debian.org> | 2014-07-26 21:58:42 +1000 |
commit | 6b27ee17d1bebc50050081842d65b37c16295b2a (patch) | |
tree | 02f4f1df0fbd886041e86f8f55629fdc84bbf18f /build-aux/fixup-texi-pot | |
parent | 981ba44c57cae737209bee69245e55e80674994d (diff) | |
download | help2man-6b27ee17d1bebc50050081842d65b37c16295b2a.tar.gz |
Add helper scripts to clean up texinfo translations
Diffstat (limited to 'build-aux/fixup-texi-pot')
-rwxr-xr-x | build-aux/fixup-texi-pot | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/build-aux/fixup-texi-pot b/build-aux/fixup-texi-pot new file mode 100755 index 0000000..0e6000b --- /dev/null +++ b/build-aux/fixup-texi-pot @@ -0,0 +1,33 @@ +#!/usr/bin/perl + +# Post-process the texinfo template to remove some entries which should not be +# translated. + +use strict; +use warnings; + +*OUT = *STDOUT; +if (@ARGV and $ARGV[0] =~ /^-o(.*)/) +{ + shift; + my $out = $1 || shift || die "$0: missing output file\n"; + open OUT, '>', $out or die "$0: can't open $out ($!)\n"; +} + +$/ = ''; # read paragraphs +while (<>) +{ + # Path name for dir entry. Corrected by fixup-texi-trans. + next if /^#\. type: menuentry/m + and /^msgid "help2man: \(help2man\)"/m; + + # "Top" node is special to texinfo. + next if /^#\. type: node/m + and /^msgid "Top"/m; + + # Macro commands, and parameters. + next if /^msgid "\@unmacro/m; + next if /^msgid "\\\\text\\\\"/m; + + print OUT; +} |