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

Re: [PATCH 1/2] git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext()

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 10, 2011, 22:43 UTC
Message-ID
<BANLkTimjkuvOc4mS4hfC7PiGWrRAb_2uog@mail.gmail.com>
In-Reply-To
<7voc4ncg0l.fsf@alter.siamese.dyndns.org>
On Sun, Apr 3, 2011 at 21:05, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> Perhaps it is not an issue in real life; after all eval_gettext interface
> is not something you invented in 5 minutes without thinking deeply, but is
> what you plan to use from outside codebase that presumably has seen a wide
> use in the field, and it may be just that I am worried too much about an
> implausible corner case, but I thought I should bring it up.

It's a corner case, but if we run into it we can easily solve it like this:

    #!/bin/sh
    . gettext.sh
    HOME=/home/junio
    path='$HOME/.gitconfig'
    var=core.i18n
    (
        export HOME var ;# no need for HOME, but just an illustration
        # TRANSLATORS: $path will be "$HOME/.gitconfig"
        eval_gettext 'Look at $path and find definition of $var variable.'; echo
    )
Which results in:
    $ sh /tmp/foo.sh
    Look at $HOME/.gitconfig and find definition of core.i18n variable.
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 4 of 5 in “i18n: Shell script translation infrastructure”
  1. 0/2 i18n: Shell script translation infrastructureÆvar Arnfjörð Bjarmason, Apr 3, 2011
  2. 1/2 git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext()Ævar Arnfjörð Bjarmason, Apr 3, 2011
  3. Junio C HamanoApr 3, 2011
  4. Ævar Arnfjörð BjarmasonApr 10, 2011
  5. 2/2 git-sh-i18n.sh: add no-op gettext() and eval_gettext() wrappersÆvar Arnfjörð Bjarmason, Apr 3, 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.