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

Re: ab/i18n (What's cooking in git.git (Feb 2011, #05; Wed, 23))

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 24, 2011, 02:55 UTC
Message-ID
<AANLkTinY4pt5DLokKkuCNnC1yi7nQBHcZv722x9CKvCh@mail.gmail.com>
In-Reply-To
<7vd3mi44gx.fsf@alter.siamese.dyndns.org>
On Thu, Feb 24, 2011 at 02:16, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> 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.

Show 6 quoted lines
>> 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.

Previous: Junio C HamanoNext: Jonathan Nieder
Message 4 of 46 in “What's cooking in git.git (Feb 2011, #05; Wed, 23)”
  1. Junio C HamanoFeb 23, 2011
  2. ab/i18n (What's cooking in git.git (Feb 2011, #05; Wed, 23))Jonathan Nieder, Feb 23, 2011
  3. Junio C HamanoFeb 24, 2011
  4. Ævar Arnfjörð BjarmasonFeb 24, 2011
  5. Jonathan NiederFeb 24, 2011
  6. Ævar Arnfjörð BjarmasonFeb 24, 2011
  7. Jonathan NiederFeb 24, 2011
  8. Jonathan NiederFeb 24, 2011
  9. Ævar Arnfjörð BjarmasonFeb 25, 2011
  10. Jonathan NiederFeb 26, 2011
  11. Jonathan NiederFeb 24, 2011
  12. Erik Faye-LundFeb 24, 2011
  13. Jonathan NiederFeb 24, 2011
  14. Junio C HamanoFeb 24, 2011
  15. Ævar Arnfjörð BjarmasonFeb 24, 2011
  16. Johan HerlandFeb 23, 2011
  17. Junio C HamanoFeb 24, 2011
  18. Johan HerlandFeb 24, 2011
  19. Ævar Arnfjörð BjarmasonFeb 24, 2011
  20. Junio C HamanoFeb 24, 2011
  21. Ævar Arnfjörð BjarmasonFeb 24, 2011
  22. Junio C HamanoFeb 24, 2011
  23. Ævar Arnfjörð BjarmasonFeb 24, 2011
  24. Erik Faye-LundFeb 24, 2011
  25. Ævar Arnfjörð BjarmasonFeb 24, 2011
  26. Jonathan NiederFeb 24, 2011
  27. Johannes SchindelinFeb 25, 2011
  28. Kirill SmelkovFeb 25, 2011
  29. Johannes SchindelinFeb 25, 2011
  30. Kirill SmelkovFeb 25, 2011
  31. Johannes SchindelinFeb 25, 2011
  32. Kirill SmelkovFeb 26, 2011
  33. Kirill SmelkovFeb 26, 2011
  34. cross-compiling msys-1.0.dll, was Re: What's cooking in git.git (Feb 2011, #05; Wed, 23)Johannes Schindelin, Feb 26, 2011
  35. Kirill SmelkovMar 12, 2011
  36. Johannes SchindelinMar 12, 2011
  37. Johannes SchindelinFeb 27, 2011
  38. Kirill SmelkovMar 12, 2011
  39. Adding Beyond Compare as a merge tool, was: Re: What's cooking in git.git (Feb 2011, #05; Wed, 23)Sebastian Schuberth, Feb 26, 2011
  40. Junio C HamanoFeb 26, 2011
  41. Sebastian SchuberthFeb 26, 2011
  42. Chris PackhamFeb 27, 2011
  43. Junio C HamanoFeb 27, 2011
  44. Sebastian SchuberthFeb 27, 2011
  45. Sebastian SchuberthFeb 27, 2011
  46. Sebastian SchuberthFeb 27, 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.