ManaPlus
gettext.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2007-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef UTILS_GETTEXT_H
24 #define UTILS_GETTEXT_H
25 
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif // HAVE_CONFIG_H
29 
30 #ifdef ENABLE_NLS
31 
32 #include <libintl.h>
33 
34 #define _(s) (const_cast <char*>(gettext(s)))
35 #define N_(s) (const_cast <char*>(s))
36 
37 #elif defined(ENABLE_CUSTOMNLS) // ENABLE_NLS
38 
40 
41 #define gettext(s) const_cast <char*>(mainTranslator->getChar(s))
42 #define _(s) const_cast <char*>(mainTranslator->getChar(s))
43 #define N_(s) (const_cast <char*>(s))
44 #define ngettext(s1, s2, i1) const_cast <char*>(mainTranslator->getChar(s1))
45 
46 #else // ENABLE_NLS
47 
48 #define gettext(s) (const_cast <char*>(s))
49 #define _(s) (const_cast <char*>(s))
50 #define N_(s) (const_cast <char*>(s))
51 #define ngettext(s1, s2, i1) (const_cast <char*>(s1))
52 
53 #endif // ENABLE_NLS
54 
55 #endif // UTILS_GETTEXT_H
podict.h