[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: if writing "gettext -s 'message'", msginit does not include the mess
From: |
Bruno Haible |
Subject: |
Re: if writing "gettext -s 'message'", msginit does not include the message in the POT file |
Date: |
Wed, 01 Feb 2023 00:37:35 +0100 |
Hi,
Didier Spaier wrote:
> Using gettext-0.21, language: shell
>
> this line:
> gettext "this is a line"
> gives in the pot file:
> msgid "write:"
>
> But this line:
> gettext "this is a line"
> only gives a line like
> #: <source filename>:<line number>
> instead
>
> What do I miss?
Thanks for the report. This is a documented limitation:
https://www.gnu.org/software/gettext/manual/html_node/gettext-Invocation.html
says
"Note: xgettext supports only the one-argument form of the gettext invocation,
where no options are present and the textdomain is implicit, from the
environment."
> I ask as I'd rather avoid, to append a <newline> to the message, to write
> instead :
> gettext "this is a line"; echo
Adding a final newline to the message is indeed not the best approach,
because it requires translator attention.
But transforming, at the source-code level,
gettext -s msgid
to
{ gettext msgid; echo; }
is something you can do, in any location of any shell script.
That would be my favourite approach.
Bruno