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.