xref: /netbsd-src/external/gpl3/gdb/dist/libctf/ctf-intl.h (revision 12989c96ee862c63521a9ead8c44629b7a2ba9b1)
18dffb485Schristos /* ctf-intl.h - libctf specific header for gettext code.
2*12989c96Schristos    Copyright (C) 1998-2024 Free Software Foundation, Inc.
38dffb485Schristos 
48dffb485Schristos    Written by Tom Tromey <tromey@cygnus.com>
58dffb485Schristos 
68dffb485Schristos    This file is part of libctf.
78dffb485Schristos 
88dffb485Schristos    This library is free software; you can redistribute it and/or modify
98dffb485Schristos    it under the terms of the GNU General Public License as published by
108dffb485Schristos    the Free Software Foundation; either version 3, or (at your option)
118dffb485Schristos    any later version.
128dffb485Schristos 
138dffb485Schristos    It is distributed in the hope that it will be useful, but WITHOUT
148dffb485Schristos    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
158dffb485Schristos    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
168dffb485Schristos    License for more details.
178dffb485Schristos 
188dffb485Schristos    You should have received a copy of the GNU General Public License
198dffb485Schristos    along with this file; see the file COPYING.  If not, write to the
208dffb485Schristos    Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
218dffb485Schristos    MA 02110-1301, USA.  */
228dffb485Schristos 
238dffb485Schristos #ifndef _CTF_INTL_H
248dffb485Schristos #define _CTF_INTL_H
258dffb485Schristos 
268dffb485Schristos #ifdef ENABLE_NLS
278dffb485Schristos # include <libintl.h>
288dffb485Schristos /* Note the redefinition of gettext and ngettext here to use PACKAGE.
298dffb485Schristos 
308dffb485Schristos    This is because the code in this directory is used to build a
318dffb485Schristos    library which will be linked with code in other directories to form
328dffb485Schristos    programs.  We want to maintain a separate translation file for this
338dffb485Schristos    directory however, rather than being forced to merge it with that
348dffb485Schristos    of any program linked to libopcodes.  This is a library, so it
358dffb485Schristos    cannot depend on the catalog currently loaded.
368dffb485Schristos 
378dffb485Schristos    In order to do this, we have to make sure that when we extract
388dffb485Schristos    messages we use the LIBCTF domain rather than the domain of the
398dffb485Schristos    program that included the opcodes library, (eg OBJDUMP).  Hence we
408dffb485Schristos    use dgettext (PACKAGE, String) and define PACKAGE to be 'libctf'.
418dffb485Schristos    (See the code in configure).  */
428dffb485Schristos # undef gettext
438dffb485Schristos # define gettext(Msgid) dgettext (PACKAGE, Msgid)
448dffb485Schristos # undef ngettext
458dffb485Schristos # define ngettext(Msgid1, Msgid2, n) dngettext (PACKAGE, Msgid1, Msgid2, n)
468dffb485Schristos # define _(String) gettext (String)
478dffb485Schristos # ifdef gettext_noop
488dffb485Schristos #  define N_(String) gettext_noop (String)
498dffb485Schristos # else
508dffb485Schristos #  define N_(String) String
518dffb485Schristos # endif
528dffb485Schristos #else
538dffb485Schristos # define gettext(Msgid) (Msgid)
548dffb485Schristos # define dgettext(Domainname, Msgid) (Msgid)
558dffb485Schristos # define dcgettext(Domainname, Msgid, Category) (Msgid)
568dffb485Schristos # define ngettext(Msgid1, Msgid2, n) \
578dffb485Schristos   (n == 1 ? Msgid1 : Msgid2)
588dffb485Schristos # define dngettext(Domainname, Msgid1, Msgid2, n) \
598dffb485Schristos   (n == 1 ? Msgid1 : Msgid2)
608dffb485Schristos # define dcngettext(Domainname, Msgid1, Msgid2, n, Category) \
618dffb485Schristos   (n == 1 ? Msgid1 : Msgid2)
628dffb485Schristos # define textdomain(Domainname) do {} while (0)
638dffb485Schristos # define bindtextdomain(Domainname, Dirname) do {} while (0)
648dffb485Schristos # define _(String) (String)
658dffb485Schristos # define N_(String) String
668dffb485Schristos #endif
678dffb485Schristos 
688dffb485Schristos #endif /* _CTF_INTL_H */
69