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

Re: [PATCH 2/2] i18n: Add extra -- to seperate gettext and message

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 4, 2012, 16:59 UTC
Message-ID
<7vpq9ft3ls.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CANYiYbFx=Z7TTYUbAhzgHFYB6O_grROWoWHbtuhuABeXdFk4-Q@mail.gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 24 quoted lines
> 2012/6/4 Ævar Arnfjörð Bjarmason <avarab@gmail.com>:
>> I think a better solution to this is to just apply this patch:
>>
>> -               die "$(gettext -- "--cached cannot be used with --files")"
>> +               die "$(gettext "the --cached option is incompatible
>> with the --files option")"
>
> The rewrite message is a bit odd for there are 40 more alike
> messages (extracted from C files) start with "--”, such as:
>
>     msgid "--delete only accepts plain target ref names"
>     msgid "--all and --tags are incompatible"
>     msgid "--all can't be combined with refspecs"
>     msgid "--mirror and --tags are incompatible"
>     msgid "--mirror can't be combined with refspecs"
>
>> I think changing the only message suffering from this
>> issue (or likely to suffer from it) beats a solution where starting a
>> message with -- only works for some of the xgettext
>> commands/functions.
>
> If I had not changed like this, I would not find out there are 27
> marked messages (by gettext wrappers) have not been
> extracted to "po/git.pot". ;-)

I think there is value for having a generic solution than declaring "No message shall begin with a dash".

I am not convinced that it is ideal for the implementation of gettext_ln to prepend "--" in front when it calls gettext, though. Shouldn't the caller of gettext_ln be the one who is responsible for doing that? After all, that is the one that knows that the MSGID argument needs the quoting.

Previous: Jiang XinNext: Jiang Xin
Message 5 of 8 in “i18n: Extract msgs marked by sh gettext wrappers”
  1. 1/2 i18n: Extract msgs marked by sh gettext wrappersJiang Xin, Jun 3, 2012
  2. 2/2 i18n: Add extra -- to seperate gettext and messageJiang Xin, Jun 3, 2012
  3. Ævar Arnfjörð BjarmasonJun 4, 2012
  4. Jiang XinJun 4, 2012
  5. Junio C HamanoJun 4, 2012
  6. Jiang XinJun 15, 2012
  7. Jonathan NiederJun 15, 2012
  8. Junio C HamanoJun 15, 2012

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.