Skip to content

Instantly share code, notes, and snippets.

@avar
Created May 29, 2010 22:35
Show Gist options
  • Select an option

  • Save avar/418596 to your computer and use it in GitHub Desktop.

Select an option

Save avar/418596 to your computer and use it in GitHub Desktop.
From f8a37a0ebfa0a21c749fa1ae8e095226945826a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= <avarab@gmail.com>
Date: Thu, 3 Jun 2010 21:05:54 +0000
Subject: [PATCH/RFC v6 0/2] Add infrastructure for translating Git with gettext
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is version 6 of the patch series to make Git optionally
translatable with GNU gettext.
I had some time on the train so I polished it up since v5. Changes
since then:
* Add a blurb to INSTALL about GNU libintl being a default
requirement for building Git.
* There's now a Test::More test for Git::I18N. That module now has
complete test coverage.
* git-sh-i18n.sh now has source code comments how to use it, and
pointer to the GNU gettext manual for more.
* Eliminate the use of a wrapper function in the Perl library in
favor of a symbol table alias.
* I tested the new Perl code I wrote on perl 5.6.2, it works.
* The tests now run successfully when Git isn't built with Perl
support, or when the system doesn't support the locales we're
trying to test.
* Improve the new tests by using variables defined in test-lib.sh to
find out where the git root/po dir is instead of my own
replacements.
* Make the tests easier to read by reducing redundancy and using
e.g. "test_expect_failure grep" instead of calling test_cmp on the
results of two grep invocations.
* Add new xgettext translator comment extraction tests.
* Moved t/t0200-gettext/* tests to t/t0200/*. This follows the
convention of other tests that have their own subdirs in t/.
* Add a small (one-line) copyright notice to git-sh-i18n.sh and
Git::I18N.
Here's the difference between v5 and v6 in git diff --stat -M format:
INSTALL | 8 ++
Makefile | 6 +-
git-sh-i18n.sh | 18 +++-
perl/Git/I18N.pm | 28 ++++--
po/is.po | 2 -
t/t0200-gettext.sh | 52 ++++------
t/{t0200-gettext => t0200}/test.c | 0
t/{t0200-gettext => t0200}/test.perl | 3 +
t/{t0200-gettext => t0200}/test.sh | 0
...ell-fallbacks.sh => t0201-gettext-fallbacks.sh} | 12 ++-
t/t0202-gettext-perl.sh | 20 ++++
t/t0202/test.pl | 104 ++++++++++++++++++++
12 files changed, 203 insertions(+), 50 deletions(-)
Ævar Arnfjörð Bjarmason (2):
Add infrastructure for translating Git with gettext
Add initial C, Shell and Perl gettext translations
.gitignore | 2 +
INSTALL | 8 +++
Makefile | 44 +++++++++++++-
config.mak.in | 1 +
configure.ac | 6 ++
gettext.c | 25 ++++++++
gettext.h | 13 ++++
git-pull.sh | 16 +++--
git-send-email.perl | 3 +-
git-sh-i18n.sh | 47 ++++++++++++++
git.c | 3 +
perl/Git/I18N.pm | 91 ++++++++++++++++++++++++++++
perl/Makefile | 3 +-
perl/Makefile.PL | 14 ++++-
po/.gitignore | 1 +
po/is.po | 69 +++++++++++++++++++++
t/t0200-gettext.sh | 136 ++++++++++++++++++++++++++++++++++++++++++
t/t0200/test.c | 10 +++
t/t0200/test.perl | 14 ++++
t/t0200/test.sh | 14 ++++
t/t0201-gettext-fallbacks.sh | 42 +++++++++++++
t/t0202-gettext-perl.sh | 20 ++++++
t/t0202/test.pl | 104 ++++++++++++++++++++++++++++++++
t/test-lib.sh | 1 +
wt-status.c | 107 +++++++++++++++++----------------
25 files changed, 729 insertions(+), 65 deletions(-)
create mode 100644 gettext.c
create mode 100644 gettext.h
create mode 100644 git-sh-i18n.sh
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
create mode 100644 t/t0200/test.c
create mode 100644 t/t0200/test.perl
create mode 100644 t/t0200/test.sh
create mode 100755 t/t0201-gettext-fallbacks.sh
create mode 100755 t/t0202-gettext-perl.sh
create mode 100644 t/t0202/test.pl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment