From: Ævar Arnfjörð Bjarmason Date: Thu, 24 Feb 2011 02:55:04 GMT Subject: Re: ab/i18n (What's cooking in git.git (Feb 2011, #05; Wed, 23)) Message-ID: In-Reply-To: <7vd3mi44gx.fsf@alter.siamese.dyndns.org> On Thu, Feb 24, 2011 at 02:16, Junio C Hamano wrote: > Jonathan Nieder writes: > >> The commit message for the second one seems to have been mangled: >> >>       i18n: add GETTEXT_POISON to simulate translated messages unfriendly translator > > Yeah, I think I was fooled by the header folding while fixing things up > inside the mailbox. > >> I still don't like the #-sign business in this commit.  Couldn't it >> be split into a separate patch, not to be applied until just before >> the strings in commit/tag/wt-status are marked for translation? > > That might be a sensible thing to do.   Ævar what do you think? It could, but I don't want to spend time on it. I think it's fine that the choice of string is documented in the commit that introduces it. >> There is also a patch out there to make this use rot13, which I am >> somewhat fond of.  Unfortunately, it leaks (because it is not clear >> how long translated strings are supposed to last). > > Yeah I would imagine it would leak.  Also blindly running rot13 to turn %d > into %q is probably not what you want. Gettext gives you a pointer to the string inside a mmaped .mo file, effectively, so the caller doesn't have to care about it. So you can't write something that doesn't leak memory unless you preserve that characteristic. But it's a debugging mode, it doesn't matter IMO if it leaks memory. Anyway, to be blunt I really don't see the point of fiddling around with this bit so much. Whether it's a `"GETTEXT POISON"` constant or `rot13(msgid)` the same tests will fail. So it's not functionally changing what the feature was for in the first place, just adding more complexity. Of course there might be cases where a test will fail because it's supposed to end in \n but the poison string doesn't, but since none of them did I didn't worry about that. And even if one did I'd probably just mark it as C_LOCALE_ONLY anyway. Since the intent is to make the person doing the i18n work not break plumbing, not to perfectly annotate our test suite. I'd much rather have a few more tests skipped under this poison mode than 20 extra lines of C code that effectively give us nothing to maintain. If someone else wants to do the work I don't care. I just think there's more important things to worry about.