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

[PATCH/RFC v2 0/6] Add internationalization support to Git

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 30, 2010, 20:54 UTC
Message-ID
<1275252857-21593-1-git-send-email-avarab@gmail.com>
In-Reply-To
<1275173125-21010-1-git-send-email-avarab@gmail.com>

Here's version 2 of the patch series begun by Jeff Epler to make Git optionally translatable with GNU gettext.

Due to an error of mine only the cover letter of the previous series had "PATCH/RFC" in the subject line. That's rectified in this series.

Aside from making sure the test suite always runs under LC_ALL=C, sanity tests for the translations, "how to translate" documentation, and the Perl Makefile issue noted below, this series is pretty much ready for inclusion in my opinion. Perl support was the last missing piece for translating all of the core C+Shell+Perl code.

New stuff:
  * Perl scripts are now translatable through the Gettext
    facility. Like the shellscript facility I added this has a
    graceful fallback if the prerequisite libraries aren't installed.
    I'm using the libintl-perl library which provides
    Locale::Messages. I could also have used liblocale-gettext-perl
    which provides Locale::gettext. Debian seems to prefer the latter,
    but the former is recomended by GNU. The new Git::Gettext library
    could probably be modified to try both.
    It works 100% for me. Aside from this bit:
    
    	# TODO: How do I make the sed replacements in the top level
    	# Makefile reach me here?
    	#our $TEXTDOMAINDIR = q|@@LOCALEDIR@@|;
    	our $TEXTDOMAINDIR = q</usr/local/share/locale>;
    I couldn't figure out how to make the sed substitution the core
    /Makefile does for e.g. @@GIT_VERSION@@ work for the hybrid
    Makefile / perl.mak setup in perl/.
    Suggestions from contributors more familiar with Git's build
    system welcome.
  * Another thing to note regarding Perl. We have some Perl code
    that's obviously intended to work with perls as old as 5.6. It
    would be preferable to translation support if the minimum were
    bumped to 5.8. Here's why:
        $ perl -e 'printf "%2\$s the %1\$s has\n", ("Clone War", "Begun")'
        Begun the Clone War has
    Perl 5.6's printf doesn't support that printf syntax, which means
    that translators would have to make do with the word order of the
    English messages.
    I haven't seen any documentation about Perl coding guidelines or
    Perl versions that we aim to support in Documentation/, so I don't
    know if 5.6 is supposed to be supported or whether the support is
    just incidental.
    Note that this 5.8 could only be a requirement if the user was
    using a translation with positional printf formats. Users
    interested in running the English-only version could still do so
    on 5.6.
  * Updated is.po. It now contains example translations for C, Shell
    and Perl programs as a proof of concept.
  * Rewrote the commit message of the shell script support commit to
    use use the gettext: prefix.
    
Jeff Epler (1):
  Add infrastructure for translating Git with gettext
