Re: [PATCH] PRItime: wrap PRItime for better l10n compatibility
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 19, 2017, 23:03 UTC
- Message-ID
- <xmqq8tjkm3ly.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <alpine.DEB.2.21.1.1707191456010.4193@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 10 quoted lines
> But there may be hope. Since the character sequence "PRItime" is highly > unlikely to occur in Git's source code in any context other than the > format to print/parse timestamp_t, it should be possible to automate a the > string replacement > > git ls-files -z \*.[ch] | > xargs -0r sed -i 's/PRItime/PRIuMAX/g' > > (assuming, of course, that you use GNU sed, not BSD sed, for which the > `-i` needs to read `-i ''` instead) as part of the update?
I somehow missed this bit.
Given that this needs to be done only once every release by only one person (i.e. the l10n coordinator who updates *.pot file), as long as the procedure is automated as much as possible to ease the pain for the l10n coordinator and clearly described in the "Maintaining the po/git.pot file" section of po/README, something along that line does sound like a very tempting approach. If it works well, it is certainly much easier for normal developers than the other possible alternatives I mentioned in my previous response.
It is brittle as you already said, but perhaps a bit of anchoring like \<PRItime\>, the brittle-ness may not hurt in practice.
I didn't look at "git grep PRItime" output for hits, though.