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
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 4, 2012, 08:56 UTC
Message-ID
<CACBZZX5EGvJm0aqG5iVn7wnoqFATUqP4gbS-2tnAiLqeFQZifg@mail.gmail.com>
In-Reply-To
<1338764967-30103-2-git-send-email-worldhello.net@gmail.com>
On Mon, Jun 4, 2012 at 1:09 AM, Jiang Xin <worldhello.net@gmail.com> wrote:
Show 18 quoted lines
> In commit b9b9c22, Ævar addressed a issue when gettextized a message
> started with "--", such as "--cached cannot be used with --files", the
> first word in the message would be treated as an option of gettext, and
> might raise a bad option error.
>
> The solution Ævar provided is to add a extra "--" option between gettext
> and the message. But Vincent fount out later that the extra "--" was
> extracted as gettext message by xgettext instead of the real message.
> See:
>
>  * http://thread.gmane.org/gmane.comp.version-control.git/199042
>
> In order to fix this dilemma, we move the extra "--" option from gettext
> to gettext wrapper (gettextln, and eval_gettext), and gettextize the
> message using the wrapper function instead of gettext itself.
>
> But for system with libintl's gettext.sh, eval_gettext and
> eval_gettextln won't have this fix.
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")"

It's one message only, and this is due to a bug in the xgettext extraction. 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.

Previous: Jiang XinNext: Jiang Xin
Message 3 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.