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

Re: [RFC/PATCH] i18n: add infrastructure for translating Git with gettext

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 11, 2011, 10:34 UTC
Message-ID
<CACBZZX5VNM46qA9QZmdA2zYq+=w4Y69_74AffRgjvsRtj95kdg@mail.gmail.com>
In-Reply-To
<m31utfnedi.fsf@localhost.localdomain>
On Fri, Nov 11, 2011 at 11:27, Jakub Narebski <jnareb@gmail.com> wrote:
Show 8 quoted lines
>> I originally tried to detect if the system supported `echo -n' but
>> I found this to be a waste of time. My benchmarks on Linux, Solaris
>> and FreeBSD reveal that printf(1) is fast enough, especially since
>> we aren't calling gettext() from within any tight loops, and
>> unlikely to ever do so.
>
> Didn't we decide that the only sane way to handle eval_gettext
> is to provide minimal implemetation in the form of external command?

This comment is a bit out of date and probably shouldn't be in the commit message. But it doesn't have to do with eval_gettext. I mean at one point I tried to change the fall-through wrapper from:

    gettext () {
	    printf "%s" "$1"
	}
to:
    gettext () {
	    echo -n $1
	}

But found it to bee too troublesome with various echo implementations and just not worth it for the complexity.

But yeah, for eval_gettext() we need an external program, which we already have in git.git as git-sh-i18n--envsubst.

Previous: Jakub NarebskiNext: Junio C Hamano
Message 4 of 6 in “i18n back from the dead”
  1. i18n back from the deadÆvar Arnfjörð Bjarmason, Nov 11, 2011
  2. i18n: add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Nov 11, 2011
  3. Jakub NarebskiNov 11, 2011
  4. Ævar Arnfjörð BjarmasonNov 11, 2011
  5. Junio C HamanoNov 17, 2011
  6. Ævar Arnfjörð BjarmasonNov 18, 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.