[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gettext] xgettext -L shell -k --keyword X : 'VAR=VAL X' not rec
From: |
Bruno Haible |
Subject: |
Re: [bug-gettext] xgettext -L shell -k --keyword X : 'VAR=VAL X' not recognized - bug? |
Date: |
Mon, 16 Sep 2019 02:51:36 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-159-generic; KDE/5.18.0; x86_64; ; ) |
Hi,
Jason Vas Dias wrote on 2019-08-27:
> $ echo '#!/bin/bash
> function say()
> { declare -n v="$1"; shift;
> v=${LOG_TAG}${LOG_TAG:+: }$(gettext -d $MY_TEXT_DOMAIN "$@");
> return $(( (${#v}>0)?0:1 ));
> }
> tr_msg=;
> LOG_TAG=X say tr_msg hello;
> echo "$tr_msg";
> ' > t.sh
> $ xgettext -L shell -k --keyword=say:2 -o - t.sh
> $
> # (no output!)
>
> If I remove the LOG_TAG=X setting on line 7, we get:
>
> $ xgettext -L shell -k --keyword=say:2 -o - t.sh
> ...
> #: t.sh:8
> msgid "hello"
> msgstr ""
>
>
> So xgettext -L shell does not recognize bash shell command-specific
> environment variable settings when prefixed to a keyword command.
>
> Why ? All major POSIX compatible shell versions I know of support
> 'VAR=VAL $command;'
> statement syntax, which is very simple to recognize.
>
> Please could a future version of gettext recognize this legal
> shell syntax!
Thanks for the suggestion. This is now implemented through
http://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=63587292db018bf10d9ab9ca9d63dc9ee8cabfc8
It will be included in the next gettext release.
Bruno
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [bug-gettext] xgettext -L shell -k --keyword X : 'VAR=VAL X' not recognized - bug?,
Bruno Haible <=