public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Re: How to get argp to print standard fields in the target language?
       [not found] ` <1710975.uacIGzncQW@nimes>
@ 2023-05-21  4:25   ` Anadon
  2023-05-21 13:01     ` Bruno Haible
  0 siblings, 1 reply; 2+ messages in thread
From: Anadon @ 2023-05-21  4:25 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gettext, libc-help

Since all usage of argp has the same translation strings, they could
be a part of files distributed as a package with the OS.  This would
be easy for developers and space efficient.  From my current
understanding, this does not work with gettext as implemented because
simultaneous domains as described in
https://www.gnu.org/software/gettext/manual/gettext.html#Triggering do
not seem to be supported.  Should this be supported?  I'm looking at
this and I can brute force it as described and leave the same
ungoogleable problem for others.  What I imagine as the end result is
to "just" have argp have its strings translated as a part of the OS
distribution, so they'll translate on their own.

On Mon, May 15, 2023 at 1:37 PM Bruno Haible <bruno@clisp.org> wrote:
>
> Anadon wrote:
> > the specific
> > untranslated parts I'm seeing are the '-?', '--usage', '-V' and footer
> > associated with argp.  How do I get argp strings translated?
> >
> > My literal text:
> > ```
> > anadon@philosoraptor:~/Documents/code/primes$ LC_ALL=uk_UA.utf8
> > LANGUAGE=uk_UA.utf8 ./build/src/primes --help
>
> Some of these strings (such as "Mandatory or optional arguments ..." or
> "Report bugs to ...") come from argp-help.c and are arguments of a 'dgettext'
> invocations. For these, you would include argp-help.c in the set of files
> you specify to xgettext. Optionally, specify argp_domain
> (cf. https://www.gnu.org/software/libc/manual/html_node/Argp-Parsers.html)
> and use a separate .pot file for this (small) set of messages.
>
> Some of the strings (such as "Give this help list") don't come from the
> argp implementation; they must come from your code. To internationalize
> them, use a gettext_noop-like macro as described in
> https://www.gnu.org/software/gettext/manual/html_node/Special-cases.html
>
> Bruno
>
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to get argp to print standard fields in the target language?
  2023-05-21  4:25   ` How to get argp to print standard fields in the target language? Anadon
@ 2023-05-21 13:01     ` Bruno Haible
  0 siblings, 0 replies; 2+ messages in thread
From: Bruno Haible @ 2023-05-21 13:01 UTC (permalink / raw)
  To: Anadon; +Cc: bug-gettext, libc-help

Anadon wrote:
> Since all usage of argp has the same translation strings, they could
> be a part of files distributed as a package with the OS.

No, it would not help if, say, glibc would include these strings in the
libc.pot file. That's because there are other platforms (*BSD, mingw, etc.)
that don't have this .pot file and its translations.

Therefore these strings from argp-help.c need to be either in your
package's .pot file, or in a gnulib.pot file. There was an experimental
gnulib.pot file many years ago, but it was too cumbersome to keep up-to-date.
Therefore the only good option is to have these strings in your
package's .pot file.

> From my current
> understanding, this does not work with gettext as implemented because
> simultaneous domains as described in
> https://www.gnu.org/software/gettext/manual/gettext.html#Triggering do
> not seem to be supported.

Simultaneous gettext domains are supported. GNU clisp uses this feature,
as it has 2 gettext domains.

Bruno




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-21 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAFkJGRetOSo6VqLRoMOUKKASk5WxQwQeTqtNp16R5sBrmqCYFA@mail.gmail.com>
     [not found] ` <1710975.uacIGzncQW@nimes>
2023-05-21  4:25   ` How to get argp to print standard fields in the target language? Anadon
2023-05-21 13:01     ` Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).