git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jeff Epler <jepler@unpythonic.net>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] WIP: begin to translate git with gettext
Date: Tue, 18 May 2010 10:57:24 +0000	[thread overview]
Message-ID: <AANLkTikK9LAd_pwTwB56Vpq19i00X5apy6qT-ZOpnLEp@mail.gmail.com> (raw)
In-Reply-To: <20100517160208.GA20842@unpythonic.net>

On Mon, May 17, 2010 at 16:02, Jeff Epler <jepler@unpythonic.net> wrote:
> Signed-off-by: Jeff Epler <jepler@unpythonic.net>
> ---
> While I'm certain that there are a lot of things to object to in this
> patch, it shows 90% of what is needed to use gettext to translate
> the portions of git written in c, without involving undesired gnu
> infrastructure such as automake.
>
> Makefile adds necessary rules for generating git.pot and for building
> and installing compiled message catalogs (.mo) from text message
> catalogs (.po).  It also adds a gettext support header and source file.
>
> Minimal changes are made to git to use the requested LC_CTYPE and
> LC_MESSAGES, and some messages for 'git status' are marked for
> translation.
>
> When I provided a gibberish translation of a message:
> #: wt-status.c:87
> msgid "# Changed but not updated:"
> msgstr "# Changes not blah blah blah"
>
> running 'git status' used the translation:
> $ git status
> # On branch master
> # Your branch is ahead of 'origin/master' by 1 commit.
> #
> # Changes not blah blah blah
> ...
>
> I ran with 'make install' and prefix set in config.mak.  It didn't seem
> to work when running from the source directory, and it may or may not
> work with runtime prefix.

Thanks a lot for this patch.

I'm having some trouble getting it to work though. I did:

    make pot

That made the po/git.pot file with all the relevant messages. Then I
made a po/is.po in poedit which has stuff like:

    #: wt-status.c:598
    msgid "On branch "
    msgstr "A greininni "

    #: wt-status.c:605
    msgid "Not currently on any branch."
    msgstr "Ekki á grænni grein.

I did:

    make prefix=/usr all
    sudo make prefix=/usr install

But any invocation of my new git-status (I uninstalled my system git
first) with either LC_ALL, LC_MESSAGES or LC_CTYPE set to is, is_IS or
is_IS.UTF-8 doest't yield the desired results:

    $ strings /usr/share/locale/is/LC_MESSAGES/git.mo |grep grein
    nni grein.
    A greininni

it doesn't seem to spot the file:

    $ strace git status 2>&1|grep locale
    open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
    open("/usr/share/locale/locale.alias", O_RDONLY) = 3
    open("/usr/lib/locale/is/LC_MESSAGES", O_RDONLY) = -1 ENOENT (No
such file or directory)
    open("/usr/share/locale-langpack/is/LC_MESSAGES", O_RDONLY) = 3
    open("/usr/share/locale-langpack/is/LC_MESSAGES/SYS_LC_MESSAGES",
O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/locale/is/LC_CTYPE", O_RDONLY) = -1 ENOENT (No such
file or directory)
    open("/usr/share/locale-langpack/is/LC_CTYPE", O_RDONLY) = -1
ENOENT (No such file or directory)
    open("share/locale/",
O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 5
    open("share/locale/.gitignore", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)
    open("share/locale/is/",
O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 6
    open("share/locale/is/.gitignore", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
    open("share/locale/is/LC_MESSAGES/",
O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 7
    open("share/locale/is/LC_MESSAGES/.gitignore",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

And the UI remains untranslated.

I'm probably doing something very silly. I'd appreciate some help if
you can spot what it is, if I can get this working I can start
submitting some i18n patches.

       reply	other threads:[~2010-05-18 10:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100517160208.GA20842@unpythonic.net>
2010-05-18 10:57 ` Ævar Arnfjörð Bjarmason [this message]
2010-05-18 16:07   ` [PATCH] WIP: begin to translate git with gettext Jeff Epler
2010-05-18 16:47     ` Ævar Arnfjörð Bjarmason
2010-05-17 16:05 Jeff Epler
2010-05-17 23:29 ` Robert Buck
2010-05-18  4:23   ` Ævar Arnfjörð Bjarmason
2010-05-18  7:40 ` Michael J Gruber
2010-05-18  8:11   ` Ævar Arnfjörð Bjarmason
2010-05-18 16:40   ` Jeff Epler
2010-05-18 17:02     ` Ævar Arnfjörð Bjarmason
2010-05-20 16:02       ` Ævar Arnfjörð Bjarmason
2010-05-21 18:02         ` Dévai Tamás

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikK9LAd_pwTwB56Vpq19i00X5apy6qT-ZOpnLEp@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jepler@unpythonic.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).