]> Dogcows Code - chaz/openbox/blob - gettext.h
Fix negative ResizeRelative values with terminal windows (Fix bug 5228)
[chaz/openbox] / gettext.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3 gettext.h for the Openbox window manager
4 Copyright (c) 2003-2007 Dana Jansens
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 /* Convenience header for conditional use of GNU <libintl.h>.
20 Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
21
22 This program is free software; you can redistribute it and/or modify it
23 under the terms of the GNU Library General Public License as published
24 by the Free Software Foundation; either version 2, or (at your option)
25 any later version.
26
27 This program is distributed in the hope that it will be useful,
28 but WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30 Library General Public License for more details.
31
32 You should have received a copy of the GNU Library General Public
33 License along with this program; if not, write to the Free Software
34 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
35 USA. */
36
37 #ifndef _LIBGETTEXT_H
38 #define _LIBGETTEXT_H 1
39
40
41 /* NLS can be disabled through the configure --disable-nls option. */
42 #if ENABLE_NLS
43
44 /* Get declarations of GNU message catalog functions. */
45 # include <libintl.h>
46
47 #else
48
49 /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
50 chokes if dcgettext is defined as a macro. So include it now, to make
51 later inclusions of <locale.h> a NOP. We don't include <libintl.h>
52 as well because people using "gettext.h" will not include <libintl.h>,
53 and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
54 is OK. */
55 #if defined(__sun)
56 # include <locale.h>
57 #endif
58
59 /* Disabled NLS.
60 The casts to 'const char *' serve the purpose of producing warnings
61 for invalid uses of the value returned from these functions.
62 On pre-ANSI systems without 'const', the config.h file is supposed to
63 contain "#define const". */
64 # define gettext(Msgid) ((const char *) (Msgid))
65 # define dgettext(Domainname, Msgid) ((const char *) (Msgid))
66 # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
67 # define ngettext(Msgid1, Msgid2, N) \
68 ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
69 # define dngettext(Domainname, Msgid1, Msgid2, N) \
70 ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
71 # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
72 ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
73 # define textdomain(Domainname) ((const char *) (Domainname))
74 # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
75 # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
76
77 #endif
78
79 /* A pseudo function call that serves as a marker for the automated
80 extraction of messages, but does not call gettext(). The run-time
81 translation is done at a different place in the code.
82 The argument, String, should be a literal string. Concatenated strings
83 and other string expressions won't work.
84 The macro's expansion is not parenthesized, so that it is suitable as
85 initializer for static 'char[]' or 'const char[]' variables. */
86 #define gettext_noop(String) String
87
88 /* Custom macro to make life easier */
89 #define _(str) gettext(str)
90
91 #endif /* _LIBGETTEXT_H */
This page took 0.032719 seconds and 4 git commands to generate.