Re: [PATCH/RFC 00/17] Begin gettextizing Git
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Aug 31, 2010, 19:35 UTC
- Message-ID
- <AANLkTinVFvv2J4z36zc9LAs+_-Pp2_+bYeLVxVeavWtJ@mail.gmail.com>
- In-Reply-To
- <20100831192247.GU2315@burratino>
On Tue, Aug 31, 2010 at 19:22, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 42 quoted lines
> Ævar Arnfjörð Bjarmason wrote:
>
>> Maybe, but it'll always be --output=po/git.pot so I saw no reason to
>> seperate it. Should it be?
>
> No big deal. I am vaguely worried about interrupted "make"
> invocations. Don't gettextized packages typically do something like this?
>
> remove_creation_date() {
> sed '#!/bin/sed -f
> /^"POT-Creation-Date: .*"$/!b
> x
> # Test if the hold space is empty.
> s/P/P/
> ta
> # Yes it was empty. First occurrence. Remove the line.
> g
> d
> bb
> :a
> # The hold space was nonempty. Following occurrences. Do nothing.
> x
> :b'
> }
> (cd po && xgettext --default-domain=git ...)
> set -e; \
> if test -f po/git.pot &&
> remove_creation_date <po/git.pot >po/git.1po+ &&
> remove_creation_date <po/git.po >po/git.2po+ &&
> cmp po/git.1po+ po/git.2po+; \
> then \
> rm -f po/git.1po+ po/git.2po+ po/git.po; \
> else \
> rm -f po/git.1po+ po/git.2po+ po/git.pot; \
> mv po/git.po po/git.pot; \
> fi
>
>> The -o for the C compiler changes, but the
>> "make pot" target will always write to po/git.pot.
>
> In particular, to avoid using a partial .pot file, one might want to write to
> po/git.pot+, po/git.po, or similar and then rename it.I don't know what they usually do. But that looks like a lot of work to work around a very rare potential edge case. "make pot" is only ever run manually by a translator right before msgmerge.
In the very rare case where make is interrupted and git.pot is left in a partial state you'll notice because your msgmerge fails.
>> Or: git://github.com/avar/git.git gettextize-git-mainporcelain-v3 > > Looks good.
Thanks for checking it out.