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

[RFC/PATCH] i18n back from the dead

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 11, 2011, 00:09 UTC
Message-ID
<1320970164-31694-1-git-send-email-avarab@gmail.com>
Or, a patch so huge it needs it own cover letter.

After looking at my dormant i18n series I found that it was spread out over so many pieces that even I didn't understand it anymore.

So here's an attempt to fix that. I've squashed everything we'll need to get i18n working in Git down to one patch. Much of the previous complexity came about because I was adding little things to it incrementally, and I kept carrying around commits that were effectively bugfixes on top of the original code.

Now it's all in one big patch, and while the diffstat looks scary at first a lot of it is tests, documentation and a giant comment.

It's an RFC because there are bound to be bugs in there that I haven't spotted, and po/README is out of date, I haven't updated it for some of the new C and Shell functions we now have.

But it seems to function just fine. I've tested it on two Linux boxes and a Solaris box and it works as intended, but review and testing on other platforms would be most welcome.

This is all we need to start using PO files that are dropped in po/, which I don't think is all that shabby for 1300 lines changed.

Ævar Arnfjörð Bjarmason (1):
  i18n: add infrastructure for translating Git with gettext
 .gitignore                          |    1 +
 Documentation/CodingGuidelines      |    7 +
 INSTALL                             |   12 ++
 Makefile                            |   81 +++++++++++++-
 config.mak.in                       |    3 +
 configure.ac                        |   19 +++
 daemon.c                            |    2 +
 fast-import.c                       |    2 +
 gettext.c                           |  116 +++++++++++++++++++
 gettext.h                           |   25 ++++-
 git-sh-i18n.sh                      |  100 ++++++++++++-----
 git.c                               |    2 +
 http-backend.c                      |    2 +
 http-fetch.c                        |    2 +
 http-push.c                         |    2 +
 imap-send.c                         |    2 +
 perl/Git/I18N.pm                    |   89 +++++++++++++++
 perl/Makefile                       |    3 +-
 perl/Makefile.PL                    |   14 ++-
 po/README                           |  209 +++++++++++++++++++++++++++++++++++
 po/is.po                            |   93 ++++++++++++++++
 shell.c                             |    1 +
 show-index.c                        |    2 +
 t/lib-gettext.sh                    |   55 +++++++++
 t/t0200-gettext-basic.sh            |  108 ++++++++++++++++++
 t/t0200/test.c                      |   23 ++++
 t/t0200/test.perl                   |   14 +++
 t/t0200/test.sh                     |   14 +++
 t/t0201-gettext-fallbacks.sh        |   20 +++-
 t/t0202-gettext-perl.sh             |   27 +++++
 t/t0202/test.pl                     |  110 ++++++++++++++++++
 t/t0203-gettext-setlocale-sanity.sh |   26 +++++
 t/t0204-gettext-reencode-sanity.sh  |   78 +++++++++++++
 t/t0205-gettext-poison.sh           |   36 ++++++
 t/test-lib.sh                       |    3 +
 upload-pack.c                       |    2 +
 wrap-for-bin.sh                     |    3 +-
 37 files changed, 1269 insertions(+), 39 deletions(-)
 create mode 100644 perl/Git/I18N.pm
 create mode 100644 po/README
 create mode 100644 po/is.po
 create mode 100644 t/lib-gettext.sh
 create mode 100755 t/t0200-gettext-basic.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/t0202-gettext-perl.sh
 create mode 100644 t/t0202/test.pl
 create mode 100755 t/t0203-gettext-setlocale-sanity.sh
 create mode 100755 t/t0204-gettext-reencode-sanity.sh
 create mode 100755 t/t0205-gettext-poison.sh
-- 
1.7.6.3
Next: Ævar Arnfjörð Bjarmason
Message 1 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.