Ævar Arnfjörð Bjarmason (5):
  gitignore: Ignore files generated by gettext
  Makefile: Remove Gettext files on make clean
  gettext: Add a Gettext interface for shell scripts
  gettext: Add a Gettext interface for Perl
  gettext: Add a skeleton po/is.po
 .gitignore          |    1 +
 Makefile            |   37 +++++++-
 gettext.c           |   17 +++
 gettext.h           |   15 +++
 git-pull.sh         |   15 ++--
 git-send-email.perl |    3 +-
 git-sh-setup.sh     |   33 ++++++
 git.c               |    3 +
 perl/Git/Gettext.pm |   83 +++++++++++++++
 perl/Makefile.PL    |    5 +-
 po/.gitignore       |    1 +
 po/is.po            |  282 +++++++++++++++++++++++++++++++++++++++++++++++++++
 wt-status.c         |  129 ++++++++++++------------
 13 files changed, 550 insertions(+), 74 deletions(-)
 create mode 100644 gettext.c
 create mode 100644 gettext.h
 create mode 100644 perl/Git/Gettext.pm
 create mode 100644 po/.gitignore
 create mode 100644 po/is.po
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 11 of 56 in “Add internationalization support to Git”
  1. 0/5 Add internationalization support to GitÆvar Arnfjörð Bjarmason, May 29, 2010
  2. 1/5 Add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, May 29, 2010
  3. 2/5 gitignore: Ignore files generated by gettextÆvar Arnfjörð Bjarmason, May 29, 2010
  4. 3/5 Makefile: Remove Gettext files on make cleanÆvar Arnfjörð Bjarmason, May 29, 2010
  5. 4/5 gettext: Add a skeleton po/is.poÆvar Arnfjörð Bjarmason, May 29, 2010
  6. 5/5 Add infrastructure to make shellscripts translatableÆvar Arnfjörð Bjarmason, May 29, 2010
  7. Jonathan NiederMay 30, 2010
  8. Ævar Arnfjörð BjarmasonMay 30, 2010
  9. Jonathan NiederMay 30, 2010
  10. Ævar Arnfjörð BjarmasonMay 31, 2010
  11. 0/6 Add internationalization support to GitÆvar Arnfjörð Bjarmason, May 30, 2010
  12. 1/6 Add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, May 30, 2010
  13. Jakub NarebskiJun 1, 2010
  14. autoconf: Check if <libintl.h> exists and set NO_GETTEXTÆvar Arnfjörð Bjarmason, Jun 1, 2010
  15. Jakub NarebskiJun 1, 2010
  16. 2/6 gitignore: Ignore files generated by gettextÆvar Arnfjörð Bjarmason, May 30, 2010
  17. 3/6 Makefile: Remove Gettext files on make cleanÆvar Arnfjörð Bjarmason, May 30, 2010
  18. 4/6 gettext: Add a Gettext interface for shell scriptsÆvar Arnfjörð Bjarmason, May 30, 2010
  19. 5/6 gettext: Add a Gettext interface for PerlÆvar Arnfjörð Bjarmason, May 30, 2010
  20. Jakub NarebskiJun 1, 2010
  21. Ævar Arnfjörð BjarmasonJun 1, 2010
  22. Jakub NarebskiJun 2, 2010
  23. 6/6 gettext: Add a skeleton po/is.poÆvar Arnfjörð Bjarmason, May 30, 2010
  24. Jonathan NiederMay 30, 2010
  25. Jonathan NiederMay 30, 2010
  26. Ævar Arnfjörð BjarmasonMay 31, 2010
  27. 0/7 Add internationalization support to GitÆvar Arnfjörð Bjarmason, Jun 1, 2010
  28. Ævar Arnfjörð BjarmasonJun 2, 2010
  29. 0/7 Add internationalization support to GitÆvar Arnfjörð Bjarmason, Jun 2, 2010
  30. 1/7 Add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Jun 2, 2010
  31. Peter KreftingJun 2, 2010
  32. Ævar Arnfjörð BjarmasonJun 2, 2010
  33. Peter KreftingJun 2, 2010
  34. Ævar Arnfjörð BjarmasonJun 2, 2010
  35. Peter KreftingJun 2, 2010
  36. 2/7 gettext: Add a Gettext interface for shell scriptsÆvar Arnfjörð Bjarmason, Jun 2, 2010
  37. 3/7 gettext: Add a Gettext interface for PerlÆvar Arnfjörð Bjarmason, Jun 2, 2010
  38. 4/7 Makefile: Don't install Gettext .mo files if NO_GETTEXTÆvar Arnfjörð Bjarmason, Jun 2, 2010
  39. 5/7 Makefile: Override --keyword= for all languagesÆvar Arnfjörð Bjarmason, Jun 2, 2010
  40. 6/7 gettext: Sanity tests for Git's Gettext supportÆvar Arnfjörð Bjarmason, Jun 2, 2010
  41. 7/7 gettext: Add a skeleton po/is.poÆvar Arnfjörð Bjarmason, Jun 2, 2010
  42. Johannes SixtJun 2, 2010
  43. 0/2 Add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Jun 2, 2010
  44. 1/2 Add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Jun 2, 2010
  45. 2/2 Add initial C, Shell and Perl gettext translationsÆvar Arnfjörð Bjarmason, Jun 2, 2010
  46. 1/7 Add infrastructure for translating Git with gettextÆvar Arnfjörð Bjarmason, Jun 1, 2010
  47. 2/7 gettext: Add a Gettext interface for shell scriptsÆvar Arnfjörð Bjarmason, Jun 1, 2010
  48. Johannes SixtJun 2, 2010
  49. Ævar Arnfjörð BjarmasonJun 2, 2010
  50. Johannes SixtJun 2, 2010
  51. 3/7 gettext: Add a Gettext interface for PerlÆvar Arnfjörð Bjarmason, Jun 1, 2010
  52. 4/7 Makefile: Don't install Gettext .mo files if NO_GETTEXTÆvar Arnfjörð Bjarmason, Jun 1, 2010
  53. 5/7 Makefile: Override --keyword= for all languagesÆvar Arnfjörð Bjarmason, Jun 1, 2010
  54. 6/7 gettext: Basic sanity tests for Git's Gettext supportÆvar Arnfjörð Bjarmason, Jun 1, 2010
  55. Johannes SixtJun 2, 2010
  56. 7/7 gettext: Add a skeleton po/is.poÆvar Arnfjörð Bjarmason, Jun 1, 2010

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.