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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 15, 2011, 08:04 UTC
Message-ID
<7vlirhx14x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1321191835-24062-1-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
> Change the skeleton implementation of i18n in Git to one that can show
> localized strings to users for our C, Shell and Perl programs using
> either GNU libint or the Solaris gettext implementation.
Happy ;-).
Isn't it libintl, though?
> This new internationalization support is enabled by default. If
> gettext isn't available, or if Git is compiled with
> NO_GETTEXT=YesPlease, Git fall back on its current behavior of showing
s/fall/falls/;
> This change is somewhat large because as well as adding a C, Shell and
> Perl i18n interface we're adding a lot of tests for them, and for
> those tests to work we need a skeleton PO file to actually test
> translations.
You _could_ split it up this way, I think, if you really wanted to:
 * The mechanism, i.e. integration with libintl and gettext, without any
   translated strings but with the .pot file, with tests to make sure in a
   locale that is missing *.mo files for it, we get the default output;
 * Sample translation for is_IS locale, with tests to make sure that we
   get translated output in a locale that has *.mo files for it.
But I am not sure if that is better.
Show 9 quoted lines
> diff --git a/.gitignore b/.gitignore
> index 8572c8c..c47f3a8 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -224,3 +224,4 @@
>  *.pdb
>  /Debug/
>  /Release/
> +/share/

I somehow find it distasteful that this is overly wide; same with the change in Makefile to "rm -rf share/". I suspect it wouldn't be the case if it were limited to share/locale/ or something.

But perhaps we would never ship anything in share/ and things in there will always come from elsewhere.

Show 10 quoted lines
> diff --git a/Makefile b/Makefile
> index ee34eab..896f5fd 100644
> --- a/Makefile
> +++ b/Makefile
> ...
> @@ -2435,6 +2507,7 @@ clean:
>  	$(RM) $(TEST_PROGRAMS)
>  	$(RM) -r bin-wrappers
>  	$(RM) -r $(dep_dirs)
> +	$(RM) -r po/git.pot share/

It seems "distclean" tells us to clean po/git.pot, which hints at me that normal "clean" shouldn't?

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 7 in “i18n: add infrastructure for translating Git with gettext”
  1. i18n: add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Nov 13, 2011
  2. Junio C HamanoNov 15, 2011
  3. Ævar Arnfjörð BjarmasonNov 16, 2011
  4. Jonathan NiederNov 16, 2011
  5. Ævar Arnfjörð BjarmasonNov 17, 2011
  6. Jonathan NiederNov 17, 2011
  7. i18n: add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Nov 17, 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.