1 1.1 christos /* opintl.h - opcodes specific header for gettext code. 2 1.11 christos Copyright (C) 1998-2024 Free Software Foundation, Inc. 3 1.1 christos 4 1.1 christos Written by Tom Tromey <tromey (at) cygnus.com> 5 1.1 christos 6 1.1 christos This file is part of the GNU opcodes library. 7 1.1 christos 8 1.1 christos This library is free software; you can redistribute it and/or modify 9 1.1 christos it under the terms of the GNU General Public License as published by 10 1.1 christos the Free Software Foundation; either version 3, or (at your option) 11 1.1 christos any later version. 12 1.1 christos 13 1.1 christos It is distributed in the hope that it will be useful, but WITHOUT 14 1.1 christos ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 1.1 christos or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16 1.1 christos License for more details. 17 1.1 christos 18 1.1 christos You should have received a copy of the GNU General Public License 19 1.1 christos along with this file; see the file COPYING. If not, write to the 20 1.1 christos Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, 21 1.1 christos MA 02110-1301, USA. */ 22 1.1 christos 23 1.1 christos #ifdef ENABLE_NLS 24 1.1 christos # include <libintl.h> 25 1.8 christos /* Note the redefinition of gettext and ngettext here to use PACKAGE. 26 1.6 christos 27 1.8 christos This is because the code in this directory is used to build a 28 1.8 christos library which will be linked with code in other directories to form 29 1.9 christos programs. We want to maintain a separate translation file for this 30 1.8 christos directory however, rather than being forced to merge it with that 31 1.8 christos of any program linked to libopcodes. This is a library, so it 32 1.8 christos cannot depend on the catalog currently loaded. 33 1.8 christos 34 1.8 christos In order to do this, we have to make sure that when we extract 35 1.8 christos messages we use the OPCODES domain rather than the domain of the 36 1.8 christos program that included the opcodes library, (eg OBJDUMP). Hence we 37 1.8 christos use dgettext (PACKAGE, String) and define PACKAGE to be 'opcodes'. 38 1.8 christos (See the code in configure). */ 39 1.8 christos # undef gettext 40 1.8 christos # define gettext(Msgid) dgettext (PACKAGE, Msgid) 41 1.8 christos # undef ngettext 42 1.8 christos # define ngettext(Msgid1, Msgid2, n) dngettext (PACKAGE, Msgid1, Msgid2, n) 43 1.8 christos # define _(String) gettext (String) 44 1.1 christos # ifdef gettext_noop 45 1.1 christos # define N_(String) gettext_noop (String) 46 1.1 christos # else 47 1.1 christos # define N_(String) (String) 48 1.1 christos # endif 49 1.1 christos #else 50 1.1 christos # define gettext(Msgid) (Msgid) 51 1.1 christos # define dgettext(Domainname, Msgid) (Msgid) 52 1.1 christos # define dcgettext(Domainname, Msgid, Category) (Msgid) 53 1.8 christos # define ngettext(Msgid1, Msgid2, n) \ 54 1.8 christos (n == 1 ? Msgid1 : Msgid2) 55 1.8 christos # define dngettext(Domainname, Msgid1, Msgid2, n) \ 56 1.8 christos (n == 1 ? Msgid1 : Msgid2) 57 1.8 christos # define dcngettext(Domainname, Msgid1, Msgid2, n, Category) \ 58 1.8 christos (n == 1 ? Msgid1 : Msgid2) 59 1.8 christos # define textdomain(Domainname) do {} while (0) 60 1.8 christos # define bindtextdomain(Domainname, Dirname) do {} while (0) 61 1.1 christos # define _(String) (String) 62 1.1 christos # define N_(String) (String) 63 1.1 christos #endif 64