xref: /netbsd-src/external/gpl3/gdb.old/dist/libctf/ctf-intl.h (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
17d62b00eSchristos /* ctf-intl.h - libctf specific header for gettext code.
2*6881a400Schristos    Copyright (C) 1998-2022 Free Software Foundation, Inc.
37d62b00eSchristos 
47d62b00eSchristos    Written by Tom Tromey <tromey@cygnus.com>
57d62b00eSchristos 
67d62b00eSchristos    This file is part of libctf.
77d62b00eSchristos 
87d62b00eSchristos    This library is free software; you can redistribute it and/or modify
97d62b00eSchristos    it under the terms of the GNU General Public License as published by
107d62b00eSchristos    the Free Software Foundation; either version 3, or (at your option)
117d62b00eSchristos    any later version.
127d62b00eSchristos 
137d62b00eSchristos    It is distributed in the hope that it will be useful, but WITHOUT
147d62b00eSchristos    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
157d62b00eSchristos    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
167d62b00eSchristos    License for more details.
177d62b00eSchristos 
187d62b00eSchristos    You should have received a copy of the GNU General Public License
197d62b00eSchristos    along with this file; see the file COPYING.  If not, write to the
207d62b00eSchristos    Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
217d62b00eSchristos    MA 02110-1301, USA.  */
227d62b00eSchristos 
237d62b00eSchristos #ifndef _CTF_INTL_H
247d62b00eSchristos #define _CTF_INTL_H
257d62b00eSchristos 
267d62b00eSchristos #ifdef ENABLE_NLS
277d62b00eSchristos # include <libintl.h>
287d62b00eSchristos /* Note the redefinition of gettext and ngettext here to use PACKAGE.
297d62b00eSchristos 
307d62b00eSchristos    This is because the code in this directory is used to build a
317d62b00eSchristos    library which will be linked with code in other directories to form
327d62b00eSchristos    programs.  We want to maintain a separate translation file for this
337d62b00eSchristos    directory however, rather than being forced to merge it with that
347d62b00eSchristos    of any program linked to libopcodes.  This is a library, so it
357d62b00eSchristos    cannot depend on the catalog currently loaded.
367d62b00eSchristos 
377d62b00eSchristos    In order to do this, we have to make sure that when we extract
387d62b00eSchristos    messages we use the LIBCTF domain rather than the domain of the
397d62b00eSchristos    program that included the opcodes library, (eg OBJDUMP).  Hence we
407d62b00eSchristos    use dgettext (PACKAGE, String) and define PACKAGE to be 'libctf'.
417d62b00eSchristos    (See the code in configure).  */
427d62b00eSchristos # undef gettext
437d62b00eSchristos # define gettext(Msgid) dgettext (PACKAGE, Msgid)
447d62b00eSchristos # undef ngettext
457d62b00eSchristos # define ngettext(Msgid1, Msgid2, n) dngettext (PACKAGE, Msgid1, Msgid2, n)
467d62b00eSchristos # define _(String) gettext (String)
477d62b00eSchristos # ifdef gettext_noop
487d62b00eSchristos #  define N_(String) gettext_noop (String)
497d62b00eSchristos # else
507d62b00eSchristos #  define N_(String) String
517d62b00eSchristos # endif
527d62b00eSchristos #else
537d62b00eSchristos # define gettext(Msgid) (Msgid)
547d62b00eSchristos # define dgettext(Domainname, Msgid) (Msgid)
557d62b00eSchristos # define dcgettext(Domainname, Msgid, Category) (Msgid)
567d62b00eSchristos # define ngettext(Msgid1, Msgid2, n) \
577d62b00eSchristos   (n == 1 ? Msgid1 : Msgid2)
587d62b00eSchristos # define dngettext(Domainname, Msgid1, Msgid2, n) \
597d62b00eSchristos   (n == 1 ? Msgid1 : Msgid2)
607d62b00eSchristos # define dcngettext(Domainname, Msgid1, Msgid2, n, Category) \
617d62b00eSchristos   (n == 1 ? Msgid1 : Msgid2)
627d62b00eSchristos # define textdomain(Domainname) do {} while (0)
637d62b00eSchristos # define bindtextdomain(Domainname, Dirname) do {} while (0)
647d62b00eSchristos # define _(String) (String)
657d62b00eSchristos # define N_(String) String
667d62b00eSchristos #endif
677d62b00eSchristos 
687d62b00eSchristos #endif /* _CTF_INTL_H */
69