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
Jakub Narebski <jnareb@gmail.com>
Date
Nov 11, 2011, 10:27 UTC
Message-ID
<m31utfnedi.fsf@localhost.localdomain>
In-Reply-To
<1320970164-31694-2-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 9 quoted lines
> = Perl
> 
> Perl code that wants to be localized should use the new Git::I18n
> module. It imports a __ function into the caller's package by
> default.
> 
> Instead of using the high level Locale::TextDomain interface I've
> opted to use the low-level (equivalent to the C interface)
> Locale::Messages module, which Locale::TextDomain itself uses.

Nice of you using libintl-perl instead of old Locale::MakeText (with gettext compatibility layer).

> See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com> for
> a further elaboration on this topic.
http://thread.gmane.org/gmane.comp.version-control.git/148446/focus=148478
Show 18 quoted lines
> = Shell
> 
> Shell code that's to be localized should use the git-sh-i18n
> library. It's basically just a wrapper for the system's gettext.sh.
> 
> If gettext.sh isn't available we'll fall back on gettext(1) if it's
> available. The latter is available without the former on Solaris,
> which has its own non-GNU gettext implementation. We also need to
> emulate eval_gettext() there.
>
> If neither are present we'll use a dumb printf(1) fall-through
> wrapper.
> 
> 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?
 
Thanks for working on this.
-- 
Jakub Narębski
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 3 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.