Re: Bikeshedding advice on the ab/i18n-scripts series
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- May 16, 2011, 16:26 UTC
- Message-ID
- <20110516162600.GA25468@elie>
- In-Reply-To
- <BANLkTi==pxyy7OeZT0mn33iJHrc5R7vHBw@mail.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
Show 10 quoted lines
> Oh, and for all the convertion of: > > echo >&2 "$(gettext "foobar")" > > I've already done: > > ( > gettext "foobar" && > echo > ) >&2
Some day we might want to introduce a gettext_ln function or something similar. But that doesn't seem urgent; I wouldn't be appalled by having to read 'gettext "foobar" && echo' in a block surrounded by braces (or even a subshell, even though it makes shells waste a fork()).
As for what to call the envvars, I have no strong preference there, either. If you don't care about compatibility with the real gettext.sh then it should be possible to do the variable munging automatically, using a loop:
for var in $(git sh-i18n--envsubst --variables "$fmt") do eval "sh_i18n_$var"=\$var export "sh_i18n_$var" done
with an understanding that git sh-i18n--envsubst substitutes in ${sh_i18n_$var} where it sees '$var' in the format string.
But if we do want to use the real envsubst some day then that is not possible. I dunno.