git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 2 of 9 in “Bikeshedding advice on the ab/i18n-scripts series”
  1. Ævar Arnfjörð BjarmasonMay 16, 2011
  2. Jonathan NiederMay 16, 2011
  3. Junio C HamanoMay 16, 2011
  4. Ævar Arnfjörð BjarmasonMay 16, 2011
  5. Junio C HamanoMay 16, 2011
  6. Ævar Arnfjörð BjarmasonMay 16, 2011
  7. Jonathan NiederMay 16, 2011
  8. Ævar Arnfjörð BjarmasonMay 16, 2011
  9. Junio C HamanoMay 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.