bug-gettext
[Top][All Lists]
Advanced

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

[bug-gettext] .twjr=awk support


From: Karl Berry
Subject: [bug-gettext] .twjr=awk support
Date: Sun, 31 May 2015 23:11:54 GMT

In the Texinfo distribution, the texindex program is now written in a
"literate programming" style combining awk and Texinfo, called texiwebjr
(https://github.com/arnoldrobbins/texiwebjr), created by Arnold Robbins.
Its usual source extension is .twjr.  It works fine with
xgettext --language=awk.

So, can you please make .twjr a recognized extension implying the awk
language for xgettext?  I guess that is EXTENSIONS_AWK in
gettext-tools/src/x-awk.h.  (As long as you're there, I'd suggest adding
.gawk too.  Sometimes people want to use that when they can assume
gawk.)

By the way, I had hoped I'd be able to specify/override the xgettext
language for a given source file, but could not find a way.
E.g., it would be nice to be able to have a line in POTFILES.in like:
  texindex/ti.twjr:LANG=awk
or be able to add it as a special case to the gettext invocation,
or something.

Lacking any better idea, I ended up editing po/Makefile.in.in to
duplicate the entire xgettext call with the needed args added (diff
below, for the record).  If there is a better way, I'd like to know.

At least, it would be nice to mention this issue in the manual 
(node: xgettext Invocation, 5.1.3 Choice of input file language)
even if no good solution is available.

Thanks,
Karl

--- ORIG/po/Makefile.in.in
+++ po/Makefile.in.in
@@ -194,6 +194,13 @@
              --package-name="address@hidden@" \
              --package-version='@VERSION@' \
              --msgid-bugs-address="$$msgid_bugs_address" \
+           ; $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+             --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) 
@XGETTEXT_EXTRA_OPTIONS@ \
+             --copyright-holder='$(COPYRIGHT_HOLDER)' \
+             --package-name="address@hidden@" \
+             --package-version='@VERSION@' \
+             --msgid-bugs-address="$$msgid_bugs_address" \
+             --join-existing --language=awk texindex/ti.twjr \
            ;; \
        esac
        test ! -f $(DOMAIN).po || { \



reply via email to

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