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

[PATCH/RFC v3 0/7] Add internationalization support to Git

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 1, 2010, 23:39 UTC
Message-ID
<1275435597-4017-1-git-send-email-avarab@gmail.com>
In-Reply-To
<1275173125-21010-1-git-send-email-avarab@gmail.com>

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

This version contains a lot of fixes to issues pointe out by Jakub Narebski, and other misc.

Since the last RFC:
  * Squashed some infrastructure patches into the initial commit.
  * Added basic sanity testing for the Gettext support
  * .mo files aren't installed on `make install` time if NO_GETTEXT
    was specified during the build.
    In C gettext support isn't compiled in. But this happens
    implicitly in Shell/Perl because the locale files won't be there
    on the system.
  * NO_GETTEXT is now set correctly depending on whether libintl.h
    exists when autoconf is used to build Git. Whether this is the
    best approach to gettext detection with autoconf is being
    discussed in the "[PATCH/RCF] autoconf: Check if <libintl.h>
    exists and set NO_GETTEX" thread.
  * The localedir is now passed to the Perl code via Makefile
    trickery. It's no longer hardcoded to /usr/local/share/locale
  * Add `--keyword=` to all xgettext invocations. This way we make
    sure that only our gettext functions are extracted, not the
    defaults xgettext.
  * Git::Gettext is now called Git::I18N
  * Remove LICENSE from I18N.pm. It was a boilerplate that shouldn't
    have been there.
  * Use qw() not qw< > in Perl code.
  * Changed the interface to Git::I18N. Now it exports all its
    functions by default. If something's using the module it's going
    to want to import everything anyway. This makes the issue of '@{
    $EXPORT_TAGS{'all'} }' being ugly syntax moot since it isn't used
    anymore.
    Users can still import selectively by specifying arguments to
    import().
  * The GIT_TEXTDOMAINDIR environment variable can be set to override
    where the C/Perl/Shell locale files are found. This is intended to
    be set by the test suite.
  * The boolean test for whether gettext.sh was successfully loaded
    was inverted (oops!)
Things that haven't changed:
  Jakub pointed out some things that I might want to change that I
  didn't yet. Mostly because I didn't have time yet.
  * Git::I18N still uses Locale::Messages, not Locale::TextDomain.
    I'm still not convinced that the low-level Locale::Messages
    interface isn't a better fit for us. But I didn't get
    Locale::TextDomain working at all today so I'm still using
    Locale::Messages.
  * Perl still uses gettext($), not __($) (see above).
  * use Exporter 'import': Subclassing Exporter instead since we
    apparently need Perl 5.6 compatibility.
Jeff Epler (1):
  Add infrastructure for translating Git with gettext
Ævar Arnfjörð Bjarmason (6):
  gettext: Add a Gettext interface for shell scripts
  gettext: Add a Gettext interface for Perl
  Makefile: Don't install Gettext .mo files if NO_GETTEXT
  Makefile: Override --keyword= for all languages
  gettext: Basic sanity tests for Git's Gettext support
  gettext: Add a skeleton po/is.po
 .gitignore          |    1 +
 Makefile            |   43 ++++++++-
 config.mak.in       |    1 +
 configure.ac        |    6 +
 gettext.c           |   25 +++++
 gettext.h           |   13 +++
 git-pull.sh         |   15 ++--
 git-send-email.perl |    3 +-
 git-sh-setup.sh     |   33 ++++++
 git.c               |    3 +
 perl/Git/I18N.pm    |   73 +++++++++++++
 perl/Makefile       |    3 +-
 perl/Makefile.PL    |   14 +++-
 po/.gitignore       |    1 +
 po/is.po            |  282 +++++++++++++++++++++++++++++++++++++++++++++++++++
 t/t0200-gettext.sh  |   28 +++++
 wt-status.c         |  129 ++++++++++++------------
 17 files changed, 597 insertions(+), 76 deletions(-)
 create mode 100644 gettext.c
 create mode 100644 gettext.h
 create mode 100644 perl/Git/I18N.pm
 create mode 100644 po/.gitignore
 create mode 100644 po/is.po
 create mode 100755 t/t0200-gettext.sh
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 27 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.